[WebIDL] Add support for Promise<> attributes
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Aug 2017 01:01:44 +0000 (01:01 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Aug 2017 01:01:44 +0000 (01:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=175246

Reviewed by Yusuke Suzuki.

Introduces and adopts DOMPromiseProxy, a new class for binding promises in a more
straightforward and safe (from a wrapper world perspective) way.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSFontFaceCustom.cpp: Removed.
* bindings/js/JSFontFaceSetCustom.cpp: Removed.
* bindings/js/JSMediaKeySessionCustom.cpp: Removed.
* bindings/js/JSServiceWorkerContainerCustom.cpp: Removed.
* bindings/js/JSWebGPUCommandBufferCustom.cpp: Removed.

    Remove custom bindings only needed for promise attributes. Add DOMPromiseProxy.h

* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::sessionClosed):
(WebCore::MediaKeySession::registerClosedPromise): Deleted.
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeySession.idl:

    Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.

* bindings/IDLTypes.h:

    Add StorageType type alias to allow specifying a specific form for storage. This allows
    use to use Ref<> for interfaces in DOMPromiseProxy.

(WebCore::IDLWrapper::convertToParameterType):

    Also add convertToParameterType, an annoying hack to workaround the fact WTF::Function
    can't return references / no

* bindings/js/DOMPromiseProxy.h: Added.
(WebCore::DOMPromiseProxy<IDLType>):

    DOMPromiseProxy is a new class (set of classes) to represent promises that works with the
    standard toJS<> / JSDOMConvert infrastructure used by the bindings generator. From the
    implementation perspective, it is similar to DOMPromiseDeferred, but instead of receiving
    one as a parameter, you can initialize it directly in your constructor and start using it.

    From the bindings perspective, a DOMPromiseProxy can be converted into a JS Promise by calling
    its promise function, which will either create a new promise, or return a cached one.

    To make this work, DOMPromiseProxy maintains a Vector of DeferredPromises that hold onto those
    actualized promises. The reason it has a Vector, is that we need one DeferredPromises per
    DOMWrapperWorld, just like we need one wrapper for an interface per DOMWrapperWorld in the
    wrapper cache. In most cases, only the normal world will be in play, so the Vector has an inline
    capacity of one.

    In addition, DOMPromiseProxy maintains a Variant of either an Exception or the result value type.
    This allows the DOMPromiseProxy to be resolved or rejected at anytime. Then, when the bindings
    request the promise, the stored result / exception can be resolved / rejected into the promise.

(WebCore::DOMPromiseProxy<IDLVoid>):

    For void promises, we need slightly different semantics (resolve takes no parameters, Value is
    a bit indicating resolved state), so it is specialized.

(WebCore::DOMPromiseProxyWithResolveCallback<IDLType>):

    In addition to the void specialization, we have DOMPromiseProxyWithResolveCallback. Instead of
    storing the value of the resolution directly, this specialization allows the owner to specify
    callback to be called when the resolved value is needed. This is needed to avoid reference
    cycles when the resolved value is the owner such as is the case with FontFace and FontFaceSet.

* bindings/js/JSDOMConvertPromise.h:
(WebCore::JSConverter<IDLPromise<T>>::convert):
Add converter that calls through to the DOMPromiseProxy function promise.

* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::DeferredPromise::callFunction):
(WebCore::DeferredPromise::reject):
* bindings/js/JSDOMPromiseDeferred.h:
(WebCore::DeferredPromise::create):
(WebCore::DeferredPromise::DeferredPromise):

    Add a new create function for DeferredPromise that creates the JSPromiseDeferred for you.
    Also adds a mode to DeferredPromise to allow keeping the promise after resolution. Maintain
    the old behavior as the default.

    Change reject to take an Exception as sink rather than an r-value, to allow DOMPromiseProxy
    to copy a Exception into multiple DeferredPromises. For callers already moving into reject,
    this should be no change.

* bindings/scripts/CodeGeneratorJS.pm:
(AddToIncludesForIDLType):
(GenerateParametersCheck):
(GenerateImplementationFunctionCall):
(NativeToJSValueDOMConvertNeedsState):
(NativeToJSValueDOMConvertNeedsGlobalObject):

    Add support DOMPromiseProxy. For now, this means a new extended attribute, [PromiseProxy],
    but once I convert all the existing promises over to using DOMPromiseProxy, it will be removed.

    Also specify the right #includes for promises and necessary parameters for conversion.

* bindings/scripts/IDLAttributes.json:

    Add [PromiseProxy], a temporary extended attribute for using DOMPromiseProxy.

* css/FontFace.cpp:
* css/FontFace.h:
* css/FontFace.idl:
* css/FontFaceSet.cpp:
* css/FontFaceSet.h:
* css/FontFaceSet.idl:

    Replace custom promise code using the registerPromise idiom with DOMPromiseProxyWithResolveCallback.
    The callback is necessary for these two classes since the value the resolve is themselves, and using
    a normal resolve would create a cycle.

* html/canvas/WebGPUCommandBuffer.cpp:
* html/canvas/WebGPUCommandBuffer.h:
* html/canvas/WebGPUCommandBuffer.idl:
* platform/graphics/cocoa/GPUCommandBufferMetal.mm:
* platform/graphics/gpu/GPUCommandBuffer.cpp:
* platform/graphics/gpu/GPUCommandBuffer.h:

    Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.

* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::NavigatorBase):
* page/NavigatorBase.h:

    Forward declare ServiceWorkerContainer and add an explicit constructor to allow
    removing #include of ServiceWorkerContainer.h in the header, avoiding an #include cycle.

* workers/ServiceWorkerContainer.cpp:
* workers/ServiceWorkerContainer.h:
* workers/ServiceWorkerContainer.idl:

    Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.

* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
* bindings/scripts/test/TestObj.idl:

    Add / update tests.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220433 268f45cc-cd09-0410-ab3c-d52691b4dbfc

39 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp
Source/WebCore/Modules/encryptedmedia/MediaKeySession.h
Source/WebCore/Modules/encryptedmedia/MediaKeySession.idl
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/IDLTypes.h
Source/WebCore/bindings/js/DOMPromiseProxy.h [new file with mode: 0644]
Source/WebCore/bindings/js/JSDOMConvert.h
Source/WebCore/bindings/js/JSDOMConvertPromise.h
Source/WebCore/bindings/js/JSDOMPromiseDeferred.cpp
Source/WebCore/bindings/js/JSDOMPromiseDeferred.h
Source/WebCore/bindings/js/JSFontFaceCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSMediaKeySessionCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSServiceWorkerContainerCustom.cpp [deleted file]
Source/WebCore/bindings/js/JSWebGPUCommandBufferCustom.cpp [deleted file]
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.json
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp
Source/WebCore/bindings/scripts/test/TestObj.idl
Source/WebCore/css/FontFace.cpp
Source/WebCore/css/FontFace.h
Source/WebCore/css/FontFace.idl
Source/WebCore/css/FontFaceSet.cpp
Source/WebCore/css/FontFaceSet.h
Source/WebCore/css/FontFaceSet.idl
Source/WebCore/html/canvas/WebGPUCommandBuffer.cpp
Source/WebCore/html/canvas/WebGPUCommandBuffer.h
Source/WebCore/html/canvas/WebGPUCommandBuffer.idl
Source/WebCore/page/NavigatorBase.cpp
Source/WebCore/page/NavigatorBase.h
Source/WebCore/platform/graphics/cocoa/GPUCommandBufferMetal.mm
Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.cpp
Source/WebCore/platform/graphics/gpu/GPUCommandBuffer.h
Source/WebCore/workers/ServiceWorkerContainer.cpp
Source/WebCore/workers/ServiceWorkerContainer.h
Source/WebCore/workers/ServiceWorkerContainer.idl

index 0fe2f6f..fdba5da 100644 (file)
@@ -1181,8 +1181,6 @@ set(WebCore_SOURCES
     bindings/js/JSDOMConvertWebGL.cpp
     bindings/js/JSDOMIterator.cpp
     bindings/js/JSDeprecatedCSSOMValueCustom.cpp
-    bindings/js/JSFontFaceCustom.cpp
-    bindings/js/JSFontFaceSetCustom.cpp
     bindings/js/JSCallbackData.cpp
     bindings/js/JSCanvasRenderingContext2DCustom.cpp
     bindings/js/JSCryptoAlgorithmBuilder.cpp
@@ -1232,7 +1230,6 @@ set(WebCore_SOURCES
     bindings/js/JSLazyEventListener.cpp
     bindings/js/JSLocationCustom.cpp
     bindings/js/JSMainThreadExecState.cpp
-    bindings/js/JSMediaKeySessionCustom.cpp
     bindings/js/JSMediaStreamTrackCustom.cpp
     bindings/js/JSMessageChannelCustom.cpp
     bindings/js/JSMessageEventCustom.cpp
@@ -1247,7 +1244,6 @@ set(WebCore_SOURCES
     bindings/js/JSReadableStreamPrivateConstructors.cpp
     bindings/js/JSReadableStreamSourceCustom.cpp
     bindings/js/JSSVGPathSegCustom.cpp
-    bindings/js/JSServiceWorkerContainerCustom.cpp
     bindings/js/JSStyleSheetCustom.cpp
     bindings/js/JSSubtleCryptoCustom.cpp
     bindings/js/JSTextCustom.cpp
@@ -1260,7 +1256,6 @@ set(WebCore_SOURCES
     bindings/js/JSVideoTrackListCustom.cpp
     bindings/js/JSWebGL2RenderingContextCustom.cpp
     bindings/js/JSWebGLRenderingContextCustom.cpp
-    bindings/js/JSWebGPUCommandBufferCustom.cpp
     bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp
     bindings/js/JSWebGPURenderingContextCustom.cpp
     bindings/js/JSWebKitSubtleCryptoCustom.cpp
index 08028af..5b44407 100644 (file)
@@ -1,3 +1,148 @@
+2017-08-08  Sam Weinig  <sam@webkit.org>
+
+        [WebIDL] Add support for Promise<> attributes
+        https://bugs.webkit.org/show_bug.cgi?id=175246
+
+        Reviewed by Yusuke Suzuki.
+
+        Introduces and adopts DOMPromiseProxy, a new class for binding promises in a more
+        straightforward and safe (from a wrapper world perspective) way.
+
+        * CMakeLists.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSFontFaceCustom.cpp: Removed.
+        * bindings/js/JSFontFaceSetCustom.cpp: Removed.
+        * bindings/js/JSMediaKeySessionCustom.cpp: Removed.
+        * bindings/js/JSServiceWorkerContainerCustom.cpp: Removed.
+        * bindings/js/JSWebGPUCommandBufferCustom.cpp: Removed.
+
+            Remove custom bindings only needed for promise attributes. Add DOMPromiseProxy.h
+
+        * Modules/encryptedmedia/MediaKeySession.cpp:
+        (WebCore::MediaKeySession::sessionClosed):
+        (WebCore::MediaKeySession::registerClosedPromise): Deleted.
+        * Modules/encryptedmedia/MediaKeySession.h:
+        * Modules/encryptedmedia/MediaKeySession.idl:
+
+            Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.
+
+        * bindings/IDLTypes.h:
+
+            Add StorageType type alias to allow specifying a specific form for storage. This allows
+            use to use Ref<> for interfaces in DOMPromiseProxy.
+
+        (WebCore::IDLWrapper::convertToParameterType):
+            
+            Also add convertToParameterType, an annoying hack to workaround the fact WTF::Function
+            can't return references / no
+
+        * bindings/js/DOMPromiseProxy.h: Added.
+        (WebCore::DOMPromiseProxy<IDLType>):
+        
+            DOMPromiseProxy is a new class (set of classes) to represent promises that works with the 
+            standard toJS<> / JSDOMConvert infrastructure used by the bindings generator. From the
+            implementation perspective, it is similar to DOMPromiseDeferred, but instead of receiving
+            one as a parameter, you can initialize it directly in your constructor and start using it.
+
+            From the bindings perspective, a DOMPromiseProxy can be converted into a JS Promise by calling
+            its promise function, which will either create a new promise, or return a cached one.
+
+            To make this work, DOMPromiseProxy maintains a Vector of DeferredPromises that hold onto those
+            actualized promises. The reason it has a Vector, is that we need one DeferredPromises per
+            DOMWrapperWorld, just like we need one wrapper for an interface per DOMWrapperWorld in the 
+            wrapper cache. In most cases, only the normal world will be in play, so the Vector has an inline
+            capacity of one.
+            
+            In addition, DOMPromiseProxy maintains a Variant of either an Exception or the result value type.
+            This allows the DOMPromiseProxy to be resolved or rejected at anytime. Then, when the bindings
+            request the promise, the stored result / exception can be resolved / rejected into the promise.
+
+        (WebCore::DOMPromiseProxy<IDLVoid>):
+
+            For void promises, we need slightly different semantics (resolve takes no parameters, Value is
+            a bit indicating resolved state), so it is specialized.
+
+        (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>):
+
+            In addition to the void specialization, we have DOMPromiseProxyWithResolveCallback. Instead of
+            storing the value of the resolution directly, this specialization allows the owner to specify
+            callback to be called when the resolved value is needed. This is needed to avoid reference
+            cycles when the resolved value is the owner such as is the case with FontFace and FontFaceSet.
+
+        * bindings/js/JSDOMConvertPromise.h:
+        (WebCore::JSConverter<IDLPromise<T>>::convert):
+        Add converter that calls through to the DOMPromiseProxy function promise.
+
+        * bindings/js/JSDOMPromiseDeferred.cpp:
+        (WebCore::DeferredPromise::callFunction):
+        (WebCore::DeferredPromise::reject):
+        * bindings/js/JSDOMPromiseDeferred.h:
+        (WebCore::DeferredPromise::create):
+        (WebCore::DeferredPromise::DeferredPromise):
+
+            Add a new create function for DeferredPromise that creates the JSPromiseDeferred for you.
+            Also adds a mode to DeferredPromise to allow keeping the promise after resolution. Maintain
+            the old behavior as the default.
+
+            Change reject to take an Exception as sink rather than an r-value, to allow DOMPromiseProxy
+            to copy a Exception into multiple DeferredPromises. For callers already moving into reject,
+            this should be no change.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (AddToIncludesForIDLType):
+        (GenerateParametersCheck):
+        (GenerateImplementationFunctionCall):
+        (NativeToJSValueDOMConvertNeedsState):
+        (NativeToJSValueDOMConvertNeedsGlobalObject):
+
+            Add support DOMPromiseProxy. For now, this means a new extended attribute, [PromiseProxy],
+            but once I convert all the existing promises over to using DOMPromiseProxy, it will be removed.
+            
+            Also specify the right #includes for promises and necessary parameters for conversion.
+
+        * bindings/scripts/IDLAttributes.json:
+        
+            Add [PromiseProxy], a temporary extended attribute for using DOMPromiseProxy.
+
+        * css/FontFace.cpp:
+        * css/FontFace.h:
+        * css/FontFace.idl:
+        * css/FontFaceSet.cpp:
+        * css/FontFaceSet.h:
+        * css/FontFaceSet.idl:
+
+            Replace custom promise code using the registerPromise idiom with DOMPromiseProxyWithResolveCallback.
+            The callback is necessary for these two classes since the value the resolve is themselves, and using
+            a normal resolve would create a cycle.
+
+        * html/canvas/WebGPUCommandBuffer.cpp:
+        * html/canvas/WebGPUCommandBuffer.h:
+        * html/canvas/WebGPUCommandBuffer.idl:
+        * platform/graphics/cocoa/GPUCommandBufferMetal.mm:
+        * platform/graphics/gpu/GPUCommandBuffer.cpp:
+        * platform/graphics/gpu/GPUCommandBuffer.h:
+
+            Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.
+
+        * page/NavigatorBase.cpp:
+        (WebCore::NavigatorBase::NavigatorBase):
+        * page/NavigatorBase.h:
+
+            Forward declare ServiceWorkerContainer and add an explicit constructor to allow
+            removing #include of ServiceWorkerContainer.h in the header, avoiding an #include cycle.
+
+        * workers/ServiceWorkerContainer.cpp:
+        * workers/ServiceWorkerContainer.h:
+        * workers/ServiceWorkerContainer.idl:
+
+            Replace custom promise code using the registerPromise idiom with DOMPromiseProxy.
+
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
+        * bindings/scripts/test/TestObj.idl:
+
+            Add / update tests.
+
 2017-08-08  John Wilander  <wilander@apple.com>
 
         Resource Load Statistics: Merge of dataRecordsRemoved should use std::max()
index 9d0518d..b61c627 100644 (file)
@@ -577,16 +577,6 @@ void MediaKeySession::remove(Ref<DeferredPromise>&& promise)
     // 5. Return promise.
 }
 
-void MediaKeySession::registerClosedPromise(ClosedPromise&& promise)
-{
-    ASSERT(!m_closedPromise);
-    if (m_closed) {
-        promise.resolve();
-        return;
-    }
-    m_closedPromise = WTFMove(promise);
-}
-
 void MediaKeySession::enqueueMessage(MediaKeyMessageType messageType, const SharedBuffer& message)
 {
     // 6.4.1 Queue a "message" Event
@@ -679,8 +669,7 @@ void MediaKeySession::sessionClosed()
 
     // 5. Let promise be the closed attribute of the session.
     // 6. Resolve promise.
-    if (m_closedPromise)
-        m_closedPromise->resolve();
+    m_closedPromise.resolve();
 }
 
 bool MediaKeySession::hasPendingActivity() const
index 0592243..7bc7938 100644 (file)
 
 #include "ActiveDOMObject.h"
 #include "CDMInstance.h"
+#include "DOMPromiseProxy.h"
 #include "EventTarget.h"
 #include "GenericEventQueue.h"
 #include "GenericTaskQueue.h"
-#include "JSDOMPromiseDeferred.h"
 #include "MediaKeyMessageType.h"
 #include "MediaKeySessionType.h"
 #include "MediaKeyStatus.h"
@@ -70,8 +70,8 @@ public:
     void close(Ref<DeferredPromise>&&);
     void remove(Ref<DeferredPromise>&&);
 
-    using ClosedPromise = DOMPromiseDeferred<void>;
-    void registerClosedPromise(ClosedPromise&&);
+    using ClosedPromise = DOMPromiseProxy<IDLVoid>;
+    ClosedPromise& closed() { return m_closedPromise; }
 
     const Vector<std::pair<Ref<SharedBuffer>, MediaKeyStatus>>& statuses() const { return m_statuses; }
 
@@ -96,7 +96,7 @@ private:
 
     String m_sessionId;
     double m_expiration;
-    std::optional<ClosedPromise> m_closedPromise;
+    ClosedPromise m_closedPromise;
     Ref<MediaKeyStatusMap> m_keyStatuses;
     bool m_closed { false };
     bool m_uninitialized { true };
index 52223a8..16d7c10 100644 (file)
@@ -32,7 +32,7 @@
 ] interface MediaKeySession : EventTarget {
     readonly attribute DOMString sessionId;
     readonly attribute unrestricted double expiration;
-    [CustomGetter, CachedAttribute] readonly attribute Promise<void> closed;
+    readonly attribute Promise<void> closed;
     readonly attribute MediaKeyStatusMap keyStatuses;
     attribute EventHandler onkeystatuseschange;
     attribute EventHandler onmessage;
index fd55fd5..11462b9 100644 (file)
                1C24EEA51C729CE40080F8FC /* FontFaceSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C24EEA31C729CE40080F8FC /* FontFaceSet.h */; };
                1C24EEA81C72A7B40080F8FC /* JSFontFaceSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C24EEA61C72A7B40080F8FC /* JSFontFaceSet.cpp */; };
                1C24EEA91C72A7B40080F8FC /* JSFontFaceSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 1C24EEA71C72A7B40080F8FC /* JSFontFaceSet.h */; };
