haikuwebkit/Source/WebCore/inspector/InspectorAuditResourcesObje...

49 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

Web Inspector: Audit: provide a way to get the contents of resources https://bugs.webkit.org/show_bug.cgi?id=195266 <rdar://problem/48550911> Reviewed by Joseph Pecoraro. Source/JavaScriptCore: * inspector/InjectedScriptBase.cpp: (Inspector::InjectedScriptBase::makeAsyncCall): Drive-by: fix missing `else`. Source/WebCore: Test: inspector/audit/run-resources.html * inspector/InspectorAuditResourcesObject.idl: Added. * inspector/InspectorAuditResourcesObject.h: Added. (WebCore::InspectorAuditResourcesObject::create): (WebCore::InspectorAuditResourcesObject::Resource): (WebCore::InspectorAuditResourcesObject::ResourceContent): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedResourceClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedFontClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedImageClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedRawResourceClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedStyleSheetClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedSVGDocumentClient): * inspector/InspectorAuditResourcesObject.cpp: Added. (WebCore::InspectorAuditResourcesObject::InspectorAuditResourcesObject): (WebCore::InspectorAuditResourcesObject::getResources): (WebCore::InspectorAuditResourcesObject::getResourceContent): (WebCore::InspectorAuditResourcesObject::clientForResource): * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::cachedResourcesForFrame): Added. (WebCore::allResourcesURLsForFrame): Moved a file static function to be a class static function so it can be used elsewhere. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: LayoutTests: * inspector/audit/resources/sample-resource.css: Added. * inspector/audit/resources/sample-resource.js: Added. * inspector/audit/run-resources.html: Added. * inspector/audit/run-resources-expected.txt: Added. Canonical link: https://commits.webkit.org/210031@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-14 10:13:57 +00:00
/*
* Copyright (C) 2019 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
[
ImplementationLacksVTable,
JSGenerateToJSObject,
[WebIDL] Realign our IDL extended attribute names with those specified in WebIDL https://bugs.webkit.org/show_bug.cgi?id=216194 Reviewed by Darin Adler. Source/WebCore: Over time, the WebIDL and HTML specifications have added / renamed extended attributes and we have not stayed up to date. This updates the names everywhere and URLs in IDLAttributes.json. [AllowShared] -> new, marked as unsupported [HTMLConstructor] - > new, marked as unsupported [LegacyLenientSetter] -> renamed from [LenientSetter], still unsupported [LegacyLenientThis] -> renamed from [LenientThis] [LegacyNamespace] -> new, marked as unsupported [LegacyNoInterfaceObject] -> renamed from [NoInterfaceObject] [LegacyNullToEmptyString] -> renamed from [TreatNullAs=EmptyString] [LegacyOverrideBuiltIns] -> renamed from OverrideBuiltins [LegacyTreatNonObjectAsNull] -> renamed from [TreatNonObjectAsNull], still unsupported [LegacyUnforgeable] -> renamed from [Unforgeable] [Serializable] -> new, marked as unsupported [Transferable] -> new, marked as unsupported * Modules/applepay/ApplePayCancelEvent.idl: * Modules/applepay/ApplePayPaymentAuthorizedEvent.idl: * Modules/applepay/ApplePayPaymentMethodSelectedEvent.idl: * Modules/applepay/ApplePayShippingContactSelectedEvent.idl: * Modules/applepay/ApplePayShippingMethodSelectedEvent.idl: * Modules/applepay/ApplePayValidateMerchantEvent.idl: * Modules/fetch/FetchBody.idl: * Modules/mediacontrols/MediaControlsHost.idl: * Modules/mediasource/VideoPlaybackQuality.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/plugins/QuickTimePluginReplacement.idl: * Modules/quota/StorageInfo.idl: * Modules/quota/StorageQuota.idl: * Modules/speech/SpeechSynthesis.idl: * Modules/speech/SpeechSynthesisVoice.idl: * Modules/streams/ReadableStreamSink.idl: * Modules/streams/ReadableStreamSource.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.idl: * Modules/webaudio/WebKitAudioListener.idl: * Modules/webaudio/WebKitDynamicsCompressorNode.idl: * Modules/webaudio/WebKitOscillatorNode.idl: * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: * accessibility/AccessibilityRole.idl: * accessibility/AriaAttributes.idl: * animation/Animatable.idl: * bindings/IDLTypes.h: * bindings/js/DOMWrapperWorld.h: (WebCore::DOMWrapperWorld::disableLegacyOverrideBuiltInsBehavior): (WebCore::DOMWrapperWorld::shouldDisableLegacyOverrideBuiltInsBehavior const): (WebCore::DOMWrapperWorld::disableOverrideBuiltinsBehavior): Deleted. (WebCore::DOMWrapperWorld::shouldDisableOverrideBuiltinsBehavior const): Deleted. * bindings/js/JSDOMAbstractOperations.h: (WebCore::isVisibleNamedProperty): (WebCore::accessVisibleNamedProperty): * bindings/js/JSDOMConvertNullable.h: * bindings/js/JSDOMConvertStrings.h: (WebCore::Converter<IDLTreatNullAsEmptyAdaptor<T>>::convert): Deleted. (WebCore::JSConverter<IDLTreatNullAsEmptyAdaptor<T>>::convert): Deleted. * bindings/scripts/CodeGeneratorJS.pm: (GenerateGetOwnPropertySlot): (GenerateGetOwnPropertySlotByIndex): (GeneratePut): (GeneratePutByIndex): (GenerateIsLegacyUnforgeablePropertyName): (GenerateDefineOwnProperty): (GenerateDeletePropertyCommon): (AttributeShouldBeOnInstance): (OperationShouldBeOnInstance): (IsAcceleratedDOMAttribute): (GetJSCAttributesForAttribute): (GenerateHeader): (GenerateImplementation): (GenerateAttributeGetterTrampolineDefinition): (GenerateAttributeSetterTrampolineDefinition): (IsAnnotatedType): (GetAnnotatedIDLType): (GenerateConstructorHelperMethods): (NeedsConstructorProperty): (IsLegacyUnforgeable): (ComputeFunctionSpecial): (GenerateIsUnforgeablePropertyName): Deleted. (IsUnforgeable): Deleted. * bindings/scripts/IDLAttributes.json: * bindings/scripts/preprocess-idls.pl: * bindings/scripts/test/BindingTestGlobalConstructors.idl: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.cpp: Added. * bindings/scripts/test/JS/JSTestLegacyOverrideBuiltIns.h: Added. * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.cpp: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeableProperties.h: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.cpp: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.h: Added. * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: Removed. * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: Removed. * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: Removed. * bindings/scripts/test/SupplementalDependencies.dep: * bindings/scripts/test/TestIncludes.idl: * bindings/scripts/test/TestLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyUnforgeableProperties.idl: Added. * bindings/scripts/test/TestNamedSetterWithLegacyUnforgeablePropertiesAndLegacyOverrideBuiltIns.idl: Added. * bindings/scripts/test/TestNamedSetterWithOverrideBuiltins.idl: Removed. * bindings/scripts/test/TestNamedSetterWithUnforgableProperties.idl: Removed. * bindings/scripts/test/TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.idl: Removed. * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestOperationBase.idl: * bindings/scripts/test/TestOverrideBuiltins.idl: Removed. * css/CSSStyleDeclaration.idl: * css/CSSUnknownRule.idl: * css/ElementCSSInlineStyle.idl: * css/MediaList.idl: * css/StyleMedia.idl: * dom/CharacterData.idl: * dom/ChildNode.idl: * dom/DOMImplementation.idl: * dom/DOMStringMap.idl: * dom/DeviceOrientationOrMotionEvent.idl: * dom/Document.idl: * dom/DocumentAndElementEventHandlers.idl: * dom/DocumentOrShadowRoot.idl: * dom/Element.idl: * dom/Event.idl: * dom/EventListener.idl: * dom/GlobalEventHandlers.idl: * dom/NavigatorMaxTouchPoints.idl: * dom/NonDocumentTypeChildNode.idl: * dom/NonElementParentNode.idl: * dom/ParentNode.idl: * dom/ShadowRoot.idl: * dom/Slotable.idl: * html/HTMLBodyElement.idl: * html/HTMLDocument.idl: * html/HTMLElement.idl: * html/HTMLFontElement.idl: * html/HTMLFormElement.idl: * html/HTMLFrameElement.idl: * html/HTMLHyperlinkElementUtils.idl: * html/HTMLIFrameElement.idl: * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOrForeignElement.idl: * html/HTMLOutputElement.idl: * html/HTMLTableCellElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTextAreaElement.idl: * html/canvas/ANGLEInstancedArrays.idl: * html/canvas/CanvasCompositing.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasDrawPath.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasFilters.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasImageSmoothing.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPathDrawingStyles.idl: * html/canvas/CanvasRect.idl: * html/canvas/CanvasShadowStyles.idl: * html/canvas/CanvasState.idl: * html/canvas/CanvasText.idl: * html/canvas/CanvasTextDrawingStyles.idl: * html/canvas/CanvasTransform.idl: * html/canvas/CanvasUserInterface.idl: * html/canvas/EXTBlendMinMax.idl: * html/canvas/EXTColorBufferFloat.idl: * html/canvas/EXTColorBufferHalfFloat.idl: * html/canvas/EXTFragDepth.idl: * html/canvas/EXTShaderTextureLOD.idl: * html/canvas/EXTTextureFilterAnisotropic.idl: * html/canvas/EXTsRGB.idl: * html/canvas/OESElementIndexUint.idl: * html/canvas/OESStandardDerivatives.idl: * html/canvas/OESTextureFloat.idl: * html/canvas/OESTextureFloatLinear.idl: * html/canvas/OESTextureHalfFloat.idl: * html/canvas/OESTextureHalfFloatLinear.idl: * html/canvas/OESVertexArrayObject.idl: * html/canvas/WebGLColorBufferFloat.idl: * html/canvas/WebGLCompressedTextureASTC.idl: * html/canvas/WebGLCompressedTextureATC.idl: * html/canvas/WebGLCompressedTextureETC.idl: * html/canvas/WebGLCompressedTextureETC1.idl: * html/canvas/WebGLCompressedTexturePVRTC.idl: * html/canvas/WebGLCompressedTextureS3TC.idl: * html/canvas/WebGLCompressedTextureS3TCsRGB.idl: * html/canvas/WebGLDebugRendererInfo.idl: * html/canvas/WebGLDebugShaders.idl: * html/canvas/WebGLDepthTexture.idl: * html/canvas/WebGLDrawBuffers.idl: * html/canvas/WebGLLoseContext.idl: * html/canvas/WebGLRenderingContextBase.idl: * html/canvas/WebGLVertexArrayObjectOES.idl: * html/track/TextTrackCueGeneric.idl: * html/track/VTTRegionList.idl: * inspector/CommandLineAPIHost.idl: * inspector/InspectorFrontendHost.idl: * page/DOMWindow.idl: * page/GlobalCrypto.idl: * page/GlobalPerformance.idl: * page/Location.idl: * page/NavigatorID.idl: * page/NavigatorLanguage.idl: * page/NavigatorOnLine.idl: * page/NavigatorPlugins.idl: * page/NavigatorServiceWorker.idl: * page/NavigatorShare.idl: * page/RemoteDOMWindow.idl: * page/WindowEventHandlers.idl: * page/WindowOrWorkerGlobalScope.idl: * svg/SVGFilterPrimitiveStandardAttributes.idl: * svg/SVGFitToViewBox.idl: * svg/SVGTests.idl: * svg/SVGURIReference.idl: * svg/SVGZoomAndPan.idl: * testing/GCObservation.idl: * testing/InternalSettings.idl: * testing/Internals.idl: * testing/InternalsMapLike.idl: * testing/InternalsSetLike.idl: * testing/MallocStatistics.idl: * testing/MemoryInfo.idl: * testing/MockCDMFactory.idl: * testing/MockContentFilterSettings.idl: * testing/MockPageOverlay.idl: * testing/MockPaymentCoordinator.idl: * testing/ServiceWorkerInternals.idl: * testing/TypeConversions.idl: * testing/WebFakeXRDevice.idl: * testing/WebFakeXRInputController.idl: * testing/WebXRTest.idl: * workers/AbstractWorker.idl: * xml/XPathNSResolver.idl: Source/WebKit: * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp: (WebKit::InjectedBundleScriptWorld::disableOverrideBuiltinsBehavior): Update for new name WebCore::DOMWrapperWorld. Canonical link: https://commits.webkit.org/229031@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266662 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-09-05 17:14:23 +00:00
LegacyNoInterfaceObject,
Web Inspector: Audit: provide a way to get the contents of resources https://bugs.webkit.org/show_bug.cgi?id=195266 <rdar://problem/48550911> Reviewed by Joseph Pecoraro. Source/JavaScriptCore: * inspector/InjectedScriptBase.cpp: (Inspector::InjectedScriptBase::makeAsyncCall): Drive-by: fix missing `else`. Source/WebCore: Test: inspector/audit/run-resources.html * inspector/InspectorAuditResourcesObject.idl: Added. * inspector/InspectorAuditResourcesObject.h: Added. (WebCore::InspectorAuditResourcesObject::create): (WebCore::InspectorAuditResourcesObject::Resource): (WebCore::InspectorAuditResourcesObject::ResourceContent): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedResourceClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedFontClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedImageClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedRawResourceClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedStyleSheetClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedSVGDocumentClient): * inspector/InspectorAuditResourcesObject.cpp: Added. (WebCore::InspectorAuditResourcesObject::InspectorAuditResourcesObject): (WebCore::InspectorAuditResourcesObject::getResources): (WebCore::InspectorAuditResourcesObject::getResourceContent): (WebCore::InspectorAuditResourcesObject::clientForResource): * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::cachedResourcesForFrame): Added. (WebCore::allResourcesURLsForFrame): Moved a file static function to be a class static function so it can be used elsewhere. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: LayoutTests: * inspector/audit/resources/sample-resource.css: Added. * inspector/audit/resources/sample-resource.js: Added. * inspector/audit/run-resources.html: Added. * inspector/audit/run-resources-expected.txt: Added. Canonical link: https://commits.webkit.org/210031@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-14 10:13:57 +00:00
] interface InspectorAuditResourcesObject {
[WebIDL] Remove the need to specify [MayThrowException] https://bugs.webkit.org/show_bug.cgi?id=180019 Reviewed by Darin Adler and Chris Dumez. Removes the need to specify [MayThrowException] by deducing it from the bound signature's return value. Any function returning an ExceptionOr is one that throws. In most cases, this was already handled by toJS<>(..., impl.func()), which had overloads for the case that the value was an ExceptionOr. The cases this didn't work for were funtions that returned void, as toJS<>(..., impl.func()) would not compile. To work around this, toJS<>() can now take a lambda as its value, and can determine via the lambda's return type if it needs to throw. For instance, an IDL operation like: [MayThrowException] undefined func(); used to generate a bindings body that looked like the following : auto& impl = castedThis->wrapped(); throwScope.release(); propagateException(*lexicalGlobalObject, throwScope, impl.func()); return JSValue::encode(jsUndefined()); will now generate a bindings body that looks like: auto& impl = castedThis->wrapped(); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.func(); }))); which closely mirrors a non-undefined return operation. This wrapped lambda form is only used for operations returning undefined or promises, as those are the only functions that can return void, but it would be correct to use them for all types, if not a bit more noisy and perhaps a tiny compile time cost. NOTE: The use of `-> decltype(auto)` explicit return type on the lambda is required to perfectly forward reference types, such as those used by owned promises. Otherwise, a copy constructor is invoked. In addition to supporting all operations, this also removes the requirement to annotate named and indexed getters/setters. This mostly just means always defining a throw scope, but for named getters it also meant adding a new helper, `visibleNamedPropertyItemAccessorFunctor` which constructors the item accessor functor for the `accessVisibleNamedProperty` algorithm rather than hard coding it in the generator. Due to increased use of toJS, the code generator is now checking more return types (via AddToImplIncludesForIDLType) so the code generator was able to find a few invalid return types (e.g. use of Promise<bool> rather than Promise<boolean>, etc.) and these have been fixed and will be an error going forward. Would be a nice improvement to the code generator to do type checking up front, rather than as a side effect of code generation, but we will leave that for another day. * bindings/js/JSDOMAbstractOperations.h: (WebCore::visibleNamedPropertyItemAccessorFunctor): Added. Moves the getterFunctor lambda creation from the GenerateNamedGetterLambda subroutine in CodeGeneratorJS.pm, but uses deduction and constexpr to determine if the getter throws. (WebCore::accessVisibleNamedProperty): Rename Functor to ItemAccessor to make it a bit more clear what the type does. * bindings/js/JSDOMConvertBase.h: (WebCore::toJS): (WebCore::toJSNewlyCreated): Replace SFINAE-based overloading of toJS/toJSNewlyCreated with constexpr based conditionals and add the ability to pass in a functor rather than value. If a functor is used, additional code paths for void and ExpectionOr<void> are added which explicitly return jsUndefined(). * bindings/js/JSDOMConvertDate.cpp: Remove incorrect comment about ExecStates that hasn't applied for a while. * bindings/js/JSDOMConvertSequences.h: Fix comment, replacing ExecState with JSGlobalObject. This has been wrong for a while, and this is just a drive by fix. * bindings/js/JSDOMExceptionHandling.h: (WebCore::invokeFunctorPropagatingExceptionIfNecessary): Use an explicit else as part of the constexpr expression to ensure the functor is not called, even in debug builds. * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::createDeferredPromise): Deleted. * bindings/js/JSDOMPromiseDeferred.h: Remove unused createDeferredPromise function. * bindings/scripts/CodeGeneratorJS.pm: (AddMapLikeAttributesAndOperationIfNeeded): (AddSetLikeAttributesAndOperationIfNeeded): Fix return type of mapped clear operation to be `any` rather than `undefined` to match the implementation, which returns a JSValue (e.g. `any`). This is now required as we actually look at the return type via deduction and need it to match. (GenerateNamedGetterLambda): Replace most of the implementation with a call to the new `visibleNamedPropertyItemAccessorFunctor` helper which returns a lambda with the correct behavior depending on the return type of the inner lambda passed. (GenerateGetOwnPropertySlot): (GenerateGetOwnPropertySlotByIndex): (GenerateAttributeGetterBodyDefinition): Match most other parts of the generator and always create a throw scope. (GenerateOperationDefinition): Remove explicit call to propagateException now that toJS() will handle that for us. (GenerateParametersCheck): Remove explicit call to propagateException now that toJS() will handle that for us. (GenerateImplementationFunctionCall): Simplify by using invokeFunctorPropagatingExceptionIfNecessary helper for the "returnArgumentName" case and relying on toJS handling the other cases. (NativeToJSValueMayThrow): Add operation to the list of things that might always throw. (NativeToJSValue): Use the lambda wrapped version of toJS for undefined and promise types, which might both return void and thus require it. To keep most code unchanged, and avoid unnecessary compiler work, we only use the wrapped version when it might be necessary. If it turns out to be cheep enough, it might make sense to always use this form for simplicity. (NeedsExplicitPropagateExceptionCall): Deleted. * bindings/scripts/IDLAttributes.json: Remove MayThrowException. * dom/Element.idl: * dom/Element.h: (WebCore::Element::removeAttributeForBindings): (WebCore::Element::removeAttributeNSForBindings): Add bindings specific versions of `removeAttribute` and `removeAttributeNS` which have a void return type (rather than the bool used by the main implementation) as it is now a requirement that that the bound functions signature match the IDL. * Modules/cache/DOMCache.idl: Use the correct interface name, `FetchRequest`, not `Request`. * Modules/cache/DOMCacheStorage.idl: Use the correct interface name, `DOMCache`, not `Cache`. * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeys.idl: * dom/Document+StorageAccess.idl: * page/Navigator+IsLoggedIn.idl: Use the correct IDL type, `boolean`, not `bool`. * dom/AbortSignal.idl: Update whenSignalAborted to match the return type of implementation, which is `boolean`, not `undefined`. * testing/ServiceWorkerInternals.idl: Use the correct interface name, `FetchResponse`, not `Response`. * workers/service/ServiceWorkerClients.idl: Use the correct interface names, `ServiceWorkerClient`, not `Client`, and `ServiceWorkerWindowClient`, not `WindowClient`. * workers/service/ServiceWorkerWindowClient.idl: Use the correct interface names, `ServiceWorkerWindowClient`, not `WindowClient`. * Modules/applepay/ApplePaySession.idl: * Modules/beacon/Navigator+Beacon.idl: * Modules/cache/DOMWindow+Caches.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl: * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl: * Modules/fetch/FetchHeaders.idl: * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchResponse.idl: * Modules/indexeddb/IDBCursor.idl: * Modules/indexeddb/IDBDatabase.idl: * Modules/indexeddb/IDBFactory.idl: * Modules/indexeddb/IDBIndex.idl: * Modules/indexeddb/IDBKeyRange.idl: * Modules/indexeddb/IDBObjectStore.idl: * Modules/indexeddb/IDBTransaction.idl: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediasession/MediaMetadata.idl: * Modules/mediasession/MediaSession.idl: * Modules/mediasource/MediaSource.idl: * Modules/mediasource/SourceBuffer.idl: * Modules/mediastream/RTCDTMFSender.idl: * Modules/mediastream/RTCDataChannel.idl: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCRtpReceiver+Transform.idl: * Modules/mediastream/RTCRtpSFrameTransform.idl: * Modules/mediastream/RTCRtpScriptTransformer.idl: * Modules/mediastream/RTCRtpSender+Transform.idl: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpTransceiver.idl: * Modules/paymentrequest/MerchantValidationEvent.idl: * Modules/paymentrequest/PaymentRequestUpdateEvent.idl: * Modules/speech/SpeechRecognition.idl: * Modules/webaudio/AudioBuffer.idl: * Modules/webaudio/AudioBufferSourceNode.idl: * Modules/webaudio/AudioContext.idl: * Modules/webaudio/AudioListener.idl: * Modules/webaudio/AudioNode.idl: * Modules/webaudio/AudioParam.idl: * Modules/webaudio/AudioScheduledSourceNode.idl: * Modules/webaudio/AudioWorkletGlobalScope.idl: * Modules/webaudio/AudioWorkletProcessor.idl: * Modules/webaudio/BaseAudioContext.idl: * Modules/webaudio/BiquadFilterNode.idl: * Modules/webaudio/IIRFilterNode.idl: * Modules/webaudio/PannerNode.idl: * Modules/webaudio/WebKitAudioBufferSourceNode.idl: * Modules/webaudio/WebKitAudioContext.idl: * Modules/webdatabase/SQLResultSetRowList.idl: * Modules/webdatabase/SQLTransaction.idl: * Modules/websockets/WebSocket.idl: * Modules/webxr/WebXRFrame.idl: * Modules/webxr/WebXRReferenceSpace.idl: * Modules/webxr/WebXRSession.idl: * Modules/webxr/WebXRWebGLLayer.idl: * animation/Animatable.idl: * animation/AnimationEffect.idl: * animation/KeyframeEffect.idl: * animation/WebAnimation.idl: * css/CSSGroupingRule.idl: * css/CSSStyleDeclaration.idl: * css/CSSStyleSheet.idl: * css/DOMCSSNamespace+CSSPropertiesandValues.idl: * css/DOMMatrix.idl: * css/DOMMatrixReadOnly.idl: * css/DeprecatedCSSOMPrimitiveValue.idl: * css/FontFaceSet.idl: * css/MediaList.idl: * dom/CharacterData.idl: * dom/ChildNode.idl: * dom/CustomElementRegistry.idl: * dom/DOMImplementation.idl: * dom/DOMPointReadOnly.idl: * dom/DataTransferItemList.idl: * dom/Document+HTML.idl: * dom/Document.idl: * dom/Element+DOMParsing.idl: * dom/Element+PointerEvents.idl: * dom/EventTarget.idl: * dom/MessagePort.idl: * dom/MutationObserver.idl: * dom/NamedNodeMap.idl: * dom/Node.idl: * dom/NodeIterator.idl: * dom/ParentNode.idl: * dom/Range+DOMParsing.idl: * dom/Range.idl: * dom/Text.idl: * dom/TextDecoder.idl: * dom/TextDecoderStreamDecoder.idl: * dom/TreeWalker.idl: * fileapi/Blob.idl: * fileapi/FileReader.idl: * fileapi/FileReaderSync.idl: * html/DOMTokenList.idl: * html/HTMLCanvasElement.idl: * html/HTMLDialogElement.idl: * html/HTMLEmbedElement.idl: * html/HTMLFrameElement.idl: * html/HTMLIFrameElement.idl: * html/HTMLInputElement.idl: * html/HTMLMediaElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOptionsCollection.idl: * html/HTMLSelectElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTableSectionElement.idl: * html/HTMLTextAreaElement.idl: * html/HTMLVideoElement.idl: * html/OffscreenCanvas.idl: * html/TimeRanges.idl: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasGradient.idl: * html/canvas/CanvasImageData.idl: * html/canvas/CanvasPath.idl: * html/canvas/CanvasPattern.idl: * html/canvas/CanvasTransform.idl: * html/canvas/ImageBitmapRenderingContext.idl: * html/canvas/Path2D.idl: * html/canvas/WebGL2RenderingContext.idl: * html/canvas/WebGLRenderingContextBase.idl: * html/track/TextTrack.idl: * inspector/InspectorAuditAccessibilityObject.idl: * inspector/InspectorAuditDOMObject.idl: * inspector/InspectorAuditResourcesObject.idl: * loader/appcache/DOMApplicationCache.idl: * page/Crypto.idl: * page/DOMSelection.idl: * page/DOMWindow.idl: * page/History.idl: * page/Location.idl: * page/NavigatorServiceWorker.idl: * page/Performance+UserTiming.idl: * page/PerformanceObserver.idl: * page/UndoManager.idl: * page/UserMessageHandler.idl: * page/WindowOrWorkerGlobalScope.idl: * storage/Storage.idl: * svg/SVGAngle.idl: * svg/SVGGeometryElement.idl: * svg/SVGGraphicsElement.idl: * svg/SVGLength.idl: * svg/SVGLengthList.idl: * svg/SVGMatrix.idl: * svg/SVGNumberList.idl: * svg/SVGPathSegList.idl: * svg/SVGPointList.idl: * svg/SVGStringList.idl: * svg/SVGTextContentElement.idl: * svg/SVGTransform.idl: * svg/SVGTransformList.idl: * testing/InternalSettings.idl: * testing/Internals.idl: * workers/DedicatedWorkerGlobalScope.idl: * workers/Worker.idl: * workers/WorkerGlobalScope.idl: * workers/service/ExtendableEvent.idl: * workers/service/FetchEvent.idl: * workers/service/ServiceWorker.idl: * workers/service/ServiceWorkerClient.idl: * worklets/PaintWorkletGlobalScope.idl: * xml/DOMParser.idl: * xml/XMLHttpRequest.idl: * xml/XPathEvaluatorBase.idl: * xml/XPathExpression.idl: * xml/XPathResult.idl: Remove use of [MayThrowException]. * bindings/scripts/test/JS/*: Remove uses of [MayThrowException] in the tests and update all the test results. Canonical link: https://commits.webkit.org/235627@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@274832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-03-23 00:49:01 +00:00
[CallWith=Document] sequence<Resource> getResources();
[CallWith=Document] ResourceContent getResourceContent(DOMString id);
Web Inspector: Audit: provide a way to get the contents of resources https://bugs.webkit.org/show_bug.cgi?id=195266 <rdar://problem/48550911> Reviewed by Joseph Pecoraro. Source/JavaScriptCore: * inspector/InjectedScriptBase.cpp: (Inspector::InjectedScriptBase::makeAsyncCall): Drive-by: fix missing `else`. Source/WebCore: Test: inspector/audit/run-resources.html * inspector/InspectorAuditResourcesObject.idl: Added. * inspector/InspectorAuditResourcesObject.h: Added. (WebCore::InspectorAuditResourcesObject::create): (WebCore::InspectorAuditResourcesObject::Resource): (WebCore::InspectorAuditResourcesObject::ResourceContent): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedResourceClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedFontClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedImageClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedRawResourceClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedStyleSheetClient): (WebCore::InspectorAuditResourcesObject::InspectorAuditCachedSVGDocumentClient): * inspector/InspectorAuditResourcesObject.cpp: Added. (WebCore::InspectorAuditResourcesObject::InspectorAuditResourcesObject): (WebCore::InspectorAuditResourcesObject::getResources): (WebCore::InspectorAuditResourcesObject::getResourceContent): (WebCore::InspectorAuditResourcesObject::clientForResource): * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::cachedResourcesForFrame): Added. (WebCore::allResourcesURLsForFrame): Moved a file static function to be a class static function so it can be used elsewhere. * CMakeLists.txt: * DerivedSources-input.xcfilelist: * DerivedSources-output.xcfilelist: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: LayoutTests: * inspector/audit/resources/sample-resource.css: Added. * inspector/audit/resources/sample-resource.js: Added. * inspector/audit/run-resources.html: Added. * inspector/audit/run-resources-expected.txt: Added. Canonical link: https://commits.webkit.org/210031@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242941 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-03-14 10:13:57 +00:00
};
[
JSGenerateToJSObject,
] dictionary Resource {
DOMString id;
DOMString url;
DOMString mimeType;
};
[
JSGenerateToJSObject,
] dictionary ResourceContent {
DOMString data;
boolean base64Encoded;
};