Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ece657661ad46302875a54326e76db149713a8f4
      
https://github.com/WebKit/WebKit/commit/ece657661ad46302875a54326e76db149713a8f4
  Author: Sam Weinig <[email protected]>
  Date:   2024-12-02 (Mon, 02 Dec 2024)

  Changed paths:
    M Source/WebCore/Modules/WebGPU/GPUDevice.cpp
    M Source/WebCore/Modules/entriesapi/ErrorCallback.h
    M Source/WebCore/Modules/entriesapi/FileCallback.h
    M Source/WebCore/Modules/entriesapi/FileSystemEntriesCallback.h
    M Source/WebCore/Modules/entriesapi/FileSystemEntryCallback.h
    M Source/WebCore/Modules/geolocation/PositionCallback.h
    M Source/WebCore/Modules/geolocation/PositionErrorCallback.h
    M Source/WebCore/Modules/mediasession/MediaSessionActionHandler.h
    M Source/WebCore/Modules/notifications/NotificationPermissionCallback.h
    M Source/WebCore/Modules/remoteplayback/RemotePlaybackAvailabilityCallback.h
    M Source/WebCore/Modules/reporting/ReportingObserverCallback.h
    M Source/WebCore/Modules/web-locks/WebLockGrantedCallback.h
    M Source/WebCore/Modules/web-locks/WebLockGrantedCallback.idl
    M Source/WebCore/Modules/web-locks/WebLockManager.cpp
    M Source/WebCore/Modules/webaudio/AudioBufferCallback.h
    M Source/WebCore/Modules/webaudio/AudioWorkletProcessorConstructor.h
    M Source/WebCore/Modules/webcodecs/WebCodecsAudioDataOutputCallback.h
    M 
Source/WebCore/Modules/webcodecs/WebCodecsEncodedAudioChunkOutputCallback.h
    M 
Source/WebCore/Modules/webcodecs/WebCodecsEncodedVideoChunkOutputCallback.h
    M Source/WebCore/Modules/webcodecs/WebCodecsErrorCallback.h
    M Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameOutputCallback.h
    M Source/WebCore/Modules/webdatabase/DatabaseCallback.h
    M Source/WebCore/Modules/webdatabase/SQLStatementCallback.h
    M Source/WebCore/Modules/webdatabase/SQLStatementErrorCallback.h
    M Source/WebCore/Modules/webdatabase/SQLTransactionCallback.h
    M Source/WebCore/Modules/webdatabase/SQLTransactionErrorCallback.h
    M Source/WebCore/Modules/webxr/WebXRSystem.cpp
    M Source/WebCore/Modules/webxr/XRFrameRequestCallback.h
    M Source/WebCore/animation/CustomEffectCallback.h
    M Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
    M Source/WebCore/bindings/scripts/IDLAttributes.json
    M Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionGenerateIsReachable.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionGenerateIsReachable.h
    R Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp
    R Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithVariadic.cpp
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithVariadic.h
    M Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h
    M 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackWithFunctionOrDict.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestCallbackWithFunctionOrDict.h
    M Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp
    M Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.h
    M Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep
    R Source/WebCore/bindings/scripts/test/TestCallbackFunctionRethrow.idl
    M Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl
    M Source/WebCore/css/CSSPaintCallback.h
    M Source/WebCore/dom/AbortAlgorithm.h
    M Source/WebCore/dom/ContentVisibilityDocumentState.cpp
    M Source/WebCore/dom/CreateHTMLCallback.h
    M Source/WebCore/dom/CreateHTMLCallback.idl
    M Source/WebCore/dom/CreateScriptCallback.h
    M Source/WebCore/dom/CreateScriptCallback.idl
    M Source/WebCore/dom/CreateScriptURLCallback.h
    M Source/WebCore/dom/CreateScriptURLCallback.idl
    M Source/WebCore/dom/IdleRequestCallback.h
    M Source/WebCore/dom/InternalObserverDrop.cpp
    M Source/WebCore/dom/InternalObserverEvery.cpp
    M Source/WebCore/dom/InternalObserverFilter.cpp
    M Source/WebCore/dom/InternalObserverFind.cpp
    M Source/WebCore/dom/InternalObserverForEach.cpp
    M Source/WebCore/dom/InternalObserverMap.cpp
    M Source/WebCore/dom/InternalObserverSome.cpp
    M Source/WebCore/dom/InternalObserverTake.cpp
    M Source/WebCore/dom/MapperCallback.h
    M Source/WebCore/dom/MapperCallback.idl
    M Source/WebCore/dom/MutationCallback.h
    M Source/WebCore/dom/NativeNodeFilter.cpp
    M Source/WebCore/dom/NativeNodeFilter.h
    M Source/WebCore/dom/NodeFilter.h
    M Source/WebCore/dom/NodeFilter.idl
    M Source/WebCore/dom/Observable.cpp
    M Source/WebCore/dom/PredicateCallback.h
    M Source/WebCore/dom/PredicateCallback.idl
    M Source/WebCore/dom/RequestAnimationFrameCallback.h
    M Source/WebCore/dom/StringCallback.h
    M Source/WebCore/dom/SubscriberCallback.h
    M Source/WebCore/dom/SubscriberCallback.idl
    M Source/WebCore/dom/SubscriptionObserverCallback.h
    M Source/WebCore/dom/VisitorCallback.h
    M Source/WebCore/dom/VisitorCallback.idl
    M Source/WebCore/fileapi/BlobCallback.h
    M Source/WebCore/html/LazyLoadFrameObserver.cpp
    M Source/WebCore/html/LazyLoadImageObserver.cpp
    M Source/WebCore/html/VideoFrameRequestCallback.h
    M Source/WebCore/html/VoidCallback.h
    M Source/WebCore/inspector/RTCLogsCallback.h
    M Source/WebCore/inspector/agents/InspectorDatabaseAgent.cpp
    M Source/WebCore/page/IntersectionObserverCallback.h
    M Source/WebCore/page/PerformanceObserverCallback.h
    M Source/WebCore/page/ResizeObserverCallback.h
    M Source/WebCore/testing/XRSimulateUserActivationFunction.h
    M Source/WebCore/xml/CustomXPathNSResolver.h

  Log Message:
  -----------
  [WebIDL] Callbacks should leave the choice to report or rethrow exceptions to 