-               1C24EEAB1C72AA0A0080F8FC /* JSFontFaceSetCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C24EEAA1C72AA0A0080F8FC /* JSFontFaceSetCustom.cpp */; };
                1C26497A0D7E248A00BD10F2 /* DocumentLoaderMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C2649790D7E248A00BD10F2 /* DocumentLoaderMac.cpp */; };
                1C3249111C6D6A3B007EDB32 /* FontVariantBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C3249101C6D6A3B007EDB32 /* FontVariantBuilder.cpp */; };
                1C3969D01B74211E002BCFA7 /* FontCacheCoreText.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1C3969CF1B74211E002BCFA7 /* FontCacheCoreText.cpp */; };
                2D9BF7451DBFDC44007A7D99 /* MediaKeySession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BF7351DBFDC0F007A7D99 /* MediaKeySession.cpp */; };
                2D9BF7461DBFDC47007A7D99 /* MediaKeys.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BF7331DBFDC0F007A7D99 /* MediaKeys.cpp */; };
                2D9BF7471DBFDC49007A7D99 /* MediaKeyMessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BF72F1DBFDC0F007A7D99 /* MediaKeyMessageEvent.cpp */; };
-               2D9BF74A1DBFDDFF007A7D99 /* JSMediaKeySessionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2D9BF7481DBFDDF8007A7D99 /* JSMediaKeySessionCustom.cpp */; };
                2D9F0E1314FF1CBF00BA0FF7 /* linearSRGB.icc in Resources */ = {isa = PBXBuildFile; fileRef = 2D9F0E1214FF1CBF00BA0FF7 /* linearSRGB.icc */; };
                2DAF343C1EA7E0F100382CD3 /* ConstantPropertyMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DAF343A1EA7E0F100382CD3 /* ConstantPropertyMap.cpp */; };
                2DAF343D1EA7E0F100382CD3 /* ConstantPropertyMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DAF343B1EA7E0F100382CD3 /* ConstantPropertyMap.h */; };
                37FD4298118368460093C029 /* TreeDepthLimit.h in Headers */ = {isa = PBXBuildFile; fileRef = 37FD4297118368460093C029 /* TreeDepthLimit.h */; };
                387AE95A1E8E92EF0000DE96 /* JSWebGPUSize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 387AE9581E8E92EF0000DE96 /* JSWebGPUSize.cpp */; };
                387AE95B1E8E92EF0000DE96 /* JSWebGPUSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 387AE9591E8E92EF0000DE96 /* JSWebGPUSize.h */; };
-               38850C531E964C1100C60753 /* JSWebGPUCommandBufferCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 38850C521E964C1100C60753 /* JSWebGPUCommandBufferCustom.cpp */; };
                389117411E8F4BF00061033E /* GPUComputeCommandEncoderMetal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 381E35E91E8E20AC0043E850 /* GPUComputeCommandEncoderMetal.mm */; };
                389117421E8F4BF00061033E /* GPUComputePipelineStateMetal.mm in Sources */ = {isa = PBXBuildFile; fileRef = 381E35EE1E8E24CB0043E850 /* GPUComputePipelineStateMetal.mm */; };
                389117431E8F4BF00061033E /* GPUComputeCommandEncoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 381E35EB1E8E21990043E850 /* GPUComputeCommandEncoder.cpp */; };
                51F175071F358BF900C74950 /* JSWorkerType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51F175041F358BDE00C74950 /* JSWorkerType.cpp */; };
                51F798EF1BE880E7008AE491 /* IDBIndexInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51F798EB1BE880D3008AE491 /* IDBIndexInfo.cpp */; };
                51F798F01BE880E7008AE491 /* IDBIndexInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F798EC1BE880D3008AE491 /* IDBIndexInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               51F886BD1F326A9800C193EF /* JSServiceWorkerContainerCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51F886BB1F326A9200C193EF /* JSServiceWorkerContainerCustom.cpp */; };
                51F886C01F32923100C193EF /* JSNavigatorServiceWorker.h in Headers */ = {isa = PBXBuildFile; fileRef = 51F886BF1F32920700C193EF /* JSNavigatorServiceWorker.h */; };
                51F886C11F32923400C193EF /* JSNavigatorServiceWorker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51F886BE1F32920700C193EF /* JSNavigatorServiceWorker.cpp */; };
                51FA2D78152132B300C1BA0B /* DOMWindowExtension.h in Headers */ = {isa = PBXBuildFile; fileRef = 517FBA18151AA71B00B57959 /* DOMWindowExtension.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7C4C96DF1AD4483500365A50 /* JSReadableStreamDefaultReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96DB1AD4483500365A50 /* JSReadableStreamDefaultReader.h */; };
                7C4C96E31AD44ABF00365A50 /* LaunchServicesSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C4C96E21AD44ABF00365A50 /* LaunchServicesSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7C4EDD741A7B607800198C4D /* FontCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7C4EDD731A7B607800198C4D /* FontCocoa.mm */; };
+               7C516AD41F3525200034B6BF /* DOMPromiseProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C516AD21F3525200034B6BF /* DOMPromiseProxy.h */; };
                7C5222961E1DAE03002CB8F7 /* IDLTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C5222951E1DADF8002CB8F7 /* IDLTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7C5222991E1DAE1C002CB8F7 /* ActiveDOMCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 7C5222981E1DAE16002CB8F7 /* ActiveDOMCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
                7C52229A1E1DAE20002CB8F7 /* ActiveDOMCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C5222971E1DAE16002CB8F7 /* ActiveDOMCallback.cpp */; };
                C26017A41C72DC9900F74A16 /* CSSFontFaceSet.h in Headers */ = {isa = PBXBuildFile; fileRef = C26017A21C72DC9900F74A16 /* CSSFontFaceSet.h */; };
                C280833F1C6DC26F001451B6 /* JSFontFace.h in Headers */ = {isa = PBXBuildFile; fileRef = C280833E1C6DC22C001451B6 /* JSFontFace.h */; };
                C28083401C6DC275001451B6 /* JSFontFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C280833D1C6DC22C001451B6 /* JSFontFace.cpp */; };
-               C28083421C6DC96A001451B6 /* JSFontFaceCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C28083411C6DC96A001451B6 /* JSFontFaceCustom.cpp */; };
                C280B3FE1EF4608900D35135 /* FontFamilySpecificationNull.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C280B3FD1EF4608900D35135 /* FontFamilySpecificationNull.cpp */; };
                C2AB0AF61E6B3C6C001348C5 /* FontSelectionAlgorithm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C2AB0AF41E6B3C6C001348C5 /* FontSelectionAlgorithm.cpp */; };
                C2AB0AF71E6B3C6C001348C5 /* FontSelectionAlgorithm.h in Headers */ = {isa = PBXBuildFile; fileRef = C2AB0AF51E6B3C6C001348C5 /* FontSelectionAlgorithm.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1C24EEA31C729CE40080F8FC /* FontFaceSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontFaceSet.h; sourceTree = "<group>"; };
                1C24EEA61C72A7B40080F8FC /* JSFontFaceSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFontFaceSet.cpp; sourceTree = "<group>"; };
                1C24EEA71C72A7B40080F8FC /* JSFontFaceSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFontFaceSet.h; sourceTree = "<group>"; };
-               1C24EEAA1C72AA0A0080F8FC /* JSFontFaceSetCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFontFaceSetCustom.cpp; sourceTree = "<group>"; };
                1C2649790D7E248A00BD10F2 /* DocumentLoaderMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentLoaderMac.cpp; sourceTree = "<group>"; };
                1C3249101C6D6A3B007EDB32 /* FontVariantBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontVariantBuilder.cpp; sourceTree = "<group>"; };
                1C3969CF1B74211E002BCFA7 /* FontCacheCoreText.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontCacheCoreText.cpp; sourceTree = "<group>"; };
                2D9BF73F1DBFDC0F007A7D99 /* MediaKeySystemMediaCapability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaKeySystemMediaCapability.h; sourceTree = "<group>"; };
                2D9BF7401DBFDC0F007A7D99 /* NavigatorEME.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavigatorEME.cpp; sourceTree = "<group>"; };
                2D9BF7411DBFDC0F007A7D99 /* NavigatorEME.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigatorEME.h; sourceTree = "<group>"; };
-               2D9BF7481DBFDDF8007A7D99 /* JSMediaKeySessionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMediaKeySessionCustom.cpp; sourceTree = "<group>"; };
                2D9F0E1214FF1CBF00BA0FF7 /* linearSRGB.icc */ = {isa = PBXFileReference; lastKnownFileType = file; path = linearSRGB.icc; sourceTree = "<group>"; };
                2DAAE32C19DCAF6000E002D2 /* MockPageOverlayClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockPageOverlayClient.cpp; sourceTree = "<group>"; };
                2DAAE32D19DCAF6000E002D2 /* MockPageOverlayClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MockPageOverlayClient.h; sourceTree = "<group>"; };
                381E35F61E8E4D0E0043E850 /* GPUSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUSize.h; sourceTree = "<group>"; };
                387AE9581E8E92EF0000DE96 /* JSWebGPUSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPUSize.cpp; sourceTree = "<group>"; };
                387AE9591E8E92EF0000DE96 /* JSWebGPUSize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGPUSize.h; sourceTree = "<group>"; };
-               38850C521E964C1100C60753 /* JSWebGPUCommandBufferCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPUCommandBufferCustom.cpp; sourceTree = "<group>"; };
                38F23AAE1E8E83C400CE46F5 /* JSWebGPUComputeCommandEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPUComputeCommandEncoder.cpp; sourceTree = "<group>"; };
                38F23AB01E8E83D000CE46F5 /* JSWebGPUComputeCommandEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGPUComputeCommandEncoder.h; sourceTree = "<group>"; };
                38F23AB11E8E83D000CE46F5 /* JSWebGPUComputePipelineState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGPUComputePipelineState.cpp; sourceTree = "<group>"; };
                51F6A3D60663BF04004D2919 /* HTMLCanvasElement.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = HTMLCanvasElement.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                51F798EB1BE880D3008AE491 /* IDBIndexInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBIndexInfo.cpp; sourceTree = "<group>"; };
                51F798EC1BE880D3008AE491 /* IDBIndexInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBIndexInfo.h; sourceTree = "<group>"; };
-               51F886BB1F326A9200C193EF /* JSServiceWorkerContainerCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSServiceWorkerContainerCustom.cpp; sourceTree = "<group>"; };
                51F886BE1F32920700C193EF /* JSNavigatorServiceWorker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSNavigatorServiceWorker.cpp; path = WebCore/JSNavigatorServiceWorker.cpp; sourceTree = "<group>"; };
                51F886BF1F32920700C193EF /* JSNavigatorServiceWorker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSNavigatorServiceWorker.h; path = WebCore/JSNavigatorServiceWorker.h; sourceTree = "<group>"; };
                51FB5502113E3E9100821176 /* JSCloseEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCloseEvent.h; sourceTree = "<group>"; };
                7C4C96DB1AD4483500365A50 /* JSReadableStreamDefaultReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSReadableStreamDefaultReader.h; sourceTree = "<group>"; };
                7C4C96E21AD44ABF00365A50 /* LaunchServicesSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LaunchServicesSPI.h; sourceTree = "<group>"; };
                7C4EDD731A7B607800198C4D /* FontCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FontCocoa.mm; sourceTree = "<group>"; };
+               7C516AD21F3525200034B6BF /* DOMPromiseProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMPromiseProxy.h; sourceTree = "<group>"; };
                7C5222951E1DADF8002CB8F7 /* IDLTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDLTypes.h; sourceTree = "<group>"; };
                7C5222971E1DAE16002CB8F7 /* ActiveDOMCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActiveDOMCallback.cpp; sourceTree = "<group>"; };
                7C5222981E1DAE16002CB8F7 /* ActiveDOMCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ActiveDOMCallback.h; sourceTree = "<group>"; };
                C280833C1C6DB194001451B6 /* FontFace.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FontFace.idl; sourceTree = "<group>"; };
                C280833D1C6DC22C001451B6 /* JSFontFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFontFace.cpp; sourceTree = "<group>"; };
                C280833E1C6DC22C001451B6 /* JSFontFace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSFontFace.h; sourceTree = "<group>"; };
-               C28083411C6DC96A001451B6 /* JSFontFaceCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSFontFaceCustom.cpp; sourceTree = "<group>"; };
                C280B3FD1EF4608900D35135 /* FontFamilySpecificationNull.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontFamilySpecificationNull.cpp; sourceTree = "<group>"; };
                C2AB0AF41E6B3C6C001348C5 /* FontSelectionAlgorithm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FontSelectionAlgorithm.cpp; sourceTree = "<group>"; };
                C2AB0AF51E6B3C6C001348C5 /* FontSelectionAlgorithm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FontSelectionAlgorithm.h; sourceTree = "<group>"; };
                        isa = PBXGroup;
                        children = (
                                7CE1916E1F2AB70D00272F79 /* JSCache.cpp */,
-                               7CE1916E1F2AB70D00272F7A /* JSCacheStorage.cpp */,
-                               7CE1916E1F2AB70D00272F7B /* JSCacheQueryOptions.cpp */,
                                7CE191641F2AB6FB00272F79 /* JSCache.h */,
+                               7CE1916E1F2AB70D00272F7B /* JSCacheQueryOptions.cpp */,
+                               7CE1916E1F2AB70D00272F7A /* JSCacheStorage.cpp */,
                                7CE191641F2AB6FB00272F7A /* JSCacheStorage.h */,
                        );
                        name = CacheAPI;
                        name = Conversions;
                        sourceTree = "<group>";
                };
-               7CBA5BA91F0B51480034D745 /* Promises Only */ = {
-                       isa = PBXGroup;
-                       children = (
-                               C28083411C6DC96A001451B6 /* JSFontFaceCustom.cpp */,
-                               1C24EEAA1C72AA0A0080F8FC /* JSFontFaceSetCustom.cpp */,
-                               2D9BF7481DBFDDF8007A7D99 /* JSMediaKeySessionCustom.cpp */,
-                               38850C521E964C1100C60753 /* JSWebGPUCommandBufferCustom.cpp */,
-                       );
-                       name = "Promises Only";
-                       sourceTree = "<group>";
-               };
                7CD3441B1F32DE30000DCD49 /* Cached Attributes w/ Invalidation */ = {
                        isa = PBXGroup;
                        children = (
                                952076021F2675F9007D2AAB /* CallTracerTypes.h */,
                                0F60F3291DFBB10400416D6C /* CommonVM.cpp */,
                                0F60F32A1DFBB10400416D6C /* CommonVM.h */,
+                               7C516AD21F3525200034B6BF /* DOMPromiseProxy.h */,
                                BC53DA471143134D000D817E /* DOMWrapperWorld.cpp */,
                                BC53DA2D1143121E000D817E /* DOMWrapperWorld.h */,
                                1432E8480C51493F00B1500F /* GCController.cpp */,
                                93B70D5009EB0C7C009D8468 /* JSPluginElementFunctions.h */,
                                4129DF831BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.cpp */,
                                4129DF841BB5B7F700322A16 /* JSReadableStreamPrivateConstructors.h */,
-                               51F886BB1F326A9200C193EF /* JSServiceWorkerContainerCustom.cpp */,
                                E1C36D320EB0A094007410BC /* JSWorkerGlobalScopeBase.cpp */,
                                E1C36D330EB0A094007410BC /* JSWorkerGlobalScopeBase.h */,
                                709A01FD1E3D0BCC006B0D4C /* ModuleFetchFailureKind.h */,
                BC4EDEF70C08F414007EDD49 /* Custom */ = {
                        isa = PBXGroup;
                        children = (
-                               7C3D8EE41E08BABE0023B084 /* GC / Wrapping Only */,
-                               7CBA5BA91F0B51480034D745 /* Promises Only */,
                                7CD3441B1F32DE30000DCD49 /* Cached Attributes w/ Invalidation */,
+                               7C3D8EE41E08BABE0023B084 /* GC / Wrapping Only */,
                                E157A8E618184C67009F821D /* JSCryptoKeyCustom.cpp */,
                                9BC5F9DF1D5AAF6A002B749D /* JSCustomElementRegistryCustom.cpp */,
                                BCD9C25E0C17AA67005C90A2 /* JSDOMWindowCustom.cpp */,
                                FD31601D12B0267600C1A359 /* AudioParam.h in Headers */,
                                FD359190138DB22000E1EBEC /* AudioParamTimeline.h in Headers */,
                                FD31602012B0267600C1A359 /* AudioProcessingEvent.h in Headers */,
-                               5182C2581F3143CD0059BA7C /* JSServiceWorkerContainer.h in Headers */,
                                FD31608412B026F700C1A359 /* AudioProcessor.h in Headers */,
                                FD31608612B026F700C1A359 /* AudioResampler.h in Headers */,
                                FD31608812B026F700C1A359 /* AudioResamplerKernel.h in Headers */,
                                1A569CFC0D7E2B82007C3983 /* c_runtime.h in Headers */,
                                1A569CFE0D7E2B82007C3983 /* c_utility.h in Headers */,
                                07C046C41E42508B007201E7 /* CAAudioStreamDescription.h in Headers */,
+                               41380C271F3436AC00155FDA /* Cache.h in Headers */,
                                BCB16C1A0979C3BD00467741 /* CachedCSSStyleSheet.h in Headers */,
                                BC64B4CC0CB4295D005F2B62 /* CachedFont.h in Headers */,
                                1AEF4E67170E160300AB2799 /* CachedFontClient.h in Headers */,
                                0753860314489E9800B78452 /* CachedTextTrack.h in Headers */,
                                BCB16C280979C3BD00467741 /* CachedXSLStyleSheet.h in Headers */,
                                93F1995008245E59001E9ABC /* CachePolicy.h in Headers */,
+                               41380C291F3436AC00155FDA /* CacheStorage.h in Headers */,
                                E43AF8E71AC5B7EC00CA717E /* CacheValidation.h in Headers */,
                                49AE2D97134EE5F90072920A /* CalculationValue.h in Headers */,
                                7C1E8D011ED0C2DA00B1D983 /* CallbackResult.h in Headers */,
                                E1BD331A182D8DDD00C05D9F /* CryptoAlgorithmRSASSA_PKCS1_v1_5.h in Headers */,
                                E1BD331C182D8EE900C05D9F /* CryptoAlgorithmRsaSsaParamsDeprecated.h in Headers */,
                                E125F82C1822CFEC00D84CD9 /* CryptoAlgorithmSHA1.h in Headers */,
-                               41380C291F3436AC00155FDA /* CacheStorage.h in Headers */,
                                E19AC3EF1824DC7900349426 /* CryptoAlgorithmSHA224.h in Headers */,
                                E19AC3F11824DC7900349426 /* CryptoAlgorithmSHA256.h in Headers */,
                                E19AC3F31824DC7900349426 /* CryptoAlgorithmSHA384.h in Headers */,
                                81AC5999131636E60009A7E0 /* DataTransferItem.h in Headers */,
                                81AC599A131636E60009A7E0 /* DataTransferItemList.h in Headers */,
                                E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */,
-                               5182C23F1F313A090059BA7C /* ServiceWorker.h in Headers */,
                                E4A007831B820EC8002C5A6E /* DataURLDecoder.h in Headers */,
                                A5732B0B136A161D005C8D7C /* DateComponents.h in Headers */,
                                F55B3DB61251F12D003EF269 /* DateInputType.h in Headers */,
                                0F49669D1DB408C100A274BB /* DOMPoint.h in Headers */,
                                0F4966A31DB4091000A274BB /* DOMPointInit.h in Headers */,
                                0F49669F1DB408C100A274BB /* DOMPointReadOnly.h in Headers */,
+                               7C516AD41F3525200034B6BF /* DOMPromiseProxy.h in Headers */,
                                0FF835C31EE354DA008B4CC7 /* DOMQuad.h in Headers */,
                                0FF835C51EE354DA008B4CC7 /* DOMQuadInit.h in Headers */,
                                0F4710AF1DB56AFC002DCEC3 /* DOMRect.h in Headers */,
                                65BF022F0974816300C43196 /* Frame.h in Headers */,
                                974A862314B7ADBB003FDC76 /* FrameDestructionObserver.h in Headers */,
                                656D373C0ADBA5DE00A4554D /* FrameLoader.h in Headers */,
-                               5182C25C1F3143CD0059BA7C /* JSServiceWorkerRegistration.h in Headers */,
                                656D373E0ADBA5DE00A4554D /* FrameLoaderClient.h in Headers */,
                                D000EBA311BDAFD400C47726 /* FrameLoaderStateMachine.h in Headers */,
                                93B77A380ADD792500EA4B81 /* FrameLoaderTypes.h in Headers */,
                                0F580B0D0F12A2690051D689 /* GraphicsLayer.h in Headers */,
                                499B3ED7128CD31400E726C2 /* GraphicsLayerCA.h in Headers */,
                                0F580B0E0F12A2690051D689 /* GraphicsLayerClient.h in Headers */,
-                               41380C271F3436AC00155FDA /* Cache.h in Headers */,
                                1AC69593161A1E53003732CB /* GraphicsLayerFactory.h in Headers */,
                                0FA24D7A162DF91900A3F4C0 /* GraphicsLayerUpdater.h in Headers */,
                                CEC337AF1A46086D009B8523 /* GraphicsServicesSPI.h in Headers */,
                                510192D218B6B9AB007FC7A1 /* ImageControlsRootElementMac.h in Headers */,
                                A779791A0D6B9D0C003851B9 /* ImageData.h in Headers */,
                                555B87ED1CAAF0AB00349425 /* ImageDecoderCG.h in Headers */,
-                               5182C2451F313A090059BA7C /* ServiceWorkerRegistration.h in Headers */,
                                97205AB61239291000B17380 /* ImageDocument.h in Headers */,
                                5576A5651D88A70800CCC04C /* ImageFrame.h in Headers */,
                                5597F8271D91C3130066BC21 /* ImageFrameCache.h in Headers */,
                                7C77C3DC1DEF86D700A50BFA /* JSBlobLineEndings.h in Headers */,
                                7C77C3D51DEF178E00A50BFA /* JSBlobPropertyBag.h in Headers */,
                                14DCF3B31B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.h in Headers */,
+                               7CE191731F2ABE7100272F79 /* JSCache.h in Headers */,
+                               7CE191731F2ABE7100272F7A /* JSCacheStorage.h in Headers */,
                                1449E24C107D4A8400B5793F /* JSCallbackData.h in Headers */,
                                07277E4D17D018CC0015534E /* JSCanvasCaptureMediaStreamTrack.h in Headers */,
                                65DF323A09D1DE65000BE325 /* JSCanvasGradient.h in Headers */,
                                975CA2A21303679D00E99AD9 /* JSCrypto.h in Headers */,
                                E157A8F118185425009F821D /* JSCryptoAlgorithmBuilder.h in Headers */,
                                E1C657131815F9DD00256CDD /* JSCryptoAlgorithmDictionary.h in Headers */,
-                               5182C2561F3143CD0059BA7C /* JSServiceWorker.h in Headers */,
                                5739E12F1DAC7F7800E14383 /* JSCryptoAlgorithmParameters.h in Headers */,
                                E157A8E11817331C009F821D /* JSCryptoKey.h in Headers */,
                                E1F80B8E183172B5007885C3 /* JSCryptoKeyPair.h in Headers */,
                                7CE191711F2ABE7100272F78 /* JSFetchReferrerPolicy.h in Headers */,
                                7E4C96DD1AD4483500365A50 /* JSFetchRequest.h in Headers */,
                                7CE191731F2ABE7100272F78 /* JSFetchRequestCache.h in Headers */,
-                               7CE191731F2ABE7100272F79 /* JSCache.h in Headers */,
-                               7CE191731F2ABE7100272F7A /* JSCacheStorage.h in Headers */,
                                7CE191751F2ABE7100272F78 /* JSFetchRequestCredentials.h in Headers */,
                                7CE191771F2ABE7100272F78 /* JSFetchRequestInit.h in Headers */,
                                7CE191791F2ABE7100272F78 /* JSFetchRequestMode.h in Headers */,
                                BCD9C2C10C17B69E005C90A2 /* JSNamedNodeMap.h in Headers */,
                                A9D247F80D757E3400FDF959 /* JSNavigator.h in Headers */,
                                77D510251ED74B5800DA4C87 /* JSNavigatorCredentials.h in Headers */,
+                               51F886C01F32923100C193EF /* JSNavigatorServiceWorker.h in Headers */,
                                073BE34117D17E01002BD431 /* JSNavigatorUserMedia.h in Headers */,
                                BC9439C3116CF4940048C750 /* JSNodeCustom.h in Headers */,
                                14115B7309F84CD600CA4FC1 /* JSNodeFilter.h in Headers */,
                                FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */,
                                834476EF1DA5BC5E002B6ED2 /* JSScrollToOptions.h in Headers */,
                                CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */,
+                               5182C2561F3143CD0059BA7C /* JSServiceWorker.h in Headers */,
+                               5182C2581F3143CD0059BA7C /* JSServiceWorkerContainer.h in Headers */,
+                               5182C25A1F3143CD0059BA7C /* JSServiceWorkerGlobalScope.h in Headers */,
+                               5182C25C1F3143CD0059BA7C /* JSServiceWorkerRegistration.h in Headers */,
                                9BDA64D81B975CF2009C4387 /* JSShadowRoot.h in Headers */,
                                46DFF49C1DC2620B00B80B48 /* JSShadowRootMode.h in Headers */,
                                CD9DE17B17AAC75B00EA386D /* JSSourceBuffer.h in Headers */,
                                E3B2F0ED1D7F4CA300B0C9D1 /* LoadableScript.h in Headers */,
                                E3B2F0EE1D7F4CA900B0C9D1 /* LoadableScriptClient.h in Headers */,
                                9759E94914EF1D490026A2DD /* LoadableTextTrack.h in Headers */,
-                               5182C2431F313A090059BA7C /* ServiceWorkerGlobalScope.h in Headers */,
                                656D37320ADBA5DE00A4554D /* LoaderNSURLExtras.h in Headers */,
                                7EE6846912D26E3800E79415 /* LoaderRunLoopCF.h in Headers */,
                                51E6821016387302003BBF3C /* LoaderStrategy.h in Headers */,
                                5EBB89371C77782900C65D41 /* MediaEndpointConfiguration.h in Headers */,
                                5E16A2E41BFA650B0029A21E /* MediaEndpointPeerConnection.h in Headers */,
                                5EBB89321C77782300C65D41 /* MediaEndpointSessionConfiguration.h in Headers */,
-                               E46C794B1F13E82B00F371E1 /* StyleInvalidationFunctions.h in Headers */,
                                5E4EAB041D07166A0006A184 /* MediaEndpointSessionDescription.h in Headers */,
                                E44613AD0CD6331000FADA75 /* MediaError.h in Headers */,
                                4E1959220A39DABA00220FE5 /* MediaFeatureNames.h in Headers */,
                                1A2A68240B5BEDE70002A480 /* ProgressTracker.h in Headers */,
                                1ACADD791880D91C00D8B71D /* ProgressTrackerClient.h in Headers */,
                                A578F4351DE00EEB003DFC6A /* PromiseRejectionEvent.h in Headers */,
-                               51F886C01F32923100C193EF /* JSNavigatorServiceWorker.h in Headers */,
                                E4BBED0F14F4025D003F0B98 /* PropertySetCSSStyleDeclaration.h in Headers */,
                                37BAAE581980D1DD005DFE71 /* ProtectionSpace.h in Headers */,
                                514C76750CE923A1007EF3CD /* ProtectionSpaceBase.h in Headers */,
                                436708CF12D9CA4B00044234 /* RenderSVGResourceClipper.h in Headers */,
                                436708D112D9CA4B00044234 /* RenderSVGResourceContainer.h in Headers */,
                                436708D312D9CA4B00044234 /* RenderSVGResourceFilter.h in Headers */,
-                               5182C2411F313A090059BA7C /* ServiceWorkerContainer.h in Headers */,
                                436708D512D9CA4B00044234 /* RenderSVGResourceFilterPrimitive.h in Headers */,
                                436708D712D9CA4B00044234 /* RenderSVGResourceGradient.h in Headers */,
                                436708D912D9CA4B00044234 /* RenderSVGResourceLinearGradient.h in Headers */,
                                516F7F6D1C31E39A00F111DC /* ServerOpenDBRequest.h in Headers */,
                                CEC337AD1A46071F009B8523 /* ServersSPI.h in Headers */,
                                2D93AEE319DF5641002A86C3 /* ServicesOverlayController.h in Headers */,
+                               5182C23F1F313A090059BA7C /* ServiceWorker.h in Headers */,
+                               5182C2411F313A090059BA7C /* ServiceWorkerContainer.h in Headers */,
+                               5182C2431F313A090059BA7C /* ServiceWorkerGlobalScope.h in Headers */,
+                               5182C2451F313A090059BA7C /* ServiceWorkerRegistration.h in Headers */,
                                756B2CE118B7101600FECFAA /* SessionID.h in Headers */,
                                93309E10099E64920056E581 /* SetNodeAttributeCommand.h in Headers */,
                                B8DBDB4C130B0F8A00F5CDB1 /* SetSelectionCommand.h in Headers */,
                                A110DB9B14F5DF7700A03B93 /* StyleGridItemData.h in Headers */,
                                BCEF43CF0E673DA1001C1287 /* StyleImage.h in Headers */,
                                BC2273040E82F1E600E7F975 /* StyleInheritedData.h in Headers */,
+                               E46C794B1F13E82B00F371E1 /* StyleInvalidationFunctions.h in Headers */,
                                E47127CB163438AE00ED6F5A /* StyleInvalidator.h in Headers */,
                                BC5EB72A0E81DE8100B25965 /* StyleMarqueeData.h in Headers */,
                                0FF50272102BA96A0066F39A /* StyleMedia.h in Headers */,
                                BEF29EEC1715DD0900C4B4C9 /* VideoTrackPrivate.h in Headers */,
                                CD336F6417FA0A4D00DDDCD0 /* VideoTrackPrivateAVF.h in Headers */,
                                CD336F6817FA0AC600DDDCD0 /* VideoTrackPrivateAVFObjC.h in Headers */,
-                               5182C25A1F3143CD0059BA7C /* JSServiceWorkerGlobalScope.h in Headers */,
                                CD8B5A43180D149A008B8E65 /* VideoTrackPrivateMediaSourceAVFObjC.h in Headers */,
                                070E81D11BF27656001FDA48 /* VideoTrackPrivateMediaStream.h in Headers */,
                                CEF418CF1179678C009D112C /* ViewportArguments.h in Headers */,
                                FD315FF812B0267600C1A359 /* AudioBuffer.cpp in Sources */,
                                FD315FFB12B0267600C1A359 /* AudioBufferSourceNode.cpp in Sources */,
                                FD31607B12B026F700C1A359 /* AudioBus.cpp in Sources */,
-                               5182C2421F313A090059BA7C /* ServiceWorkerGlobalScope.cpp in Sources */,
                                FD3160BB12B0272A00C1A359 /* AudioBusMac.mm in Sources */,
                                FD31607D12B026F700C1A359 /* AudioChannel.cpp in Sources */,
                                FD31600412B0267600C1A359 /* AudioContext.cpp in Sources */,
                                1A569CFB0D7E2B82007C3983 /* c_runtime.cpp in Sources */,
                                1A569CFD0D7E2B82007C3983 /* c_utility.cpp in Sources */,
                                07C046C31E42508B007201E7 /* CAAudioStreamDescription.cpp in Sources */,
+                               41380C261F3436A600155FDA /* Cache.cpp in Sources */,
                                BCB16C190979C3BD00467741 /* CachedCSSStyleSheet.cpp in Sources */,
                                BC64B4CB0CB4295D005F2B62 /* CachedFont.cpp in Sources */,
                                51C0AA410F2AA15E001648C2 /* CachedFrame.cpp in Sources */,
                                1C0939EA1A13E12900B788E5 /* CachedSVGFont.cpp in Sources */,
                                0753860214489E9800B78452 /* CachedTextTrack.cpp in Sources */,
                                BCB16C270979C3BD00467741 /* CachedXSLStyleSheet.cpp in Sources */,
+                               41380C281F3436AC00155FDA /* CacheStorage.cpp in Sources */,
                                E43AF8E61AC5B7E800CA717E /* CacheValidation.cpp in Sources */,
                                49AE2D96134EE5F90072920A /* CalculationValue.cpp in Sources */,
                                952076041F2675FE007D2AAB /* CallTracer.cpp in Sources */,
                                E19AC3EE1824DC7900349426 /* CryptoAlgorithmSHA224.cpp in Sources */,
                                E19AC3F01824DC7900349426 /* CryptoAlgorithmSHA256.cpp in Sources */,
                                E19AC3F21824DC7900349426 /* CryptoAlgorithmSHA384.cpp in Sources */,
-                               A36DF6611F33C25C00DC6741 /* LayoutUnit.cpp in Sources */,
                                E19AC3F41824DC7900349426 /* CryptoAlgorithmSHA512.cpp in Sources */,
                                E157A8E418173A3A009F821D /* CryptoKey.cpp in Sources */,
                                E125F84D1824289D00D84CD9 /* CryptoKeyAES.cpp in Sources */,
                                76FC2B0B12370DA0006A991A /* DOMTokenList.cpp in Sources */,
                                2E37DFDA12DBAFB800A6B233 /* DOMURL.cpp in Sources */,
                                CD9DE18117AAD6A400EA386D /* DOMURLMediaSource.cpp in Sources */,
-                               5182C2441F313A090059BA7C /* ServiceWorkerRegistration.cpp in Sources */,
                                1403B99809EB13AF00797C7F /* DOMWindow.cpp in Sources */,
+                               41FB279C1F34DB8A00795487 /* DOMWindowCaches.cpp in Sources */,
                                517FBA1E151AB17C00B57959 /* DOMWindowExtension.cpp in Sources */,
                                418C39561C8DAC7F0051C8A3 /* DOMWindowFetch.cpp in Sources */,
                                5185FC741BB4C4E80012898F /* DOMWindowIndexedDatabase.cpp in Sources */,
                                830030F51B7D33B500ED3AAC /* GenericCachedHTMLCollection.cpp in Sources */,
                                0720B0A014D3323500642955 /* GenericEventQueue.cpp in Sources */,
                                CD4BE52A1CE136EF009D87DA /* GenericTaskQueue.cpp in Sources */,
-                               51F886C11F32923400C193EF /* JSNavigatorServiceWorker.cpp in Sources */,
                                9746AF2314F4DDE6003E7A70 /* Geolocation.cpp in Sources */,
                                9746AF2614F4DDE6003E7A70 /* GeolocationController.cpp in Sources */,
                                0FB6252E18DE1B1500A07C05 /* GeometryUtilities.cpp in Sources */,
                                7C77C3DB1DEF86D700A50BFA /* JSBlobLineEndings.cpp in Sources */,
                                7C77C3D41DEF178E00A50BFA /* JSBlobPropertyBag.cpp in Sources */,
                                14DCF3B21B6BE2080062D4C3 /* JSByteLengthQueuingStrategy.cpp in Sources */,
+                               7CE191721F2ABE7100272F79 /* JSCache.cpp in Sources */,
+                               7CE191721F2ABE7100272F7B /* JSCacheQueryOptions.cpp in Sources */,
+                               7CE191721F2ABE7100272F7A /* JSCacheStorage.cpp in Sources */,
                                1449E287107D4DB400B5793F /* JSCallbackData.cpp in Sources */,
                                07277E4C17D018CC0015534E /* JSCanvasCaptureMediaStreamTrack.cpp in Sources */,
                                65DF323909D1DE65000BE325 /* JSCanvasGradient.cpp in Sources */,
                                0F4710BF1DB56BE8002DCEC3 /* JSDOMRectReadOnly.cpp in Sources */,
                                BC5A86B50C3367E800EEA649 /* JSDOMSelection.cpp in Sources */,
                                C5137CF211A58378004ADB99 /* JSDOMStringList.cpp in Sources */,
-                               5182C23E1F313A090059BA7C /* ServiceWorker.cpp in Sources */,
                                BC64649711D82349006455B0 /* JSDOMStringMap.cpp in Sources */,
                                7694563C1214D97C0007CBAE /* JSDOMTokenList.cpp in Sources */,
                                2E37E00512DBC5A400A6B233 /* JSDOMURL.cpp in Sources */,
                                7CE191781F2ABE7100272F78 /* JSFetchRequestMode.cpp in Sources */,
                                7CE1917A1F2ABE7100272F78 /* JSFetchRequestRedirect.cpp in Sources */,
                                8E4C96DC1AD4483500365A50 /* JSFetchResponse.cpp in Sources */,
-                               7CE191721F2ABE7100272F79 /* JSCache.cpp in Sources */,
-                               7CE191721F2ABE7100272F7A /* JSCacheStorage.cpp in Sources */,
-                               7CE191721F2ABE7100272F7B /* JSCacheQueryOptions.cpp in Sources */,
                                BC00F0140E0A189500FD04E3 /* JSFile.cpp in Sources */,
                                2E3BC0CA117D3E0800B9409A /* JSFileError.cpp in Sources */,
                                BC00F0160E0A189500FD04E3 /* JSFileList.cpp in Sources */,
                                898785F4122E1EAC003AABDA /* JSFileReaderSync.cpp in Sources */,
                                B6D9D27C14EAC0860090D75E /* JSFocusEvent.cpp in Sources */,
                                C28083401C6DC275001451B6 /* JSFontFace.cpp in Sources */,
-                               C28083421C6DC96A001451B6 /* JSFontFaceCustom.cpp in Sources */,
                                1C24EEA81C72A7B40080F8FC /* JSFontFaceSet.cpp in Sources */,
-                               1C24EEAB1C72AA0A0080F8FC /* JSFontFaceSetCustom.cpp in Sources */,
                                FDA15EAB12B03EE1003A583A /* JSGainNode.cpp in Sources */,
                                518F5001194CAC3A0081BAAE /* JSGamepad.cpp in Sources */,
                                518F5003194CAC3A0081BAAE /* JSGamepadButton.cpp in Sources */,
                                1A85B1E80A1B240500D8C87C /* JSHTMLDListElement.cpp in Sources */,
                                1A494E340A12358B00FDAFC1 /* JSHTMLDocument.cpp in Sources */,
                                BC51580B0C03D404008BB0EE /* JSHTMLDocumentCustom.cpp in Sources */,
-                               51F886BD1F326A9800C193EF /* JSServiceWorkerContainerCustom.cpp in Sources */,
                                1A494BFA0A122F4400FDAFC1 /* JSHTMLElement.cpp in Sources */,
                                BC5823F50C0A98DF0053F1B5 /* JSHTMLElementCustom.cpp in Sources */,
                                938E65F709F0985D008A48EC /* JSHTMLElementWrapperFactory.cpp in Sources */,
                                2D9BF7211DBFDABA007A7D99 /* JSMediaKeyMessageEvent.cpp in Sources */,
                                2D9BF7221DBFDACB007A7D99 /* JSMediaKeys.cpp in Sources */,
                                2D9BF7231DBFDACD007A7D99 /* JSMediaKeySession.cpp in Sources */,
-                               2D9BF74A1DBFDDFF007A7D99 /* JSMediaKeySessionCustom.cpp in Sources */,
                                CDF4B71D1E01E11A00E235A2 /* JSMediaKeySessionType.cpp in Sources */,
                                CDF4B72B1E03C63E00E235A2 /* JSMediaKeysRequirement.cpp in Sources */,
                                2D9BF7241DBFDAD0007A7D99 /* JSMediaKeyStatusMap.cpp in Sources */,
                                E1ADED470E76B8DD004A1A5E /* JSMessagePortCustom.cpp in Sources */,
                                A86629D209DA2B48009633A5 /* JSMouseEvent.cpp in Sources */,
                                830A36BC1DAC5FAD006D7D09 /* JSMouseEventInit.cpp in Sources */,
+                               7CD344161F3183A5000DCD49 /* JSMutationCallback.cpp in Sources */,
                                65DF31FB09D1CC60000BE325 /* JSMutationEvent.cpp in Sources */,
                                C6F0902C14327D4F00685849 /* JSMutationObserver.cpp in Sources */,
                                C6F0917F143A2BB900685849 /* JSMutationObserverCustom.cpp in Sources */,
                                BCD9C2C00C17B69E005C90A2 /* JSNamedNodeMap.cpp in Sources */,
                                A9D247F70D757E3400FDF959 /* JSNavigator.cpp in Sources */,
                                77D510261ED74B5C00DA4C87 /* JSNavigatorCredentials.cpp in Sources */,
+                               51F886C11F32923400C193EF /* JSNavigatorServiceWorker.cpp in Sources */,
                                073BE34017D17E01002BD431 /* JSNavigatorUserMedia.cpp in Sources */,
                                14DC0D3709FED073007B0235 /* JSNode.cpp in Sources */,
                                BCD9C2640C17AA67005C90A2 /* JSNodeCustom.cpp in Sources */,
                                6C4C96DE1AD4483500365672 /* JSReadableStreamBYOBRequest.cpp in Sources */,
                                6C4C96DE1AD4483500365A50 /* JSReadableStreamDefaultController.cpp in Sources */,
                                7C4C96DE1AD4483500365A50 /* JSReadableStreamDefaultReader.cpp in Sources */,
-                               5182C2401F313A090059BA7C /* ServiceWorkerContainer.cpp in Sources */,
                                4129DF851BB5B80700322A16 /* JSReadableStreamPrivateConstructors.cpp in Sources */,
                                7E4C96DC1AD4483500365A51 /* JSReadableStreamSource.cpp in Sources */,
                                418C39601C8F0AAE0051C8A3 /* JSReadableStreamSourceCustom.cpp in Sources */,
                                FDA15ECD12B03F61003A583A /* JSScriptProcessorNode.cpp in Sources */,
                                834476EE1DA5BC57002B6ED2 /* JSScrollToOptions.cpp in Sources */,
                                CED06AD01C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.cpp in Sources */,
+                               5182C2551F3143CD0059BA7C /* JSServiceWorker.cpp in Sources */,
+                               5182C2571F3143CD0059BA7C /* JSServiceWorkerContainer.cpp in Sources */,
+                               5182C2591F3143CD0059BA7C /* JSServiceWorkerGlobalScope.cpp in Sources */,
+                               5182C25B1F3143CD0059BA7C /* JSServiceWorkerRegistration.cpp in Sources */,
                                9BDA64D71B975CE5009C4387 /* JSShadowRoot.cpp in Sources */,
                                46DFF49B1DC2620B00B80B48 /* JSShadowRootMode.cpp in Sources */,
                                CD9DE17A17AAC75B00EA386D /* JSSourceBuffer.cpp in Sources */,
                                B2FA3DE50AB75A6F000E5AC4 /* JSSVGPolygonElement.cpp in Sources */,
                                B2FA3DE70AB75A6F000E5AC4 /* JSSVGPolylineElement.cpp in Sources */,
                                B2FA3DE90AB75A6F000E5AC4 /* JSSVGPreserveAspectRatio.cpp in Sources */,
-                               41FB279C1F34DB8A00795487 /* DOMWindowCaches.cpp in Sources */,
                                B2FA3DEB0AB75A6F000E5AC4 /* JSSVGRadialGradientElement.cpp in Sources */,
                                8542A7940AE5C94000DF58DF /* JSSVGRect.cpp in Sources */,
                                B2FA3DED0AB75A6F000E5AC4 /* JSSVGRectElement.cpp in Sources */,
                                07846342145B151A00A58DF1 /* JSTrackEvent.cpp in Sources */,
                                E17B492216A9B8FF001C8839 /* JSTransitionEvent.cpp in Sources */,
                                1A750D5C0A90DEE1000FF215 /* JSTreeWalker.cpp in Sources */,
-                               41380C261F3436A600155FDA /* Cache.cpp in Sources */,
                                516BB7940CE91E6800512F79 /* JSTreeWalkerCustom.cpp in Sources */,
                                A86629D009DA2B48009633A5 /* JSUIEvent.cpp in Sources */,
                                465307D11DB6EE4A00E4137C /* JSUIEventInit.cpp in Sources */,
                                77EF62F312F9DB7400C77BD2 /* JSWebGLVertexArrayObjectOES.cpp in Sources */,
                                31A089541E738D59003B6609 /* JSWebGPUBuffer.cpp in Sources */,
                                31A089571E738D59003B6609 /* JSWebGPUCommandBuffer.cpp in Sources */,
-                               38850C531E964C1100C60753 /* JSWebGPUCommandBufferCustom.cpp in Sources */,
                                31A0895A1E738D59003B6609 /* JSWebGPUCommandQueue.cpp in Sources */,
                                38F23AAF1E8E83C400CE46F5 /* JSWebGPUComputeCommandEncoder.cpp in Sources */,
                                38F23AB41E8E83D000CE46F5 /* JSWebGPUComputePipelineState.cpp in Sources */,
                                A120ACA413F998CA00FE4AC7 /* LayoutRepainter.cpp in Sources */,
                                0F36E7391BD184B9002DB891 /* LayoutSize.cpp in Sources */,
                                2D9066060BE141D400956998 /* LayoutState.cpp in Sources */,
+                               A36DF6611F33C25C00DC6741 /* LayoutUnit.cpp in Sources */,
                                CDA98E0B1603CD6000FEA3B1 /* LegacyCDM.cpp in Sources */,
                                CDE8B5EC1A69777300B4B66A /* LegacyCDMPrivateClearKey.cpp in Sources */,
                                CDCA98EB18B2C8EB00C12FF9 /* LegacyCDMPrivateMediaPlayer.cpp in Sources */,
                                CD61FE671794AADB004101EB /* MediaSourceRegistry.cpp in Sources */,
                                078E08FF17D14CEE00420AA1 /* MediaStream.cpp in Sources */,
                                078E094B17D1709600420AA1 /* MediaStreamAudioDestinationNode.cpp in Sources */,
-                               5182C2571F3143CD0059BA7C /* JSServiceWorkerContainer.cpp in Sources */,
                                0783228418013ED800999E0C /* MediaStreamAudioSource.cpp in Sources */,
                                FD671A77159BB07000197559 /* MediaStreamAudioSourceNode.cpp in Sources */,
                                078E090017D14CEE00420AA1 /* MediaStreamEvent.cpp in Sources */,
                                078E090217D14CEE00420AA1 /* MediaStreamTrack.cpp in Sources */,
                                078E090317D14CEE00420AA1 /* MediaStreamTrackEvent.cpp in Sources */,
                                07FFDE68181AED420072D409 /* MediaStreamTrackPrivate.cpp in Sources */,
-                               5182C2551F3143CD0059BA7C /* JSServiceWorker.cpp in Sources */,
                                CD641EBF1819B36000EE4C41 /* MediaTimeAVFoundation.cpp in Sources */,
                                CD60C0C6193E87C7003C656B /* MediaTimeQTKit.mm in Sources */,
                                932CC0F71DFFDA1F004C0F9F /* MediaTrackConstraints.cpp in Sources */,
                                B658FFA51522EFAA00DD5595 /* RadioNodeList.cpp in Sources */,
                                93F19AB908245E59001E9ABC /* Range.cpp in Sources */,
                                F55B3DCD1251F12D003EF269 /* RangeInputType.cpp in Sources */,
-                               5182C25B1F3143CD0059BA7C /* JSServiceWorkerRegistration.cpp in Sources */,
-                               41FB279D1F34DB8E00795487 /* WorkerGlobalScopeCaches.cpp in Sources */,
                                6E84E9E017668BEE00815B68 /* RasterShape.cpp in Sources */,
                                418C39611C8F0AB10051C8A3 /* ReadableStreamDefaultController.cpp in Sources */,
                                FD31603B12B0267600C1A359 /* RealtimeAnalyser.cpp in Sources */,
                                0F3F0E59157030C3006DA57F /* RenderGeometryMap.cpp in Sources */,
                                BC128B01137C8D4600CAC845 /* RenderGrid.cpp in Sources */,
                                BCEA4869097D93020094C9E4 /* RenderHTMLCanvas.cpp in Sources */,
-                               41380C281F3436AC00155FDA /* CacheStorage.cpp in Sources */,
                                0FD308D5117D168500A791F7 /* RenderIFrame.cpp in Sources */,
                                BCEA4875097D93020094C9E4 /* RenderImage.cpp in Sources */,
                                08F2F0091213E61700DCEC48 /* RenderImageResource.cpp in Sources */,
                                7C52229D1E1DAE47002CB8F7 /* RuntimeEnabledFeatures.cpp in Sources */,
                                CDD7089618359F6F002B3DC6 /* SampleMap.cpp in Sources */,
                                49E911CA0EF86D47009D0CAF /* ScaleTransformOperation.cpp in Sources */,
-                               5182C2591F3143CD0059BA7C /* JSServiceWorkerGlobalScope.cpp in Sources */,
                                5DFE8F560D16477B0076E937 /* ScheduledAction.cpp in Sources */,
                                5162C7F411F77EFB00612EFE /* SchemeRegistry.cpp in Sources */,
                                9BD0BF9412A42BF50072FD43 /* ScopedEventQueue.cpp in Sources */,
                                A75E497710752ACB00C9B896 /* SerializedScriptValue.cpp in Sources */,
                                516F7F6E1C31E39C00F111DC /* ServerOpenDBRequest.cpp in Sources */,
                                2D93AEE419DF5641002A86C3 /* ServicesOverlayController.mm in Sources */,
+                               5182C23E1F313A090059BA7C /* ServiceWorker.cpp in Sources */,
+                               5182C2401F313A090059BA7C /* ServiceWorkerContainer.cpp in Sources */,
+                               5182C2421F313A090059BA7C /* ServiceWorkerGlobalScope.cpp in Sources */,
+                               5182C2441F313A090059BA7C /* ServiceWorkerRegistration.cpp in Sources */,
                                511F7D441EB1C39100E47B83 /* SessionID.cpp in Sources */,
                                93309E0F099E64920056E581 /* SetNodeAttributeCommand.cpp in Sources */,
                                B8DBDB4B130B0F8A00F5CDB1 /* SetSelectionCommand.cpp in Sources */,
                                B22279F90D00BF220071B782 /* SVGFEOffsetElement.cpp in Sources */,
                                B22279FC0D00BF220071B782 /* SVGFEPointLightElement.cpp in Sources */,
                                B22279FF0D00BF220071B782 /* SVGFESpecularLightingElement.cpp in Sources */,
-                               7CD344161F3183A5000DCD49 /* JSMutationCallback.cpp in Sources */,
                                B2227A020D00BF220071B782 /* SVGFESpotLightElement.cpp in Sources */,
                                B2227A050D00BF220071B782 /* SVGFETileElement.cpp in Sources */,
                                B2227A080D00BF220071B782 /* SVGFETurbulenceElement.cpp in Sources */,
                                A52A68651DBD4B5D0083373F /* WorkerDebuggerAgent.cpp in Sources */,
                                A3E2643014748991005A8588 /* WorkerEventQueue.cpp in Sources */,
                                2E4346480F546A8200B0F1BA /* WorkerGlobalScope.cpp in Sources */,
+                               41FB279D1F34DB8E00795487 /* WorkerGlobalScopeCaches.cpp in Sources */,
                                418C395A1C8DD6990051C8A3 /* WorkerGlobalScopeFetch.cpp in Sources */,
                                5185FCB31BB4C4E80012898F /* WorkerGlobalScopeIndexedDatabase.cpp in Sources */,
                                A54A0C611DB7F8C10017A90B /* WorkerInspectorController.cpp in Sources */,
index 61f811d..0d2e48b 100644 (file)
@@ -60,6 +60,7 @@ class WebGLExtension;
 template<typename T>
 struct IDLType {
     using ImplementationType = T;
+    using StorageType = T;
 
     using ParameterType = T;
     using NullableParameterType = std::optional<ImplementationType>;
@@ -157,6 +158,8 @@ struct IDLObject : IDLType<JSC::Strong<JSC::JSObject>> {
 template<typename T> struct IDLWrapper : IDLType<RefPtr<T>> {
     using RawType = T;
 
+    using StorageType = Ref<T>;
+
     using ParameterType = T&;
     using NullableParameterType = T*;
 
@@ -167,6 +170,8 @@ template<typename T> struct IDLWrapper : IDLType<RefPtr<T>> {
     static inline std::nullptr_t nullValue() { return nullptr; }
     template<typename U> static inline bool isNullValue(U&& value) { return !value; }
     template<typename U> static inline U&& extractValueFromNullable(U&& value) { return std::forward<U>(value); }
+
+    static ParameterType convertToParameterType(RefPtr<T> value) { ASSERT(value); return *value.get(); }
 };
 
 template<typename T> struct IDLInterface : IDLWrapper<T> { };
diff --git a/Source/WebCore/bindings/js/DOMPromiseProxy.h b/Source/WebCore/bindings/js/DOMPromiseProxy.h
new file mode 100644 (file)
index 0000000..6cdd07e
--- /dev/null
@@ -0,0 +1,325 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+#pragma once
+
+#include "Exception.h"
+#include "JSDOMGlobalObject.h"
+#include "JSDOMPromiseDeferred.h"
+#include <wtf/Function.h>
+#include <wtf/Optional.h>
+#include <wtf/Variant.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+template<typename IDLType>
+class DOMPromiseProxy {
+public:
+    using Value = typename IDLType::StorageType;
+    using ValueOrException = Variant<Value, Exception>;
+
+    DOMPromiseProxy() = default;
+    ~DOMPromiseProxy() = default;
+
+    JSC::JSValue promise(JSC::ExecState&, JSDOMGlobalObject&);
+
+    void reset();
+
+    bool isFulfilled() const;
+
+    void resolve(typename IDLType::ParameterType);
+    void resolveWithNewlyCreated(typename IDLType::ParameterType);
+    void reject(Exception);
+    
+private:
+    std::optional<ValueOrException> m_valueOrException;
+    Vector<Ref<DeferredPromise>, 1> m_deferredPromises;
+};
+
+template<>
+class DOMPromiseProxy<IDLVoid> {
+public:
+    using Value = bool;
+    using ValueOrException = Variant<Value, Exception>;
+
+    DOMPromiseProxy() = default;
+    ~DOMPromiseProxy() = default;
+
+    JSC::JSValue promise(JSC::ExecState&, JSDOMGlobalObject&);
+
+    void reset();
+
+    bool isFulfilled() const;
+
+    void resolve();
+    void reject(Exception);
+
+private:
+    std::optional<ValueOrException> m_valueOrException;
+    Vector<Ref<DeferredPromise>, 1> m_deferredPromises;
+};
+
+template<typename IDLType>
+class DOMPromiseProxyWithResolveCallback {
+public:
+    using Value = bool;
+    using ValueOrException = Variant<Value, Exception>;
+    // FIXME: This should return a IDLType::ParameterType, but WTF::Function does
+    //        not support returning references / non-default initializable types.
+    //        See https://webkit.org/b/175244.
+    using ResolveCallback = WTF::Function<typename IDLType::ImplementationType ()>;
+
+    template <typename Class, typename BaseClass>
+    DOMPromiseProxyWithResolveCallback(Class&, typename IDLType::ImplementationType (BaseClass::*)());
+    DOMPromiseProxyWithResolveCallback(ResolveCallback&&);
+    ~DOMPromiseProxyWithResolveCallback() = default;
+
+    JSC::JSValue promise(JSC::ExecState&, JSDOMGlobalObject&);
+
+    void reset();
+
+    bool isFulfilled() const;
+
+    void resolve(typename IDLType::ParameterType);
+    void resolveWithNewlyCreated(typename IDLType::ParameterType);
+    void reject(Exception);
+    
+private:
+    ResolveCallback m_resolveCallback;
+
+    std::optional<ValueOrException> m_valueOrException;
+    Vector<Ref<DeferredPromise>, 1> m_deferredPromises;
+};
+
+
+// MARK: - DOMPromiseProxy<IDLType> generic implementation
+
+template<typename IDLType>
+inline JSC::JSValue DOMPromiseProxy<IDLType>::promise(JSC::ExecState& state, JSDOMGlobalObject& globalObject)
+{
+    for (auto& deferredPromise : m_deferredPromises) {
+        if (deferredPromise->globalObject() == &globalObject)
+            return deferredPromise->promise();
+    }
+
+    // DeferredPromise can fail construction during worker abrupt termination.
+    auto deferredPromise = DeferredPromise::create(state, globalObject, DeferredPromise::Mode::RetainPromiseOnResolve);
+    if (!deferredPromise)
+        return JSC::jsUndefined();
+
+    if (m_valueOrException) {
+        if (WTF::holds_alternative<Value>(*m_valueOrException))
+            deferredPromise->template resolve<IDLType>(WTF::get<Value>(*m_valueOrException));
+        else
+            deferredPromise->reject(WTF::get<Exception>(*m_valueOrException));
+    }
+
+    auto result = deferredPromise->promise();
+    m_deferredPromises.append(deferredPromise.releaseNonNull());
+    return result;
+}
+
+template<typename IDLType>
+inline void DOMPromiseProxy<IDLType>::reset()
+{
+    m_valueOrException = std::nullopt;
+    m_deferredPromises.clear();
+}
+
+template<typename IDLType>
+inline bool DOMPromiseProxy<IDLType>::isFulfilled() const
+{
+    return m_valueOrException.has_value();
+}
+
+template<typename IDLType>
+inline void DOMPromiseProxy<IDLType>::resolve(typename IDLType::ParameterType value)
+{
+    ASSERT(!m_valueOrException);
+
+    m_valueOrException = ValueOrException { std::forward<typename IDLType::ParameterType>(value) };
+    for (auto& deferredPromise : m_deferredPromises)
+        deferredPromise->template resolve<IDLType>(WTF::get<Value>(*m_valueOrException));
+}
+
+template<typename IDLType>
+inline void DOMPromiseProxy<IDLType>::resolveWithNewlyCreated(typename IDLType::ParameterType value)
+{
+    ASSERT(!m_valueOrException);
+
+    m_valueOrException = ValueOrException { std::forward<typename IDLType::ParameterType>(value) };
+    for (auto& deferredPromise : m_deferredPromises)
+        deferredPromise->template resolveWithNewlyCreated<IDLType>(WTF::get<Value>(*m_valueOrException));
+}
+
+template<typename IDLType>
+inline void DOMPromiseProxy<IDLType>::reject(Exception exception)
+{
+    ASSERT(!m_valueOrException);
+
+    m_valueOrException = ValueOrException { WTFMove(exception) };
+    for (auto& deferredPromise : m_deferredPromises)
+        deferredPromise->reject(WTF::get<Exception>(*m_valueOrException));
+}
+
+
+// MARK: - DOMPromiseProxy<IDLVoid> specialization
+
+inline JSC::JSValue DOMPromiseProxy<IDLVoid>::promise(JSC::ExecState& state, JSDOMGlobalObject& globalObject)
+{
+    for (auto& deferredPromise : m_deferredPromises) {
+        if (deferredPromise->globalObject() == &globalObject)
+            return deferredPromise->promise();
+    }
+
+    // DeferredPromise can fail construction during worker abrupt termination.
+    auto deferredPromise = DeferredPromise::create(state, globalObject, DeferredPromise::Mode::RetainPromiseOnResolve);
+    if (!deferredPromise)
+        return JSC::jsUndefined();
+
+    if (m_valueOrException) {
+        if (WTF::holds_alternative<Value>(*m_valueOrException))
+            deferredPromise->resolve();
+        else
+            deferredPromise->reject(WTF::get<Exception>(*m_valueOrException));
+    }
+
+    auto result = deferredPromise->promise();
+    m_deferredPromises.append(deferredPromise.releaseNonNull());
+    return result;
+}
+
+inline void DOMPromiseProxy<IDLVoid>::reset()
+{
+    m_valueOrException = std::nullopt;
+    m_deferredPromises.clear();
+}
+
+inline bool DOMPromiseProxy<IDLVoid>::isFulfilled() const
+{
+    return m_valueOrException.has_value();
+}
+
+inline void DOMPromiseProxy<IDLVoid>::resolve()
+{
+    ASSERT(!m_valueOrException);
+    m_valueOrException = ValueOrException { true };
+    for (auto& deferredPromise : m_deferredPromises)
+        deferredPromise->resolve();
+}
+
+inline void DOMPromiseProxy<IDLVoid>::reject(Exception exception)
+{
+    ASSERT(!m_valueOrException);
+    m_valueOrException = ValueOrException { WTFMove(exception) };
+    for (auto& deferredPromise : m_deferredPromises)
+        deferredPromise->reject(WTF::get<Exception>(*m_valueOrException));
+}
+
+// MARK: - DOMPromiseProxyWithResolveCallback<IDLType> implementation
+
+template<typename IDLType>
+template <typename Class, typename BaseClass>
+inline DOMPromiseProxyWithResolveCallback<IDLType>::DOMPromiseProxyWithResolveCallback(Class& object, typename IDLType::ImplementationType (BaseClass::*function)())
+    : m_resolveCallback(std::bind(function, &object))
+{
+}
+
+template<typename IDLType>
+inline DOMPromiseProxyWithResolveCallback<IDLType>::DOMPromiseProxyWithResolveCallback(ResolveCallback&& function)
+    : m_resolveCallback(WTFMove(function))
+{
+}
+
+template<typename IDLType>
+inline JSC::JSValue DOMPromiseProxyWithResolveCallback<IDLType>::promise(JSC::ExecState& state, JSDOMGlobalObject& globalObject)
+{
+    for (auto& deferredPromise : m_deferredPromises) {
+        if (deferredPromise->globalObject() == &globalObject)
+            return deferredPromise->promise();
+    }
+
+    // DeferredPromise can fail construction during worker abrupt termination.
+    auto deferredPromise = DeferredPromise::create(state, globalObject, DeferredPromise::Mode::RetainPromiseOnResolve);
+    if (!deferredPromise)
+        return JSC::jsUndefined();
+
+    if (m_valueOrException) {
+        if (WTF::holds_alternative<Value>(*m_valueOrException))
+            deferredPromise->template resolve<IDLType>(IDLType::convertToParameterType(m_resolveCallback()));
+        else
+            deferredPromise->reject(WTF::get<Exception>(*m_valueOrException));
+    }
+
+    auto result = deferredPromise->promise();
+    m_deferredPromises.append(deferredPromise.releaseNonNull());
+    return result;
+}
+
+template<typename IDLType>
+inline void DOMPromiseProxyWithResolveCallback<IDLType>::reset()
+{
+    m_valueOrException = std::nullopt;
+    m_deferredPromises.clear();
+}
+
+template<typename IDLType>
+inline bool DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled() const
+{
+    return m_valueOrException.has_value();
+}
+
+template<typename IDLType>
+inline void DOMPromiseProxyWithResolveCallback<IDLType>::resolve(typename IDLType::ParameterType value)
+{
+    ASSERT(!m_valueOrException);
+
+    m_valueOrException = ValueOrException { true };
+    for (auto& deferredPromise : m_deferredPromises)
+        deferredPromise->template resolve<IDLType>(value);
+}
+
+template<typename IDLType>
+inline void DOMPromiseProxyWithResolveCallback<IDLType>::resolveWithNewlyCreated(typename IDLType::ParameterType value)
+{
+    ASSERT(!m_valueOrException);
+
+    m_valueOrException = ValueOrException { true };
+    for (auto& deferredPromise : m_deferredPromises)
+        deferredPromise->template resolveWithNewlyCreated<IDLType>(value);
+}
+
+template<typename IDLType>
+inline void DOMPromiseProxyWithResolveCallback<IDLType>::reject(Exception exception)
+{
+    ASSERT(!m_valueOrException);
+
+    m_valueOrException = ValueOrException { WTFMove(exception) };
+    for (auto& deferredPromise : m_deferredPromises)
+        deferredPromise->reject(WTF::get<Exception>(*m_valueOrException));
+}
+
+}
index ab1b515..44afd4d 100644 (file)
@@ -40,7 +40,6 @@
 #include "JSDOMConvertNullable.h"
 #include "JSDOMConvertNumbers.h"
 #include "JSDOMConvertObject.h"
-#include "JSDOMConvertPromise.h"
 #include "JSDOMConvertRecord.h"
 #include "JSDOMConvertSequences.h"
 #include "JSDOMConvertSerializedScriptValue.h"
index 055834b..555c38e 100644 (file)
@@ -59,15 +59,19 @@ template<typename T> struct Converter<IDLPromise<T>> : DefaultConverter<IDLPromi
 };
 
 template<typename T> struct JSConverter<IDLPromise<T>> {
-    static constexpr bool needsState = false;
-    static constexpr bool needsGlobalObject = false;
+    static constexpr bool needsState = true;
+    static constexpr bool needsGlobalObject = true;
 
-    static JSC::JSValue convert(JSC::JSPromise& promise)
+    static JSC::JSValue convert(JSC::ExecState&, JSDOMGlobalObject&, JSC::JSPromise& promise)
     {
-        // The result of converting an IDL promise type value to an ECMAScript value is the Promise value
-        // that represents a reference to the same object that the IDL promise type represents.
         return &promise;
     }
+
+    template<template<typename> class U>
+    static JSC::JSValue convert(JSC::ExecState& state, JSDOMGlobalObject& globalObject, U<T>& promiseProxy)
+    {
+        return promiseProxy.promise(state, globalObject);
+    }
 };
 
 } // namespace WebCore
index 5c8c33a..637ee06 100644 (file)
@@ -65,7 +65,8 @@ void DeferredPromise::callFunction(ExecState& exec, JSValue function, JSValue re
     // In practice, the only exception we should ever see here is the TerminatedExecutionException.
     ASSERT_UNUSED(scope, !scope.exception() || isTerminatedExecutionException(vm, scope.exception()));
 
-    clear();
+    if (m_mode == Mode::ClearPromiseOnResolve)
+        clear();
 }
 
 void DeferredPromise::reject()
@@ -92,7 +93,7 @@ void DeferredPromise::reject(std::nullptr_t)
     reject(state, JSC::jsNull());
 }
 
-void DeferredPromise::reject(Exception&& exception)
+void DeferredPromise::reject(Exception exception)
 {
     if (isSuspended())
         return;
index cb689f1..36996cd 100644 (file)
@@ -34,9 +34,22 @@ namespace WebCore {
 
 class DeferredPromise : public DOMGuarded<JSC::JSPromiseDeferred> {
 public:
-    static Ref<DeferredPromise> create(JSDOMGlobalObject& globalObject, JSC::JSPromiseDeferred& deferred)
+    enum class Mode {
+        ClearPromiseOnResolve,
+        RetainPromiseOnResolve
+    };
+
+    static RefPtr<DeferredPromise> create(JSC::ExecState& state, JSDOMGlobalObject& globalObject, Mode mode = Mode::ClearPromiseOnResolve)
     {
-        return adoptRef(*new DeferredPromise(globalObject, deferred));
+        auto* promiseDeferred = JSC::JSPromiseDeferred::create(&state, &globalObject);
+        if (!promiseDeferred)
+            return nullptr;
+        return adoptRef(new DeferredPromise(globalObject, *promiseDeferred, mode));
+    }
+
+    static Ref<DeferredPromise> create(JSDOMGlobalObject& globalObject, JSC::JSPromiseDeferred& deferred, Mode mode = Mode::ClearPromiseOnResolve)
+    {
+        return adoptRef(*new DeferredPromise(globalObject, deferred, mode));
     }
 
     template<class IDLType>
@@ -88,7 +101,7 @@ public:
 
     void reject();
     void reject(std::nullptr_t);
-    void reject(Exception&&);
+    void reject(Exception);
     WEBCORE_EXPORT void reject(ExceptionCode, const String& = { });
     void reject(const JSC::PrivateName&);
 
@@ -119,8 +132,9 @@ public:
     JSC::JSValue promise() const;
 
 private:
-    DeferredPromise(JSDOMGlobalObject& globalObject, JSC::JSPromiseDeferred& deferred)
+    DeferredPromise(JSDOMGlobalObject& globalObject, JSC::JSPromiseDeferred& deferred, Mode mode)
         : DOMGuarded<JSC::JSPromiseDeferred>(globalObject, deferred)
+        , m_mode(mode)
     {
     }
 
@@ -129,6 +143,8 @@ private:
     WEBCORE_EXPORT void callFunction(JSC::ExecState&, JSC::JSValue function, JSC::JSValue resolution);
     void resolve(JSC::ExecState& state, JSC::JSValue resolution) { callFunction(state, deferred()->resolve(), resolution); }
     void reject(JSC::ExecState& state, JSC::JSValue resolution) { callFunction(state, deferred()->reject(), resolution); }
+
+    Mode m_mode;
 };
 
 class DOMPromiseDeferredBase {
diff --git a/Source/WebCore/bindings/js/JSFontFaceCustom.cpp b/Source/WebCore/bindings/js/JSFontFaceCustom.cpp
deleted file mode 100644 (file)
index 4bb96ba..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-#include "config.h"
-#include "JSFontFace.h"
-
-#include "CSSFontSelector.h"
-#include "CSSValue.h"
-#include "CSSValueList.h"
-#include "JSDOMConstructor.h"
-
-namespace WebCore {
-
-JSC::JSValue JSFontFace::loaded(JSC::ExecState& state) const
-{
-    if (!m_loaded) {
-        if (!wrapped().promise()) {
-            auto promise = createDeferredPromise(state, domWindow());
-            m_loaded.set(state.vm(), this, promise->promise());
-            wrapped().registerLoaded(WTFMove(promise));
-        } else
-            m_loaded.set(state.vm(), this, wrapped().promise().value().promise());
-    }
-    return m_loaded.get();
-}
-
-JSC::JSValue JSFontFace::load(JSC::ExecState& state)
-{
-    wrapped().load();
-    return loaded(state);
-}
-
-}
diff --git a/Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp b/Source/WebCore/bindings/js/JSFontFaceSetCustom.cpp
deleted file mode 100644 (file)
index 22560d4..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2016 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.
- */
-
-#include "config.h"
-#include "JSFontFaceSet.h"
-
-#include "FontFace.h"
-#include "JSFontFace.h"
-
-namespace WebCore {
-
-JSC::JSValue JSFontFaceSet::ready(JSC::ExecState& state) const
-{
-    if (!m_ready) {
-        auto promise = createDeferredPromise(state, domWindow());
-        m_ready.set(state.vm(), this, promise->promise());
-        wrapped().registerReady(WTFMove(promise));
-    }
-    return m_ready.get();
-}
-
-}
diff --git a/Source/WebCore/bindings/js/JSMediaKeySessionCustom.cpp b/Source/WebCore/bindings/js/JSMediaKeySessionCustom.cpp
deleted file mode 100644 (file)
index 4227ccd..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2016 Metrological Group B.V.
- * Copyright (C) 2016 Igalia S.L.
- *
- * 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT
- * HOLDER OR 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.
- */
-
-#include "config.h"
-
-#if ENABLE(ENCRYPTED_MEDIA)
-
-#include "JSMediaKeySession.h"
-
-namespace WebCore {
-
-JSC::JSValue JSMediaKeySession::closed(JSC::ExecState& state) const
-{
-    if (!m_closed) {
-        auto promise = createDeferredPromise(state, domWindow());
-        m_closed.set(state.vm(), this, promise->promise());
-        wrapped().registerClosedPromise(WTFMove(promise));
-    }
-    return m_closed.get();
-}
-
-} // namespace WebCore
-
-#endif // ENABLE(ENCRYPTED_MEDIA)
diff --git a/Source/WebCore/bindings/js/JSServiceWorkerContainerCustom.cpp b/Source/WebCore/bindings/js/JSServiceWorkerContainerCustom.cpp
deleted file mode 100644 (file)
index 7e404c7..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2017 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.
- */
-
-#include "config.h"
-#include "JSServiceWorkerContainer.h"
-
-#if ENABLE(SERVICE_WORKER)
-
-#include <runtime/JSCJSValue.h>
-
-using namespace JSC;
-
-namespace WebCore {
-
-JSValue JSServiceWorkerContainer::ready(ExecState&) const
-{
-    return jsNull();
-}
-
-}
-
-#endif // ENABLE(SERVICE_WORKER)
diff --git a/Source/WebCore/bindings/js/JSWebGPUCommandBufferCustom.cpp b/Source/WebCore/bindings/js/JSWebGPUCommandBufferCustom.cpp
deleted file mode 100644 (file)
index 930c4fd..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2017 Yuichiro Kikura (y.kikura@gmail.com)
- *
- * 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.
- */
-
-#include "config.h"
-#include "JSWebGPUCommandBuffer.h"
-
-#if ENABLE(WEBGPU)
-
-#include "GPUCommandBuffer.h"
-#include "JSDOMPromiseDeferred.h"
-#include "JSDOMWrapper.h"
-#include <runtime/JSCJSValue.h>
-
-namespace WebCore {
-
-JSC::JSValue JSWebGPUCommandBuffer::completed(JSC::ExecState& state) const
-{
-    if (!m_completed) {
-        auto promise = createDeferredPromise(state, domWindow());
-
-        if (!wrapped().commandBuffer()) 
-            return JSC::jsUndefined();
-
-        m_completed.set(state.vm(), this, promise->promise());
-        wrapped().commandBuffer()->completed(WTFMove(promise));
-    }
-
-    return m_completed.get();
-}
-
-}
-
-#endif
index 65266d3..de01617 100644 (file)
@@ -386,7 +386,7 @@ sub AddToIncludesForIDLType
     }
 
     if ($codeGenerator->IsPromiseType($type)) {
-        AddToIncludes("JSDOMPromise.h", $includesRef, $conditional);
+        AddToIncludes("DOMPromiseProxy.h", $includesRef, $conditional);
         AddToIncludes("JSDOMConvertPromise.h", $includesRef, $conditional);
 
         AddToIncludesForIDLType(@{$type->subtypes}[0], $includesRef, $conditional);
@@ -5622,7 +5622,7 @@ sub GenerateParametersCheck
         $argumentIndex++;
     }
 
-    push(@arguments, "WTFMove(promise)") if $operation->type && $codeGenerator->IsPromiseType($operation->type);
+    push(@arguments, "WTFMove(promise)") if $operation->type && $codeGenerator->IsPromiseType($operation->type) && !$operation->extendedAttributes->{PromiseProxy};
 
     my $functionString = "$functionName(" . join(", ", @arguments) . ")";
     $functionString = "propagateException(*state, throwScope, $functionString)" if NeedsExplicitPropagateExceptionCall($operation);
@@ -6063,7 +6063,7 @@ sub GenerateImplementationFunctionCall
     if (OperationHasForcedReturnValue($operation)) {
         push(@$outputArray, $indent . "$functionString;\n");
         push(@$outputArray, $indent . "return JSValue::encode(returnValue);\n");
-    } elsif ($operation->type->name eq "void" || $codeGenerator->IsPromiseType($operation->type)) {
+    } elsif ($operation->type->name eq "void" || ($codeGenerator->IsPromiseType($operation->type) && !$operation->extendedAttributes->{PromiseProxy})) {
         push(@$outputArray, $indent . "$functionString;\n");
         push(@$outputArray, $indent . "return JSValue::encode(jsUndefined());\n");
     } else {
@@ -6457,6 +6457,7 @@ sub NativeToJSValueDOMConvertNeedsState
     return 1 if $codeGenerator->IsDictionaryType($type);
     return 1 if $codeGenerator->IsInterfaceType($type);
     return 1 if $codeGenerator->IsBufferSourceType($type);
+    return 1 if $codeGenerator->IsPromiseType($type);
     return 1 if $type->name eq "Date";
     return 1 if $type->name eq "JSON";
     return 1 if $type->name eq "SerializedScriptValue";
@@ -6488,6 +6489,7 @@ sub NativeToJSValueDOMConvertNeedsGlobalObject
     return 1 if $codeGenerator->IsDictionaryType($type);
     return 1 if $codeGenerator->IsInterfaceType($type);
     return 1 if $codeGenerator->IsBufferSourceType($type);
+    return 1 if $codeGenerator->IsPromiseType($type);
     return 1 if $type->name eq "SerializedScriptValue";
     return 1 if $type->name eq "XPathNSResolver";
 
index e2f5a89..38a30d8 100644 (file)
         "PrivateIdentifier": {
             "contextsAllowed": ["interface", "attribute", "operation"]
         },
+        "PromiseProxy": {
+            "contextsAllowed": ["operation"]
+        },
         "PublicIdentifier": {
             "contextsAllowed": ["interface", "attribute", "operation"]
         },
index 498ef5a..d0225fb 100644 (file)
@@ -21,6 +21,7 @@
 #include "config.h"
 #include "JSTestObj.h"
 
+#include "DOMPromiseProxy.h"
 #include "DOMWindow.h"
 #include "Document.h"
 #include "EventNames.h"
@@ -40,6 +41,7 @@
 #include "JSDOMConvertNullable.h"
 #include "JSDOMConvertNumbers.h"
 #include "JSDOMConvertObject.h"
+#include "JSDOMConvertPromise.h"
 #include "JSDOMConvertRecord.h"
 #include "JSDOMConvertSequences.h"
 #include "JSDOMConvertSerializedScriptValue.h"
@@ -1145,6 +1147,7 @@ JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionTestStaticPromiseF
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestCustomPromiseFunction(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionTestStaticCustomPromiseFunction(JSC::ExecState*);
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestCustomReturnsOwnPromiseFunction(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestReturnsOwnPromiseAndPromiseProxyFunction(JSC::ExecState*);
 #if ENABLE(CONDITION1) || ENABLE(CONDITION2)
 JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionConditionalOverload(JSC::ExecState*);
 #endif
@@ -1352,6 +1355,8 @@ bool setJSTestObjNullableStringValue(JSC::ExecState*, JSC::EncodedJSValue, JSC::
 JSC::EncodedJSValue jsTestObjAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
 JSC::EncodedJSValue jsTestObjAttributeWithReservedEnumType(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestObjAttributeWithReservedEnumType(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
+JSC::EncodedJSValue jsTestObjTestReadOnlyVoidPromiseAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
+JSC::EncodedJSValue jsTestObjTestReadOnlyPromiseAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
 JSC::EncodedJSValue jsTestObjPutForwardsAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
 bool setJSTestObjPutForwardsAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
 JSC::EncodedJSValue jsTestObjPutForwardsNullableAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
@@ -1658,6 +1663,8 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
     { "nullableStringValue", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjNullableStringValue), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjNullableStringValue) } },
     { "attribute", ReadOnly | CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     { "attributeWithReservedEnumType", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttributeWithReservedEnumType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttributeWithReservedEnumType) } },
+    { "testReadOnlyVoidPromiseAttribute", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestReadOnlyVoidPromiseAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
+    { "testReadOnlyPromiseAttribute", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestReadOnlyPromiseAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
     { "putForwardsAttribute", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjPutForwardsAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjPutForwardsAttribute) } },
     { "putForwardsNullableAttribute", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjPutForwardsNullableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjPutForwardsNullableAttribute) } },
     { "stringifierAttribute", CustomAccessor | DOMAttribute, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringifierAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringifierAttribute) } },
@@ -1839,6 +1846,7 @@ static const HashTableValue JSTestObjPrototypeTableValues[] =
     { "testPromiseOverloadedFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseOverloadedFunction), (intptr_t) (1) } },
     { "testCustomPromiseFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestCustomPromiseFunction), (intptr_t) (0) } },
     { "testCustomReturnsOwnPromiseFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestCustomReturnsOwnPromiseFunction), (intptr_t) (0) } },
+    { "testReturnsOwnPromiseAndPromiseProxyFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestReturnsOwnPromiseAndPromiseProxyFunction), (intptr_t) (0) } },
 #if ENABLE(CONDITION1) || ENABLE(CONDITION2)
     { "conditionalOverload", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionConditionalOverload), (intptr_t) (1) } },
 #else
@@ -4762,6 +4770,34 @@ bool setJSTestObjAttributeWithReservedEnumType(ExecState* state, EncodedJSValue
     return IDLAttribute<JSTestObj>::set<setJSTestObjAttributeWithReservedEnumTypeSetter>(*state, thisValue, encodedValue, "attributeWithReservedEnumType");
 }
 
+static inline JSValue jsTestObjTestReadOnlyVoidPromiseAttributeGetter(ExecState& state, JSTestObj& thisObject, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject.wrapped();
+    JSValue result = toJS<IDLPromise<IDLVoid>>(state, *thisObject.globalObject(), impl.testReadOnlyVoidPromiseAttribute());
+    return result;
+}
+
+EncodedJSValue jsTestObjTestReadOnlyVoidPromiseAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    return IDLAttribute<JSTestObj>::get<jsTestObjTestReadOnlyVoidPromiseAttributeGetter, CastedThisErrorBehavior::RejectPromise>(*state, thisValue, "testReadOnlyVoidPromiseAttribute");
+}
+
+static inline JSValue jsTestObjTestReadOnlyPromiseAttributeGetter(ExecState& state, JSTestObj& thisObject, ThrowScope& throwScope)
+{
+    UNUSED_PARAM(throwScope);
+    UNUSED_PARAM(state);
+    auto& impl = thisObject.wrapped();
+    JSValue result = toJS<IDLPromise<IDLInterface<TestNode>>>(state, *thisObject.globalObject(), impl.testReadOnlyPromiseAttribute());
+    return result;
+}
+
+EncodedJSValue jsTestObjTestReadOnlyPromiseAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
+{
+    return IDLAttribute<JSTestObj>::get<jsTestObjTestReadOnlyPromiseAttributeGetter, CastedThisErrorBehavior::RejectPromise>(*state, thisValue, "testReadOnlyPromiseAttribute");
+}
+
 static inline JSValue jsTestObjPutForwardsAttributeGetter(ExecState& state, JSTestObj& thisObject, ThrowScope& throwScope)
 {
     UNUSED_PARAM(throwScope);
@@ -7797,6 +7833,19 @@ EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestCustomReturnsOwnPromi
     return IDLOperationReturningPromise<JSTestObj>::callReturningOwnPromise<jsTestObjPrototypeFunctionTestCustomReturnsOwnPromiseFunctionBody>(*state, "testCustomReturnsOwnPromiseFunction");
 }
 
+static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionTestReturnsOwnPromiseAndPromiseProxyFunctionBody(JSC::ExecState* state, typename IDLOperationReturningPromise<JSTestObj>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
+{
+    UNUSED_PARAM(state);
+    UNUSED_PARAM(throwScope);
+    auto& impl = castedThis->wrapped();
+    return JSValue::encode(toJS<IDLPromise<IDLVoid>>(*state, *castedThis->globalObject(), impl.testReturnsOwnPromiseAndPromiseProxyFunction()));
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionTestReturnsOwnPromiseAndPromiseProxyFunction(ExecState* state)
+{
+    return IDLOperationReturningPromise<JSTestObj>::callReturningOwnPromise<jsTestObjPrototypeFunctionTestReturnsOwnPromiseAndPromiseProxyFunctionBody>(*state, "testReturnsOwnPromiseAndPromiseProxyFunction");
+}
+
 #if ENABLE(CONDITION1)
 static inline JSC::EncodedJSValue jsTestObjPrototypeFunctionConditionalOverload1Body(JSC::ExecState* state, typename IDLOperation<JSTestObj>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
 {
index 1e0e162..3f5f545 100644 (file)
@@ -21,6 +21,7 @@
 #include "config.h"
 #include "JSTestPromiseRejectionEvent.h"
 
+#include "DOMPromiseProxy.h"
 #include "JSDOMAttribute.h"
 #include "JSDOMBinding.h"
 #include "JSDOMConstructor.h"
@@ -30,7 +31,7 @@
 #include "JSDOMConvertPromise.h"
 #include "JSDOMConvertStrings.h"
 #include "JSDOMExceptionHandling.h"
-#include "JSDOMPromise.h"
+#include "JSDOMGlobalObject.h"
 #include "JSDOMWrapperCache.h"
 #include <runtime/JSCInlines.h>
 #include <wtf/GetPtr.h>
@@ -230,7 +231,7 @@ static inline JSValue jsTestPromiseRejectionEventPromiseGetter(ExecState& state,
     UNUSED_PARAM(throwScope);
     UNUSED_PARAM(state);
     auto& impl = thisObject.wrapped();
-    JSValue result = toJS<IDLPromise<IDLAny>>(impl.promise());
+    JSValue result = toJS<IDLPromise<IDLAny>>(state, *thisObject.globalObject(), impl.promise());
     return result;
 }
 
index 606ee65..0bdac98 100644 (file)
@@ -408,8 +408,8 @@ enum TestConfidence { "high", "kinda-low" };
     attribute _optional                attributeWithReservedEnumType;
     void _any(unrestricted float a, long b);
 
-    // FIXME: Add support for Promise attributes.
-    // readonly attribute Promise<void> testReadOnlyPromiseAttribute;
+    readonly attribute Promise<void> testReadOnlyVoidPromiseAttribute;
+    readonly attribute Promise<TestNode> testReadOnlyPromiseAttribute;
     
     // Promise function
     Promise<void> testPromiseFunction();
@@ -423,6 +423,7 @@ enum TestConfidence { "high", "kinda-low" };
     [Custom] Promise<void> testCustomPromiseFunction();
     [Custom] static Promise<void> testStaticCustomPromiseFunction();
     [Custom, ReturnsOwnPromise] Promise<void> testCustomReturnsOwnPromiseFunction();
+    [ReturnsOwnPromise, PromiseProxy] Promise<void> testReturnsOwnPromiseAndPromiseProxyFunction();
 
     // PutForwards
     [PutForwards=name] readonly attribute TestNode putForwardsAttribute;
index 6cff7fe..d792707 100644 (file)
@@ -122,6 +122,7 @@ Ref<FontFace> FontFace::create(CSSFontFace& face)
 FontFace::FontFace(CSSFontSelector& fontSelector)
     : m_weakPtrFactory(this)
     , m_backing(CSSFontFace::create(&fontSelector, nullptr, this))
+    , m_loadedPromise(*this, &FontFace::loadedPromiseResolve)
 {
     m_backing->addClient(*this);
 }
@@ -129,6 +130,7 @@ FontFace::FontFace(CSSFontSelector& fontSelector)
 FontFace::FontFace(CSSFontFace& face)
     : m_weakPtrFactory(this)
     , m_backing(face)
+    , m_loadedPromise(*this, &FontFace::loadedPromiseResolve)
 {
     m_backing->addClient(*this);
 }
@@ -421,13 +423,17 @@ void FontFace::fontStateChanged(CSSFontFace& face, CSSFontFace::Status, CSSFontF
     case CSSFontFace::Status::TimedOut:
         break;
     case CSSFontFace::Status::Success:
-        if (m_promise)
-            std::exchange(m_promise, std::nullopt)->resolve(*this);
+        // FIXME: This check should not be needed, but because FontFace's are sometimes adopted after they have already
+        // gone through a load cycle, we can sometimes come back through here and try to resolve the promise again.  
+        if (!m_loadedPromise.isFulfilled())
+            m_loadedPromise.resolve(*this);
         deref();
         return;
     case CSSFontFace::Status::Failure:
-        if (m_promise)
-            std::exchange(m_promise, std::nullopt)->reject(NetworkError);
+        // FIXME: This check should not be needed, but because FontFace's are sometimes adopted after they have already
+        // gone through a load cycle, we can sometimes come back through here and try to resolve the promise again.  
+        if (!m_loadedPromise.isFulfilled())
+            m_loadedPromise.reject(Exception { NetworkError });
         deref();
         return;
     case CSSFontFace::Status::Pending:
@@ -436,27 +442,15 @@ void FontFace::fontStateChanged(CSSFontFace& face, CSSFontFace::Status, CSSFontF
     }
 }
 
-void FontFace::registerLoaded(Promise&& promise)
+auto FontFace::load() -> LoadedPromise&
 {
-    ASSERT(!m_promise);
-    switch (m_backing->status()) {
-    case CSSFontFace::Status::Loading:
-    case CSSFontFace::Status::Pending:
-        m_promise = WTFMove(promise);
-        return;
-    case CSSFontFace::Status::Success:
-        promise.resolve(*this);
-        return;
-    case CSSFontFace::Status::TimedOut:
-    case CSSFontFace::Status::Failure:
-        promise.reject(NetworkError);
-        return;
-    }
+    m_backing->load();
+    return m_loadedPromise;
 }
 
-void FontFace::load()
+RefPtr<FontFace> FontFace::loadedPromiseResolve()
 {
-    m_backing->load();
+    return this;
 }
 
 }
index 813403a..b0f0920 100644 (file)
@@ -27,7 +27,7 @@
 
 #include "CSSFontFace.h"
 #include "CSSPropertyNames.h"
-#include "JSDOMPromiseDeferred.h"
+#include "DOMPromiseProxy.h"
 #include <wtf/Variant.h>
 #include <wtf/WeakPtr.h>
 
@@ -73,14 +73,12 @@ public:
     enum class LoadStatus { Unloaded, Loading, Loaded, Error };
     LoadStatus status() const;
 
-    using Promise = DOMPromiseDeferred<IDLInterface<FontFace>>;
-    std::optional<Promise>& promise() { return m_promise; }
-    void registerLoaded(Promise&&);
+    using LoadedPromise = DOMPromiseProxyWithResolveCallback<IDLInterface<FontFace>>;
+    LoadedPromise& loaded() { return m_loadedPromise; }
+    LoadedPromise& load();
 
     void adopt(CSSFontFace&);
 
-    void load();
-
     CSSFontFace& backing() { return m_backing; }
 
     static RefPtr<CSSValue> parseString(const String&, CSSPropertyID);
@@ -96,9 +94,11 @@ private:
     explicit FontFace(CSSFontSelector&);
     explicit FontFace(CSSFontFace&);
 
+    RefPtr<FontFace> loadedPromiseResolve();
+
     WeakPtrFactory<FontFace> m_weakPtrFactory;
     Ref<CSSFontFace> m_backing;
-    std::optional<Promise> m_promise;
+    LoadedPromise m_loadedPromise;
 };
 
 }
index 3f09f60..30e2038 100644 (file)
@@ -56,6 +56,6 @@ dictionary FontFaceDescriptors {
 
     readonly attribute FontFaceLoadStatus status;
 
-    [Custom, ReturnsOwnPromise] Promise<FontFace> load();
-    [CachedAttribute, CustomGetter] readonly attribute Promise<FontFace> loaded;
+    [ReturnsOwnPromise, PromiseProxy] Promise<FontFace> load();
+    readonly attribute Promise<FontFace> loaded;
 };
index fd8c58c..efaaaed 100644 (file)
@@ -51,6 +51,7 @@ Ref<FontFaceSet> FontFaceSet::create(Document& document, CSSFontFaceSet& backing
 FontFaceSet::FontFaceSet(Document& document, const Vector<RefPtr<FontFace>>& initialFaces)
     : ActiveDOMObject(&document)
     , m_backing(CSSFontFaceSet::create())
+    , m_readyPromise(*this, &FontFaceSet::readyPromiseResolve)
 {
     m_backing->addClient(*this);
     for (auto& face : initialFaces)
@@ -60,7 +61,9 @@ FontFaceSet::FontFaceSet(Document& document, const Vector<RefPtr<FontFace>>& ini
 FontFaceSet::FontFaceSet(Document& document, CSSFontFaceSet& backing)
     : ActiveDOMObject(&document)
     , m_backing(backing)
+    , m_readyPromise(*this, &FontFaceSet::readyPromiseResolve)
 {
+    m_readyPromise.resolve(*this);
     m_backing->addClient(*this);
 }
 
@@ -165,16 +168,6 @@ ExceptionOr<bool> FontFaceSet::check(const String& family, const String& text)
 {
     return m_backing->check(family, text);
 }
-
-void FontFaceSet::registerReady(ReadyPromise&& promise)
-{
-    ASSERT(!m_promise);
-    if (m_isReady) {
-        promise.resolve(*this);
-        return;
-    }
-    m_promise = WTFMove(promise);
-}
     
 auto FontFaceSet::status() const -> LoadStatus
 {
@@ -197,12 +190,12 @@ void FontFaceSet::startedLoading()
 {
     // FIXME: Fire a "loading" event asynchronously.
     m_isReady = false;
+    m_readyPromise.reset();
 }
 
 void FontFaceSet::completedLoading()
 {
-    if (m_promise)
-        std::exchange(m_promise, std::nullopt)->resolve(*this);
+    m_readyPromise.resolve(*this);
     m_isReady = true;
 }
 
@@ -233,4 +226,9 @@ void FontFaceSet::faceFinished(CSSFontFace& face, CSSFontFace::Status newStatus)
     m_pendingPromises.remove(iterator);
 }
 
+RefPtr<FontFaceSet> FontFaceSet::readyPromiseResolve()
+{
+    return this;
+}
+
 }
index 0ea3ba9..b3170dd 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "ActiveDOMObject.h"
 #include "CSSFontFaceSet.h"
+#include "DOMPromiseProxy.h"
 #include "EventTarget.h"
 #include "JSDOMPromiseDeferred.h"
 
@@ -53,8 +54,8 @@ public:
     enum class LoadStatus { Loading, Loaded };
     LoadStatus status() const;
 
-    using ReadyPromise = DOMPromiseDeferred<IDLInterface<FontFaceSet>>;
-    void registerReady(ReadyPromise&&);
+    using ReadyPromise = DOMPromiseProxyWithResolveCallback<IDLInterface<FontFaceSet>>;
+    ReadyPromise& ready() { return m_readyPromise; }
 
     CSSFontFaceSet& backing() { return m_backing; }
 
@@ -107,9 +108,11 @@ private:
     void refEventTarget() final { ref(); }
     void derefEventTarget() final { deref(); }
 
+    RefPtr<FontFaceSet> readyPromiseResolve();
+
     Ref<CSSFontFaceSet> m_backing;
     HashMap<RefPtr<FontFace>, Vector<Ref<PendingPromise>>> m_pendingPromises;
-    std::optional<ReadyPromise> m_promise;
+    ReadyPromise m_readyPromise;
     bool m_isReady { true };
 };
 
index c4a5ec7..d407489 100644 (file)
@@ -50,6 +50,6 @@ enum FontFaceSetLoadStatus {
     Promise<sequence<FontFace>> load(DOMString font, optional DOMString text = " ");
     [MayThrowException] boolean check(DOMString font, optional DOMString text = " ");
 
-    [CustomGetter, CachedAttribute] readonly attribute Promise<FontFaceSet> ready;
+    readonly attribute Promise<FontFaceSet> ready;
     readonly attribute FontFaceSetLoadStatus status;
 };
index 3e6322a..8e4ddbc 100644 (file)
@@ -88,6 +88,11 @@ RefPtr<WebGPUComputeCommandEncoder> WebGPUCommandBuffer::createComputeCommandEnc
     return commandEncoder;
 }
 
+DOMPromiseProxy<IDLVoid>& WebGPUCommandBuffer::completed()
+{
+    return m_commandBuffer->completed();
+}
+
 } // namespace WebCore
 
 #endif
index bbd6ca2..e8725db 100644 (file)
@@ -28,6 +28,7 @@
 
 #if ENABLE(WEBGPU)
 
+#include "DOMPromiseProxy.h"
 #include "WebGPUObject.h"
 
 #include <wtf/Vector.h>
@@ -55,6 +56,8 @@ public:
 
     GPUCommandBuffer* commandBuffer() { return m_commandBuffer.get(); }
 
+    DOMPromiseProxy<IDLVoid>& completed();
+
 private:
     WebGPUCommandBuffer(WebGPURenderingContext*, WebGPUCommandQueue*);
     RefPtr<GPUCommandBuffer> m_commandBuffer;
index 6ec32a6..bfdf45a 100644 (file)
     Conditional=WEBGPU,
     EnabledAtRuntime=WebGPU
 ] interface WebGPUCommandBuffer {
-
     WebGPURenderCommandEncoder createRenderCommandEncoderWithDescriptor(WebGPURenderPassDescriptor descriptor);
     WebGPUComputeCommandEncoder createComputeCommandEncoder();
     void commit();
     void presentDrawable(WebGPUDrawable drawable);
-    [CachedAttribute, CustomGetter] readonly attribute Promise<void> completed;
+    readonly attribute Promise<void> completed;
 
 };
index 5e4a6e5..97ff953 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "Language.h"
 #include "NetworkStateNotifier.h"
+#include "ServiceWorkerContainer.h"
 #include <mutex>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/NumberOfCores.h>
index 8e06fa2..c15de20 100644 (file)
@@ -25,7 +25,6 @@
 
 #pragma once
 
-#include "ServiceWorkerContainer.h"
 #include <wtf/Forward.h>
 #include <wtf/RefCounted.h>
 #include <wtf/UniqueRef.h>
@@ -34,6 +33,7 @@
 namespace WebCore {
 
 class ScriptExecutionContext;
+class ServiceWorkerContainer;
 
 class NavigatorBase : public RefCounted<NavigatorBase> {
 public:
index 2536218..12546f7 100644 (file)
@@ -34,6 +34,7 @@
 #import "Logging.h"
 
 #import <Metal/Metal.h>
+#import <wtf/BlockPtr.h>
 
 namespace WebCore {
 
@@ -69,18 +70,18 @@ void GPUCommandBuffer::commit()
     [m_commandBuffer commit];
 }
 
-void GPUCommandBuffer::completed(Ref<DeferredPromise>&& passedPromise)
+DOMPromiseProxy<IDLVoid>& GPUCommandBuffer::completed()
 {
     if (!m_commandBuffer)
-        return;
-
-    RefPtr<DeferredPromise> promise(WTFMove(passedPromise));
+        return m_completedPromise;
 
-    [m_commandBuffer addCompletedHandler:^(id<MTLCommandBuffer>) {
-        callOnMainThread([promise] {
-            promise->resolve();
+    [m_commandBuffer addCompletedHandler:BlockPtr<void (id<MTLCommandBuffer>)>::fromCallable([this, protectedThis = makeRef(*this)] (id<MTLCommandBuffer>) {
+        callOnMainThread([this, protectedThis = makeRef(*this)] {
+            this->m_completedPromise.resolve();
         });
-    }];
+    }).get()];
+    
+    return m_completedPromise;
 }
 
 } // namespace WebCore
index dc27c0e..3b69360 100644 (file)
@@ -64,8 +64,9 @@ void GPUCommandBuffer::presentDrawable(GPUDrawable*)
 {
 }
 
-void GPUCommandBuffer::completed(Ref<DeferredPromise>&&);
+DOMPromiseProxy<IDLVoid>& GPUCommandBuffer::completed();
 {
+    return m_completedPromise;
 }
 #endif
 
index e83d60f..dced276 100644 (file)
@@ -28,8 +28,7 @@
 
 #if ENABLE(WEBGPU)
 
-#include "JSDOMPromiseDeferred.h"
-
+#include "DOMPromiseProxy.h"
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/RetainPtr.h>
@@ -56,7 +55,7 @@ public:
 
     WEBCORE_EXPORT RefPtr<GPURenderCommandEncoder> createRenderCommandEncoder(GPURenderPassDescriptor*);
     WEBCORE_EXPORT RefPtr<GPUComputeCommandEncoder> createComputeCommandEncoder();
-    WEBCORE_EXPORT void completed(Ref<DeferredPromise>&&);
+    WEBCORE_EXPORT DOMPromiseProxy<IDLVoid>& completed();
 
 #if PLATFORM(COCOA)
     WEBCORE_EXPORT MTLCommandBuffer *platformCommandBuffer();
@@ -68,6 +67,8 @@ private:
 #if PLATFORM(COCOA)
     RetainPtr<MTLCommandBuffer> m_commandBuffer;
 #endif
+
+    DOMPromiseProxy<IDLVoid> m_completedPromise;
 };
     
 } // namespace WebCore
index 70afb3b..3522af9 100644 (file)
@@ -42,7 +42,10 @@ ServiceWorkerContainer::ServiceWorkerContainer(ScriptExecutionContext& context,
     , m_navigator(navigator)
 {
     suspendIfNeeded();
+
+    m_readyPromise.reject(Exception { UnknownError, ASCIILiteral("serviceWorker.ready() is not yet implemented") });
 }
+
 void ServiceWorkerContainer::refEventTarget()
 {
     m_navigator.ref();
@@ -58,11 +61,6 @@ ServiceWorker* ServiceWorkerContainer::controller() const
     return nullptr;
 }
 
-void ServiceWorkerContainer::ready(Ref<DeferredPromise>&& promise)
-{
-    promise->reject(Exception { UnknownError, ASCIILiteral("serviceWorker.ready() is not yet implemented") });
-}
-
 void ServiceWorkerContainer::addRegistration(const String& relativeScriptURL, const RegistrationOptions& options, Ref<DeferredPromise>&& promise)
 {
     auto* context = scriptExecutionContext();
index 3153fba..38539ee 100644 (file)
@@ -28,7 +28,9 @@
 #if ENABLE(SERVICE_WORKER)
 
 #include "ActiveDOMObject.h"
+#include "DOMPromiseProxy.h"
 #include "EventTarget.h"
+#include "ServiceWorkerRegistration.h"
 
 namespace WebCore {
 
@@ -52,7 +54,9 @@ public:
 
     ServiceWorker* controller() const;
 
-    void ready(Ref<DeferredPromise>&&);
+    using ReadyPromise = DOMPromiseProxy<IDLInterface<ServiceWorkerRegistration>>;
+    ReadyPromise& ready() { return m_readyPromise; }
+
     void addRegistration(const String& scriptURL, const RegistrationOptions&, Ref<DeferredPromise>&&);
     void getRegistration(const String& url, Ref<DeferredPromise>&&);
     void getRegistrations(Ref<DeferredPromise>&&);
@@ -67,6 +71,8 @@ private:
     void refEventTarget() final;
     void derefEventTarget() final;
 
+    ReadyPromise m_readyPromise;
+
     NavigatorBase& m_navigator;
 };
 
index 76aa624..12c0da8 100644 (file)
@@ -33,7 +33,7 @@
     EnabledAtRuntime=ServiceWorker
 ] interface ServiceWorkerContainer : EventTarget {
     readonly attribute ServiceWorker? controller;
-    [Custom] readonly attribute Promise<ServiceWorkerRegistration> ready;
+    readonly attribute Promise<ServiceWorkerRegistration> ready;
 
     [NewObject, ImplementedAs=addRegistration] Promise<ServiceWorkerRegistration> register(USVString scriptURL, optional RegistrationOptions options);
     [NewObject] Promise<any> getRegistration(optional USVString clientURL = "");