the invoker (part 2, emit rethrowing handler for all callbacks)
https://bugs.webkit.org/show_bug.cgi?id=283179

Reviewed by Chris Dumez.

Part 2 (final part) of a series to move the decision choice of a WebIDL 
callback to report
exceptions or rethrow them to the caller instead of it being baked into the 
type.

This change removes the extended attribute, [RethrowException], and updates all 
callbacks
(except ones returning promises, more on this below) to generate both an 
unadorned callback
function `<name>(...)` as well as one called `<name>RethrowingException(...)`. 
This requires
all callback base classes to add the second pure virtual function (which is the 
majority of
this change).

Callbacks returning promises currently have their own special code path that 
always does the
same thing regardless of whether [RethrowException] is present or not. This 
maintains that
behavior by having callbacks that return promises only generate the one 
implementation.

* Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:
    - Split out generation of the callback function body into its own function 
with a
      parameter to specify if it should be the unadorned version or the the 
rethrowing
      version. Both now get generated unless returning a promise.

* Source/WebCore/bindings/scripts/IDLAttributes.json:
    - Remove [RethrowException] extended attribute.

* Source/WebCore/Modules/web-locks/WebLockGrantedCallback.idl:
* Source/WebCore/Modules/web-locks/WebLockGrantedCallback.h:
* Source/WebCore/Modules/web-locks/WebLockManager.cpp:
    - Update promise returning callback to use unadorned naming.

* Source/WebCore/Modules/entriesapi/ErrorCallback.h:
* Source/WebCore/Modules/entriesapi/FileCallback.h:
* Source/WebCore/Modules/entriesapi/FileSystemEntriesCallback.h:
* Source/WebCore/Modules/entriesapi/FileSystemEntryCallback.h:
* Source/WebCore/Modules/geolocation/PositionCallback.h:
* Source/WebCore/Modules/geolocation/PositionErrorCallback.h:
* Source/WebCore/Modules/mediasession/MediaSessionActionHandler.h:
* Source/WebCore/Modules/notifications/NotificationPermissionCallback.h:
* Source/WebCore/Modules/remoteplayback/RemotePlaybackAvailabilityCallback.h:
* Source/WebCore/Modules/reporting/ReportingObserverCallback.h:
* Source/WebCore/Modules/webaudio/AudioBufferCallback.h:
* Source/WebCore/Modules/webaudio/AudioWorkletProcessorConstructor.h:
* Source/WebCore/Modules/webcodecs/WebCodecsAudioDataOutputCallback.h:
* Source/WebCore/Modules/webcodecs/WebCodecsEncodedAudioChunkOutputCallback.h:
* Source/WebCore/Modules/webcodecs/WebCodecsEncodedVideoChunkOutputCallback.h:
* Source/WebCore/Modules/webcodecs/WebCodecsErrorCallback.h:
* Source/WebCore/Modules/webcodecs/WebCodecsVideoFrameOutputCallback.h:
* Source/WebCore/Modules/webdatabase/DatabaseCallback.h:
* Source/WebCore/Modules/webdatabase/SQLStatementCallback.h:
* Source/WebCore/Modules/webdatabase/SQLStatementErrorCallback.h:
* Source/WebCore/Modules/webdatabase/SQLTransactionCallback.h:
* Source/WebCore/Modules/webdatabase/SQLTransactionErrorCallback.h:
* Source/WebCore/Modules/webxr/XRFrameRequestCallback.h:
* Source/WebCore/Modules/WebGPU/GPUDevice.cpp:
* Source/WebCore/animation/CustomEffectCallback.h:
* Source/WebCore/css/CSSPaintCallback.h:
* Source/WebCore/dom/AbortAlgorithm.h:
* Source/WebCore/dom/CreateHTMLCallback.h:
* Source/WebCore/dom/CreateHTMLCallback.idl:
* Source/WebCore/dom/CreateScriptCallback.h:
* Source/WebCore/dom/CreateScriptCallback.idl:
* Source/WebCore/dom/CreateScriptURLCallback.h:
* Source/WebCore/dom/CreateScriptURLCallback.idl:
* Source/WebCore/dom/IdleRequestCallback.h:
* Source/WebCore/dom/InternalObserverDrop.cpp:
* Source/WebCore/dom/InternalObserverEvery.cpp:
* Source/WebCore/dom/InternalObserverFilter.cpp:
* Source/WebCore/dom/InternalObserverFind.cpp:
* Source/WebCore/dom/InternalObserverForEach.cpp:
* Source/WebCore/dom/InternalObserverMap.cpp:
* Source/WebCore/dom/InternalObserverSome.cpp:
* Source/WebCore/dom/InternalObserverTake.cpp:
* Source/WebCore/dom/MapperCallback.h:
* Source/WebCore/dom/MapperCallback.idl:
* Source/WebCore/dom/MutationCallback.h:
* Source/WebCore/dom/NativeNodeFilter.cpp:
* Source/WebCore/dom/NativeNodeFilter.h:
* Source/WebCore/dom/NodeFilter.h:
* Source/WebCore/dom/NodeFilter.idl:
* Source/WebCore/dom/Observable.cpp:
* Source/WebCore/dom/PredicateCallback.h:
* Source/WebCore/dom/PredicateCallback.idl:
* Source/WebCore/dom/RequestAnimationFrameCallback.h:
* Source/WebCore/dom/StringCallback.h:
* Source/WebCore/dom/SubscriberCallback.h:
* Source/WebCore/dom/SubscriberCallback.idl:
* Source/WebCore/dom/SubscriptionObserverCallback.h:
* Source/WebCore/dom/VisitorCallback.h:
* Source/WebCore/dom/VisitorCallback.idl:
* Source/WebCore/dom/ContentVisibilityDocumentState.cpp:
* Source/WebCore/fileapi/BlobCallback.h:
* Source/WebCore/html/LazyLoadFrameObserver.cpp:
* Source/WebCore/html/LazyLoadImageObserver.cpp:
* Source/WebCore/html/VideoFrameRequestCallback.h:
* Source/WebCore/html/VoidCallback.h:
* Source/WebCore/inspector/RTCLogsCallback.h:
* Source/WebCore/inspector/agents/InspectorDatabaseAgent.cpp:
* Source/WebCore/page/IntersectionObserverCallback.h:
* Source/WebCore/page/PerformanceObserverCallback.h:
* Source/WebCore/page/ResizeObserverCallback.h:
* Source/WebCore/testing/XRSimulateUserActivationFunction.h:
* Source/WebCore/xml/CustomXPathNSResolver.h:
    - Update callback base classes with the rethrowing handler signature and 
remove the
      [RethrowException] extended attribute everywhere.

* Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
* Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunction.h:
* 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionGenerateIsReachable.cpp:
* 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionGenerateIsReachable.h:
* Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp: 
Removed.
* Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.h: 
Removed.
* 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp:
* 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h:
* 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
* Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.h:
* 
Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithVariadic.cpp:
* Source/WebCore/bindings/scripts/test/JS/JSTestCallbackFunctionWithVariadic.h:
* Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
* Source/WebCore/bindings/scripts/test/JS/JSTestCallbackInterface.h:
* Source/WebCore/bindings/scripts/test/JS/JSTestCallbackWithFunctionOrDict.cpp:
* Source/WebCore/bindings/scripts/test/JS/JSTestCallbackWithFunctionOrDict.h:
* Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
* Source/WebCore/bindings/scripts/test/JS/JSTestVoidCallbackFunction.h:
* Source/WebCore/bindings/scripts/test/SupplementalDependencies.dep:
* Source/WebCore/bindings/scripts/test/TestCallbackFunctionRethrow.idl: Removed.
* Source/WebCore/bindings/scripts/test/TestCallbackInterface.idl:
    - Remove test case with [RethrowException] and update generated sources.

Canonical link: https://commits.webkit.org/287224@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to