Clean up some includes to make the build a bit faster: DOMPromise
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2019 19:07:22 +0000 (19:07 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Oct 2019 19:07:22 +0000 (19:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=202570

Reviewed by Chris Dumez.

No new tests, just reorganizing.

Apply some profile-guided optimizations to our headers.

Get JSDOMPromiseDeferred.h and DOMPromiseProxy.h out of WebCore headers.
One remains (FetchBodyConsumer.h); I leave it as an exercise to the reader.
In my testing, this is worth a reliable 5-6% on the WebCore Build Benchmark.

* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
* Modules/encryptedmedia/MediaKeySession.cpp:
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeySystemAccess.cpp:
* Modules/encryptedmedia/MediaKeySystemAccess.h:
* Modules/encryptedmedia/MediaKeys.cpp:
* Modules/encryptedmedia/MediaKeys.h:
* Modules/encryptedmedia/NavigatorEME.cpp:
* Modules/encryptedmedia/NavigatorEME.h:
* Modules/fetch/DOMWindowFetch.cpp:
* Modules/fetch/DOMWindowFetch.h:
* Modules/fetch/FetchBody.cpp:
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchLoader.cpp:
* Modules/fetch/FetchLoader.h:
* Modules/fetch/WorkerGlobalScopeFetch.cpp:
* Modules/fetch/WorkerGlobalScopeFetch.h:
* Modules/mediacapabilities/MediaCapabilities.cpp:
* Modules/mediacapabilities/MediaCapabilities.h:
* Modules/mediastream/MediaDevices.cpp:
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaStreamTrack.cpp:
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/PeerConnectionBackend.cpp:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
* Modules/mediastream/RTCRtpReceiver.h:
* Modules/mediastream/RTCRtpSenderBackend.h:
* Modules/mediastream/UserMediaRequest.cpp:
* Modules/mediastream/UserMediaRequest.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
* Modules/paymentrequest/PaymentRequest.cpp:
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentResponse.cpp:
* Modules/paymentrequest/PaymentResponse.h:
* Modules/streams/ReadableStreamSource.h:
* Modules/webaudio/AudioContext.h:
* Modules/webauthn/AuthenticatorCoordinator.cpp:
* Modules/webauthn/AuthenticatorCoordinator.h:
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
* Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
* Modules/webgpu/WebGPU.cpp:
* Modules/webgpu/WebGPU.h:
* Modules/webgpu/WebGPUAdapter.cpp:
* Modules/webgpu/WebGPUAdapter.h:
* Modules/webgpu/WebGPUBuffer.cpp:
* Modules/webgpu/WebGPUBuffer.h:
* Modules/webgpu/WebGPUDevice.cpp:
* Modules/webgpu/WebGPUDevice.h:
* Modules/webvr/NavigatorWebVR.cpp:
* Modules/webvr/NavigatorWebVR.h:
* Modules/webvr/VRDisplay.cpp:
* Modules/webvr/VRDisplay.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/KeyframeEffect.cpp:
* animation/WebAnimation.cpp:
* animation/WebAnimation.h:
* bindings/js/CachedModuleScriptLoader.cpp:
* bindings/js/CachedModuleScriptLoaderClient.h:
* bindings/js/JSDOMPromiseDeferred.h:
* bindings/js/JSHTMLTemplateElementCustom.cpp:
* bindings/js/JSImageDataCustom.cpp:
* bindings/js/JSReadableStreamSourceCustom.cpp:
* bindings/js/JSWebAnimationCustom.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
* bindings/js/JSWorkletGlobalScopeBase.cpp:
* bindings/js/ScriptModuleLoader.cpp:
* css/FontFace.cpp:
* css/FontFace.h:
* css/FontFaceSet.cpp:
* css/FontFaceSet.h:
* dom/CustomElementRegistry.cpp:
* dom/DeviceOrientationOrMotionEvent.cpp:
* dom/DeviceOrientationOrMotionEvent.h:
* dom/MouseEvent.cpp:
* dom/MouseEvent.h:
* html/CustomPaintCanvas.h:
* html/ImageBitmap.cpp:
* html/ImageBitmap.h:
* html/OffscreenCanvas.cpp:
* html/OffscreenCanvas.h:
* loader/ImageLoader.cpp:
* loader/ImageLoader.h:
* page/DOMWindow.cpp:
* page/Navigator.h:
* platform/graphics/CustomPaintImage.cpp:
* testing/Internals.cpp:
* testing/Internals.h:
* testing/ServiceWorkerInternals.h:
* testing/ServiceWorkerInternals.mm:
* workers/service/ServiceWorkerContainer.cpp:
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJob.h:
* workers/service/ServiceWorkerRegistration.cpp:
* workers/service/ServiceWorkerRegistration.h:
* worklets/PaintWorkletGlobalScope.cpp:

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

106 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp
Source/WebCore/Modules/encryptedmedia/MediaKeySession.cpp
Source/WebCore/Modules/encryptedmedia/MediaKeySession.h
Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.cpp
Source/WebCore/Modules/encryptedmedia/MediaKeySystemAccess.h
Source/WebCore/Modules/encryptedmedia/MediaKeys.cpp
Source/WebCore/Modules/encryptedmedia/MediaKeys.h
Source/WebCore/Modules/encryptedmedia/NavigatorEME.cpp
Source/WebCore/Modules/encryptedmedia/NavigatorEME.h
Source/WebCore/Modules/fetch/DOMWindowFetch.cpp
Source/WebCore/Modules/fetch/DOMWindowFetch.h
Source/WebCore/Modules/fetch/FetchBody.cpp
Source/WebCore/Modules/fetch/FetchBody.h
Source/WebCore/Modules/fetch/FetchLoader.cpp
Source/WebCore/Modules/fetch/FetchLoader.h
Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.cpp
Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.h
Source/WebCore/Modules/mediacapabilities/MediaCapabilities.cpp
Source/WebCore/Modules/mediacapabilities/MediaCapabilities.h
Source/WebCore/Modules/mediastream/MediaDevices.cpp
Source/WebCore/Modules/mediastream/MediaDevices.h
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.h
Source/WebCore/Modules/mediastream/PeerConnectionBackend.cpp
Source/WebCore/Modules/mediastream/PeerConnectionBackend.h
Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp
Source/WebCore/Modules/mediastream/RTCRtpReceiver.h
Source/WebCore/Modules/mediastream/RTCRtpSenderBackend.h
Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
Source/WebCore/Modules/mediastream/UserMediaRequest.h
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp
Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp
Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp
Source/WebCore/Modules/paymentrequest/PaymentRequest.h
Source/WebCore/Modules/paymentrequest/PaymentResponse.cpp
Source/WebCore/Modules/paymentrequest/PaymentResponse.h
Source/WebCore/Modules/streams/ReadableStreamSource.cpp [new file with mode: 0644]
Source/WebCore/Modules/streams/ReadableStreamSource.h
Source/WebCore/Modules/webaudio/AudioContext.h
Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.cpp
Source/WebCore/Modules/webauthn/AuthenticatorCoordinator.h
Source/WebCore/Modules/webauthn/PublicKeyCredential.h
Source/WebCore/Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp
Source/WebCore/Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp
Source/WebCore/Modules/webgpu/WebGPU.cpp
Source/WebCore/Modules/webgpu/WebGPU.h
Source/WebCore/Modules/webgpu/WebGPUAdapter.cpp
Source/WebCore/Modules/webgpu/WebGPUAdapter.h
Source/WebCore/Modules/webgpu/WebGPUBuffer.cpp
Source/WebCore/Modules/webgpu/WebGPUBuffer.h
Source/WebCore/Modules/webgpu/WebGPUDevice.cpp
Source/WebCore/Modules/webgpu/WebGPUDevice.h
Source/WebCore/Modules/webvr/NavigatorWebVR.cpp
Source/WebCore/Modules/webvr/NavigatorWebVR.h
Source/WebCore/Modules/webvr/VRDisplay.cpp
Source/WebCore/Modules/webvr/VRDisplay.h
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/animation/KeyframeEffect.cpp
Source/WebCore/animation/WebAnimation.cpp
Source/WebCore/animation/WebAnimation.h
Source/WebCore/bindings/js/CachedModuleScriptLoader.cpp
Source/WebCore/bindings/js/CachedModuleScriptLoaderClient.h
Source/WebCore/bindings/js/JSDOMPromiseDeferred.h
Source/WebCore/bindings/js/JSHTMLTemplateElementCustom.cpp
Source/WebCore/bindings/js/JSImageDataCustom.cpp
Source/WebCore/bindings/js/JSMessageEventCustom.cpp
Source/WebCore/bindings/js/JSReadableStreamSourceCustom.cpp
Source/WebCore/bindings/js/JSWebAnimationCustom.cpp
Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp
Source/WebCore/bindings/js/JSWorkerGlobalScopeCustom.cpp
Source/WebCore/bindings/js/JSWorkletGlobalScopeBase.cpp
Source/WebCore/bindings/js/ScriptModuleLoader.cpp
Source/WebCore/css/FontFace.cpp
Source/WebCore/css/FontFace.h
Source/WebCore/css/FontFaceSet.cpp
Source/WebCore/css/FontFaceSet.h
Source/WebCore/dom/CustomElementRegistry.cpp
Source/WebCore/dom/DeviceOrientationOrMotionEvent.cpp
Source/WebCore/dom/DeviceOrientationOrMotionEvent.h
Source/WebCore/dom/MouseEvent.cpp
Source/WebCore/dom/MouseEvent.h
Source/WebCore/html/CustomPaintCanvas.h
Source/WebCore/html/ImageBitmap.cpp
Source/WebCore/html/ImageBitmap.h
Source/WebCore/html/OffscreenCanvas.cpp
Source/WebCore/html/OffscreenCanvas.h
Source/WebCore/loader/ImageLoader.cpp
Source/WebCore/loader/ImageLoader.h
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/Navigator.h
Source/WebCore/page/PageConsoleClient.cpp
Source/WebCore/platform/graphics/CustomPaintImage.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/ServiceWorkerInternals.h
Source/WebCore/testing/ServiceWorkerInternals.mm
Source/WebCore/workers/service/ServiceWorkerContainer.cpp
Source/WebCore/workers/service/ServiceWorkerContainer.h
Source/WebCore/workers/service/ServiceWorkerJob.cpp
Source/WebCore/workers/service/ServiceWorkerJob.h
Source/WebCore/workers/service/ServiceWorkerRegistration.cpp
Source/WebCore/workers/service/ServiceWorkerRegistration.h
Source/WebCore/worklets/PaintWorkletGlobalScope.cpp

index ffa9595..3aa64b8 100644 (file)
@@ -1,3 +1,120 @@
+2019-10-04  Tim Horton  <timothy_horton@apple.com>
+
+        Clean up some includes to make the build a bit faster: DOMPromise
+        https://bugs.webkit.org/show_bug.cgi?id=202570
+
+        Reviewed by Chris Dumez.
+
+        No new tests, just reorganizing.
+
+        Apply some profile-guided optimizations to our headers.
+
+        Get JSDOMPromiseDeferred.h and DOMPromiseProxy.h out of WebCore headers.
+        One remains (FetchBodyConsumer.h); I leave it as an exercise to the reader.
+        In my testing, this is worth a reliable 5-6% on the WebCore Build Benchmark.
+
+        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
+        * Modules/encryptedmedia/MediaKeySession.cpp:
+        * Modules/encryptedmedia/MediaKeySession.h:
+        * Modules/encryptedmedia/MediaKeySystemAccess.cpp:
+        * Modules/encryptedmedia/MediaKeySystemAccess.h:
+        * Modules/encryptedmedia/MediaKeys.cpp:
+        * Modules/encryptedmedia/MediaKeys.h:
+        * Modules/encryptedmedia/NavigatorEME.cpp:
+        * Modules/encryptedmedia/NavigatorEME.h:
+        * Modules/fetch/DOMWindowFetch.cpp:
+        * Modules/fetch/DOMWindowFetch.h:
+        * Modules/fetch/FetchBody.cpp:
+        * Modules/fetch/FetchBody.h:
+        * Modules/fetch/FetchLoader.cpp:
+        * Modules/fetch/FetchLoader.h:
+        * Modules/fetch/WorkerGlobalScopeFetch.cpp:
+        * Modules/fetch/WorkerGlobalScopeFetch.h:
+        * Modules/mediacapabilities/MediaCapabilities.cpp:
+        * Modules/mediacapabilities/MediaCapabilities.h:
+        * Modules/mediastream/MediaDevices.cpp:
+        * Modules/mediastream/MediaDevices.h:
+        * Modules/mediastream/MediaStreamTrack.cpp:
+        * Modules/mediastream/MediaStreamTrack.h:
+        * Modules/mediastream/PeerConnectionBackend.cpp:
+        * Modules/mediastream/PeerConnectionBackend.h:
+        * Modules/mediastream/RTCPeerConnection.cpp:
+        * Modules/mediastream/RTCRtpReceiver.h:
+        * Modules/mediastream/RTCRtpSenderBackend.h:
+        * Modules/mediastream/UserMediaRequest.cpp:
+        * Modules/mediastream/UserMediaRequest.h:
+        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
+        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
+        * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
+        * Modules/paymentrequest/PaymentRequest.cpp:
+        * Modules/paymentrequest/PaymentRequest.h:
+        * Modules/paymentrequest/PaymentResponse.cpp:
+        * Modules/paymentrequest/PaymentResponse.h:
+        * Modules/streams/ReadableStreamSource.h:
+        * Modules/webaudio/AudioContext.h:
+        * Modules/webauthn/AuthenticatorCoordinator.cpp:
+        * Modules/webauthn/AuthenticatorCoordinator.h:
+        * Modules/webauthn/PublicKeyCredential.h:
+        * Modules/webgpu/WHLSL/WHLSLPreserveVariableLifetimes.cpp:
+        * Modules/webgpu/WHLSL/WHLSLStandardLibraryUtilities.cpp:
+        * Modules/webgpu/WebGPU.cpp:
+        * Modules/webgpu/WebGPU.h:
+        * Modules/webgpu/WebGPUAdapter.cpp:
+        * Modules/webgpu/WebGPUAdapter.h:
+        * Modules/webgpu/WebGPUBuffer.cpp:
+        * Modules/webgpu/WebGPUBuffer.h:
+        * Modules/webgpu/WebGPUDevice.cpp:
+        * Modules/webgpu/WebGPUDevice.h:
+        * Modules/webvr/NavigatorWebVR.cpp:
+        * Modules/webvr/NavigatorWebVR.h:
+        * Modules/webvr/VRDisplay.cpp:
+        * Modules/webvr/VRDisplay.h:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * animation/KeyframeEffect.cpp:
+        * animation/WebAnimation.cpp:
+        * animation/WebAnimation.h:
+        * bindings/js/CachedModuleScriptLoader.cpp:
+        * bindings/js/CachedModuleScriptLoaderClient.h:
+        * bindings/js/JSDOMPromiseDeferred.h:
+        * bindings/js/JSHTMLTemplateElementCustom.cpp:
+        * bindings/js/JSImageDataCustom.cpp:
+        * bindings/js/JSReadableStreamSourceCustom.cpp:
+        * bindings/js/JSWebAnimationCustom.cpp:
+        * bindings/js/JSWorkerGlobalScopeBase.cpp:
+        * bindings/js/JSWorkerGlobalScopeCustom.cpp:
+        * bindings/js/JSWorkletGlobalScopeBase.cpp:
+        * bindings/js/ScriptModuleLoader.cpp:
+        * css/FontFace.cpp:
+        * css/FontFace.h:
+        * css/FontFaceSet.cpp:
+        * css/FontFaceSet.h:
+        * dom/CustomElementRegistry.cpp:
+        * dom/DeviceOrientationOrMotionEvent.cpp:
+        * dom/DeviceOrientationOrMotionEvent.h:
+        * dom/MouseEvent.cpp:
+        * dom/MouseEvent.h:
+        * html/CustomPaintCanvas.h:
+        * html/ImageBitmap.cpp:
+        * html/ImageBitmap.h:
+        * html/OffscreenCanvas.cpp:
+        * html/OffscreenCanvas.h:
+        * loader/ImageLoader.cpp:
+        * loader/ImageLoader.h:
+        * page/DOMWindow.cpp:
+        * page/Navigator.h:
+        * platform/graphics/CustomPaintImage.cpp:
+        * testing/Internals.cpp:
+        * testing/Internals.h:
+        * testing/ServiceWorkerInternals.h:
+        * testing/ServiceWorkerInternals.mm:
+        * workers/service/ServiceWorkerContainer.cpp:
+        * workers/service/ServiceWorkerContainer.h:
+        * workers/service/ServiceWorkerJob.h:
+        * workers/service/ServiceWorkerRegistration.cpp:
+        * workers/service/ServiceWorkerRegistration.h:
+        * worklets/PaintWorkletGlobalScope.cpp:
+
 2019-10-04  Sihui Liu  <sihui_liu@apple.com>
 
         Layout Test imported/w3c/web-platform-tests/IndexedDB/fire-error-event-exception.html is a Flaky Failure
index 0f7e3ba..07b3694 100644 (file)
@@ -41,6 +41,7 @@
 #include "JSApplePayPayment.h"
 #include "JSApplePayPaymentMethod.h"
 #include "JSApplePayRequest.h"
+#include "JSDOMConvert.h"
 #include "LinkIconCollector.h"
 #include "MerchantValidationEvent.h"
 #include "Page.h"
@@ -56,6 +57,7 @@
 #include "PaymentResponse.h"
 #include "PaymentValidationErrors.h"
 #include "Settings.h"
+#include <JavaScriptCore/JSONObject.h>
 
 namespace WebCore {
 
index 5508b37..96602ed 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "CDM.h"
 #include "CDMInstance.h"
+#include "DOMPromiseProxy.h"
 #include "Document.h"
 #include "EventNames.h"
 #include "Logging.h"
@@ -63,6 +64,7 @@ MediaKeySession::MediaKeySession(ScriptExecutionContext& context, WeakPtr<MediaK
     : ActiveDOMObject(&context)
     , m_keys(WTFMove(keys))
     , m_expiration(std::numeric_limits<double>::quiet_NaN())
+    , m_closedPromise(makeUniqueRef<ClosedPromise>())
     , m_keyStatuses(MediaKeyStatusMap::create(*this))
     , m_useDistinctiveIdentifier(useDistinctiveIdentifier)
     , m_sessionType(sessionType)
@@ -709,7 +711,7 @@ void MediaKeySession::sessionClosed()
 
     // 5. Let promise be the closed attribute of the session.
     // 6. Resolve promise.
-    m_closedPromise.resolve();
+    m_closedPromise->resolve();
 }
 
 String MediaKeySession::mediaKeysStorageDirectory() const
index 95baf35..823844f 100644 (file)
 
 #include "ActiveDOMObject.h"
 #include "CDMInstanceSession.h"
-#include "DOMPromiseProxy.h"
 #include "EventTarget.h"
 #include "GenericEventQueue.h"
 #include "GenericTaskQueue.h"
+#include "IDLTypes.h"
 #include "MediaKeyMessageType.h"
 #include "MediaKeySessionType.h"
 #include "MediaKeyStatus.h"
@@ -48,10 +48,13 @@ namespace WebCore {
 
 class BufferSource;
 class CDM;
+class DeferredPromise;
 class MediaKeyStatusMap;
 class MediaKeys;
 class SharedBuffer;
 
+template<typename IDLType> class DOMPromiseProxy;
+
 class MediaKeySession final : public RefCounted<MediaKeySession>, public EventTargetWithInlineData, public ActiveDOMObject, public CDMInstanceSessionClient {
     WTF_MAKE_ISO_ALLOCATED(MediaKeySession);
 public:
@@ -74,7 +77,7 @@ public:
     void remove(Ref<DeferredPromise>&&);
 
     using ClosedPromise = DOMPromiseProxy<IDLVoid>;
-    ClosedPromise& closed() { return m_closedPromise; }
+    ClosedPromise& closed() { return m_closedPromise.get(); }
 
     const Vector<std::pair<Ref<SharedBuffer>, MediaKeyStatus>>& statuses() const { return m_statuses; }
 
@@ -105,7 +108,7 @@ private:
     WeakPtr<MediaKeys> m_keys;
     String m_sessionId;
     double m_expiration;
-    ClosedPromise m_closedPromise;
+    UniqueRef<ClosedPromise> m_closedPromise;
     Ref<MediaKeyStatusMap> m_keyStatuses;
     bool m_closed { false };
     bool m_uninitialized { true };
index dd4876b..30c34cd 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "CDM.h"
 #include "CDMInstance.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSMediaKeys.h"
 #include "MediaKeys.h"
 #include "MediaKeysRequirement.h"
index 284d949..4f5a155 100644 (file)
@@ -31,7 +31,6 @@
 #if ENABLE(ENCRYPTED_MEDIA)
 
 #include "GenericTaskQueue.h"
-#include "JSDOMPromiseDeferred.h"
 #include "MediaKeySystemConfiguration.h"
 #include <wtf/RefCounted.h>
 #include <wtf/text/WTFString.h>
@@ -39,6 +38,7 @@
 namespace WebCore {
 
 class CDM;
+class DeferredPromise;
 class MediaKeys;
 
 class MediaKeySystemAccess : public RefCounted<MediaKeySystemAccess> {
index 05178c5..2fcd034 100644 (file)
@@ -34,6 +34,7 @@
 #include "CDM.h"
 #include "CDMClient.h"
 #include "CDMInstance.h"
+#include "JSDOMPromiseDeferred.h"
 #include "Logging.h"
 #include "MediaKeySession.h"
 #include "SharedBuffer.h"
index 914614d..fa26933 100644 (file)
@@ -32,7 +32,6 @@
 
 #include "ExceptionOr.h"
 #include "GenericTaskQueue.h"
-#include "JSDOMPromiseDeferred.h"
 #include "MediaKeySessionType.h"
 #include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
@@ -44,7 +43,9 @@ class CDM;
 class CDMClient;
 class CDMInstance;
 class BufferSource;
+class DeferredPromise;
 class MediaKeySession;
+class ScriptExecutionContext;
 
 class MediaKeys : public RefCounted<MediaKeys>, public CanMakeWeakPtr<MediaKeys> {
 public:
index df1f4df..0baaf8d 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "CDM.h"
 #include "Document.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSMediaKeySystemAccess.h"
 #include "Logging.h"
 
index d95f766..a8b12f6 100644 (file)
 
 #if ENABLE(ENCRYPTED_MEDIA)
 
-#include "JSDOMPromiseDeferred.h"
 #include "MediaKeySystemConfiguration.h"
 #include "Supplementable.h"
 
 namespace WebCore {
 
+class DeferredPromise;
 class Document;
 class MediaKeySystemAccess;
 class Navigator;
index 21e487e..dec31d9 100644 (file)
@@ -33,6 +33,7 @@
 #include "DOMWindow.h"
 #include "Document.h"
 #include "FetchResponse.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSFetchResponse.h"
 
 namespace WebCore {
index 2a8a8ab..2748345 100644 (file)
 #pragma once
 
 #include "FetchRequest.h"
-#include "JSDOMPromiseDeferred.h"
 #include <wtf/Forward.h>
 
 namespace WebCore {
 
+class DeferredPromise;
 class DOMWindow;
 
 class DOMWindowFetch {
index 291854a..3d69f8a 100644 (file)
@@ -35,6 +35,7 @@
 #include "FetchHeaders.h"
 #include "HTTPHeaderValues.h"
 #include "HTTPParsers.h"
+#include "JSDOMPromiseDeferred.h"
 #include "ReadableStreamSource.h"
 #include <JavaScriptCore/ArrayBufferView.h>
 
@@ -129,6 +130,11 @@ void FetchBody::text(FetchBodyOwner& owner, Ref<DeferredPromise>&& promise)
     consume(owner, WTFMove(promise));
 }
 
+void FetchBody::formData(FetchBodyOwner&, Ref<DeferredPromise>&& promise)
+{
+    promise.get().reject(NotSupportedError);
+}
+
 void FetchBody::consumeOnceLoadingFinished(FetchBodyConsumer::Type type, Ref<DeferredPromise>&& promise, const String& contentType)
 {
     m_consumer.setType(type);
index c3f96ff..85c8621 100644 (file)
 #include "ExceptionOr.h"
 #include "FetchBodyConsumer.h"
 #include "FormData.h"
-#include "JSDOMPromiseDeferred.h"
 #include "ReadableStream.h"
 #include "URLSearchParams.h"
 #include <wtf/Variant.h>
 
 namespace WebCore {
 
+class DeferredPromise;
 class FetchBodyOwner;
 class FetchBodySource;
 class ScriptExecutionContext;
@@ -49,7 +49,7 @@ public:
     void blob(FetchBodyOwner&, Ref<DeferredPromise>&&, const String&);
     void json(FetchBodyOwner&, Ref<DeferredPromise>&&);
     void text(FetchBodyOwner&, Ref<DeferredPromise>&&);
-    void formData(FetchBodyOwner&, Ref<DeferredPromise>&& promise) { promise.get().reject(NotSupportedError); }
+    void formData(FetchBodyOwner&, Ref<DeferredPromise>&&);
 
 #if ENABLE(STREAMS_API)
     void consumeAsStream(FetchBodyOwner&, FetchBodySource&);
index c0dbf5f..d216624 100644 (file)
@@ -33,6 +33,7 @@
 #include "CachedResourceRequestInitiators.h"
 #include "ContentSecurityPolicy.h"
 #include "FetchBody.h"
+#include "FetchBodyConsumer.h"
 #include "FetchLoaderClient.h"
 #include "FetchRequest.h"
 #include "ResourceError.h"
index 1e47a05..0e373fa 100644 (file)
@@ -28,7 +28,6 @@
 
 #pragma once
 
-#include "FetchBodyConsumer.h"
 #include "ThreadableLoader.h"
 #include "ThreadableLoaderClient.h"
 #include <wtf/URL.h>
@@ -36,6 +35,7 @@
 namespace WebCore {
 
 class Blob;
+class FetchBodyConsumer;
 class FetchLoaderClient;
 class FetchRequest;
 class ScriptExecutionContext;
index 73c0451..3440177 100644 (file)
@@ -30,6 +30,7 @@
 #include "WorkerGlobalScopeFetch.h"
 
 #include "FetchResponse.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSFetchResponse.h"
 #include "WorkerGlobalScope.h"
 
index 2a6d8bb..fad079c 100644 (file)
 #pragma once
 
 #include "FetchRequest.h"
-#include "JSDOMPromiseDeferred.h"
 
 namespace WebCore {
 
+class DeferredPromise;
 class WorkerGlobalScope;
 
 class WorkerGlobalScopeFetch {
index 139752c..263c06f 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "ContentType.h"
 #include "Document.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSMediaCapabilitiesDecodingInfo.h"
 #include "JSMediaCapabilitiesEncodingInfo.h"
 #include "MediaCapabilitiesDecodingInfo.h"
index 1854fa4..6066297 100644 (file)
 #pragma once
 
 #include "GenericTaskQueue.h"
-#include "JSDOMPromiseDeferred.h"
 #include <wtf/RefCounted.h>
 
 namespace WebCore {
 
+class DeferredPromise;
 class Document;
 struct MediaDecodingConfiguration;
 struct MediaEncodingConfiguration;
index 0862414..c5652ce 100644 (file)
@@ -37,6 +37,7 @@
 #include "Document.h"
 #include "Event.h"
 #include "EventNames.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSMediaDeviceInfo.h"
 #include "MediaTrackSupportedConstraints.h"
 #include "RealtimeMediaSourceSettings.h"
index 51cd1b4..e54c5b3 100644 (file)
@@ -37,7 +37,7 @@
 #include "EventNames.h"
 #include "EventTarget.h"
 #include "ExceptionOr.h"
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include "MediaTrackConstraints.h"
 #include "RealtimeMediaSourceCenter.h"
 #include "Timer.h"
@@ -52,6 +52,8 @@ class MediaStream;
 
 struct MediaTrackSupportedConstraints;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 class MediaDevices final : public RefCounted<MediaDevices>, public ActiveDOMObject, public EventTargetWithInlineData, public CanMakeWeakPtr<MediaDevices> {
     WTF_MAKE_ISO_ALLOCATED(MediaDevices);
 public:
index 756b457..8513179 100644 (file)
@@ -33,6 +33,7 @@
 #include "Document.h"
 #include "Event.h"
 #include "EventNames.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSOverconstrainedError.h"
 #include "MediaConstraints.h"
 #include "MediaStream.h"
@@ -379,7 +380,7 @@ static MediaConstraints createMediaConstraints(const Optional<MediaTrackConstrai
 
 void MediaStreamTrack::applyConstraints(const Optional<MediaTrackConstraints>& constraints, DOMPromiseDeferred<void>&& promise)
 {
-    m_promise = WTFMove(promise);
+    m_promise = WTF::makeUnique<DOMPromiseDeferred<void>>(WTFMove(promise));
 
     auto completionHandler = [this, weakThis = makeWeakPtr(*this), constraints](auto&& error) mutable {
         if (!weakThis || !m_promise)
index 8fa8903..627f6df 100644 (file)
@@ -33,7 +33,6 @@
 #include "DoubleRange.h"
 #include "EventTarget.h"
 #include "GenericTaskQueue.h"
-#include "JSDOMPromiseDeferred.h"
 #include "LongRange.h"
 #include "MediaProducer.h"
 #include "MediaStreamTrackPrivate.h"
@@ -47,6 +46,8 @@ class Document;
 
 struct MediaTrackConstraints;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 class MediaStreamTrack
     : public RefCounted<MediaStreamTrack>
     , public ActiveDOMObject
@@ -201,7 +202,7 @@ private:
     Vector<Observer*> m_observers;
 
     MediaTrackConstraints m_constraints;
-    Optional<DOMPromiseDeferred<void>> m_promise;
+    std::unique_ptr<DOMPromiseDeferred<void>> m_promise;
     GenericTaskQueue<ScriptExecutionContext> m_taskQueue;
     GenericTaskQueue<Timer> m_eventTaskQueue;
 
index e68ed99..2ff230e 100644 (file)
@@ -35,6 +35,7 @@
 #if ENABLE(WEB_RTC)
 
 #include "EventNames.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSRTCSessionDescription.h"
 #include "LibWebRTCCertificateGenerator.h"
 #include "Logging.h"
@@ -82,12 +83,14 @@ PeerConnectionBackend::PeerConnectionBackend(RTCPeerConnection& peerConnection)
 {
 }
 
+PeerConnectionBackend::~PeerConnectionBackend() = default;
+
 void PeerConnectionBackend::createOffer(RTCOfferOptions&& options, PeerConnection::SessionDescriptionPromise&& promise)
 {
     ASSERT(!m_offerAnswerPromise);
     ASSERT(!m_peerConnection.isClosed());
 
-    m_offerAnswerPromise = WTFMove(promise);
+    m_offerAnswerPromise = WTF::makeUnique<PeerConnection::SessionDescriptionPromise>(WTFMove(promise));
     doCreateOffer(WTFMove(options));
 }
 
@@ -124,7 +127,7 @@ void PeerConnectionBackend::createAnswer(RTCAnswerOptions&& options, PeerConnect
     ASSERT(!m_offerAnswerPromise);
     ASSERT(!m_peerConnection.isClosed());
 
-    m_offerAnswerPromise = WTFMove(promise);
+    m_offerAnswerPromise = WTF::makeUnique<PeerConnection::SessionDescriptionPromise>(WTFMove(promise));
     doCreateAnswer(WTFMove(options));
 }
 
@@ -184,7 +187,7 @@ void PeerConnectionBackend::setLocalDescription(RTCSessionDescription& sessionDe
         return;
     }
 
-    m_setDescriptionPromise = WTFMove(promise);
+    m_setDescriptionPromise = WTF::makeUnique<DOMPromiseDeferred<void>>(WTFMove(promise));
     doSetLocalDescription(sessionDescription);
 }
 
@@ -245,7 +248,7 @@ void PeerConnectionBackend::setRemoteDescription(RTCSessionDescription& sessionD
         return;
     }
 
-    m_setDescriptionPromise = WTFMove(promise);
+    m_setDescriptionPromise = WTF::makeUnique<DOMPromiseDeferred<void>>(WTFMove(promise));
     doSetRemoteDescription(sessionDescription);
 }
 
@@ -325,7 +328,7 @@ void PeerConnectionBackend::addIceCandidate(RTCIceCandidate* iceCandidate, DOMPr
         promise.reject(Exception { TypeError, "Trying to add a candidate that is missing both sdpMid and sdpMLineIndex"_s });
         return;
     }
-    m_addIceCandidatePromise = WTFMove(promise);
+    m_addIceCandidatePromise = WTF::makeUnique<DOMPromiseDeferred<void>>(WTFMove(promise));
     doAddIceCandidate(*iceCandidate);
 }
 
@@ -470,6 +473,11 @@ void PeerConnectionBackend::doneGatheringCandidates()
     m_pendingICECandidates.clear();
 }
 
+void PeerConnectionBackend::endOfIceCandidates(DOMPromiseDeferred<void>&& promise)
+{
+    promise.resolve();
+}
+
 void PeerConnectionBackend::registerMDNSName(const String& ipAddress)
 {
     ++m_waitingForMDNSRegistration;
@@ -520,9 +528,9 @@ void PeerConnectionBackend::updateSignalingState(RTCSignalingState newSignalingS
 
 void PeerConnectionBackend::stop()
 {
-    m_offerAnswerPromise = WTF::nullopt;
-    m_setDescriptionPromise = WTF::nullopt;
-    m_addIceCandidatePromise = WTF::nullopt;
+    m_offerAnswerPromise = nullptr;
+    m_setDescriptionPromise = nullptr;
+    m_addIceCandidatePromise = nullptr;
 
     m_pendingTrackEvents.clear();
 
index 8b21522..9015ea2 100644 (file)
@@ -33,7 +33,7 @@
 
 #if ENABLE(WEB_RTC)
 
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include "LibWebRTCProvider.h"
 #include "RTCRtpSendParameters.h"
 #include "RTCSessionDescription.h"
@@ -43,6 +43,7 @@
 
 namespace WebCore {
 
+class DeferredPromise;
 class Document;
 class MediaStream;
 class MediaStreamTrack;
@@ -56,6 +57,7 @@ class RTCRtpSender;
 class RTCRtpTransceiver;
 class RTCSessionDescription;
 class RTCStatsReport;
+class ScriptExecutionContext;
 
 struct MediaEndpointConfiguration;
 struct RTCAnswerOptions;
@@ -63,6 +65,8 @@ struct RTCDataChannelInit;
 struct RTCOfferOptions;
 struct RTCRtpTransceiverInit;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 namespace PeerConnection {
 using SessionDescriptionPromise = DOMPromiseDeferred<IDLDictionary<RTCSessionDescription::Init>>;
 using StatsPromise = DOMPromiseDeferred<IDLInterface<RTCStatsReport>>;
@@ -83,7 +87,7 @@ public:
     static Optional<RTCRtpCapabilities> senderCapabilities(ScriptExecutionContext&, const String& kind);
 
     explicit PeerConnectionBackend(RTCPeerConnection&);
-    virtual ~PeerConnectionBackend() = default;
+    virtual ~PeerConnectionBackend();
 
     void createOffer(RTCOfferOptions&&, PeerConnection::SessionDescriptionPromise&&);
     void createAnswer(RTCAnswerOptions&&, PeerConnection::SessionDescriptionPromise&&);
@@ -212,7 +216,7 @@ private:
     virtual void doSetLocalDescription(RTCSessionDescription&) = 0;
     virtual void doSetRemoteDescription(RTCSessionDescription&) = 0;
     virtual void doAddIceCandidate(RTCIceCandidate&) = 0;
-    virtual void endOfIceCandidates(DOMPromiseDeferred<void>&& promise) { promise.resolve(); }
+    virtual void endOfIceCandidates(DOMPromiseDeferred<void>&&);
     virtual void doStop() = 0;
 
     void registerMDNSName(const String& ipAddress);
@@ -221,9 +225,9 @@ protected:
     RTCPeerConnection& m_peerConnection;
 
 private:
-    Optional<PeerConnection::SessionDescriptionPromise> m_offerAnswerPromise;
-    Optional<DOMPromiseDeferred<void>> m_setDescriptionPromise;
-    Optional<DOMPromiseDeferred<void>> m_addIceCandidatePromise;
+    std::unique_ptr<PeerConnection::SessionDescriptionPromise> m_offerAnswerPromise;
+    std::unique_ptr<DOMPromiseDeferred<void>> m_setDescriptionPromise;
+    std::unique_ptr<DOMPromiseDeferred<void>> m_addIceCandidatePromise;
 
     bool m_shouldFilterICECandidates { true };
     struct PendingICECandidate {
index 464d17d..8069d52 100644 (file)
@@ -40,6 +40,7 @@
 #include "Event.h"
 #include "EventNames.h"
 #include "Frame.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSRTCPeerConnection.h"
 #include "Logging.h"
 #include "MediaEndpointConfiguration.h"
index 9dd9467..3cca8b2 100644 (file)
@@ -39,6 +39,7 @@
 
 namespace WebCore {
 
+class DeferredPromise;
 class PeerConnectionBackend;
 struct RTCRtpCapabilities;
 
index 65638cd..ad52409 100644 (file)
 
 #if ENABLE(WEB_RTC)
 
-#include "JSDOMPromiseDeferred.h"
-
 namespace WebCore {
 
 class MediaStreamTrack;
 class RTCDTMFSenderBackend;
 class RTCRtpSender;
-struct RTCRtpSendParameters;
 class ScriptExecutionContext;
 
+struct RTCRtpSendParameters;
+
+template<typename IDLType> class DOMPromiseDeferred;
+
 class RTCRtpSenderBackend {
 public:
     virtual void replaceTrack(ScriptExecutionContext&, RTCRtpSender&, RefPtr<MediaStreamTrack>&&, DOMPromiseDeferred<void>&&) = 0;
index 7387a38..4f2517e 100644 (file)
@@ -38,6 +38,7 @@
 
 #include "Document.h"
 #include "Frame.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSMediaStream.h"
 #include "JSOverconstrainedError.h"
 #include "Logging.h"
@@ -61,7 +62,7 @@ Ref<UserMediaRequest> UserMediaRequest::create(Document& document, MediaStreamRe
 UserMediaRequest::UserMediaRequest(Document& document, MediaStreamRequest&& request, DOMPromiseDeferred<IDLInterface<MediaStream>>&& promise)
     : ActiveDOMObject(document)
     , m_identifier(UserMediaRequestIdentifier::generate())
-    , m_promise(WTFMove(promise))
+    , m_promise(makeUniqueRef<DOMPromiseDeferred<IDLInterface<MediaStream>>>(WTFMove(promise)))
     , m_request(WTFMove(request))
 {
 }
@@ -256,7 +257,7 @@ void UserMediaRequest::allow(CaptureDevice&& audioDevice, CaptureDevice&& videoD
 
         ASSERT(document.isCapturing());
         stream->document()->setHasCaptureMediaStreamTrack();
-        m_promise.resolve(WTFMove(stream));
+        m_promise->resolve(WTFMove(stream));
     };
 
     auto& document = downcast<Document>(*scriptExecutionContext());
@@ -298,7 +299,7 @@ void UserMediaRequest::deny(MediaAccessDenialReason reason, const String& messag
         break;
     case MediaAccessDenialReason::InvalidConstraint:
         RELEASE_LOG(MediaStream, "UserMediaRequest::deny - invalid constraint - %s", message.utf8().data());
-        m_promise.rejectType<IDLInterface<OverconstrainedError>>(OverconstrainedError::create(message, "Invalid constraint"_s).get());
+        m_promise->rejectType<IDLInterface<OverconstrainedError>>(OverconstrainedError::create(message, "Invalid constraint"_s).get());
         return;
     case MediaAccessDenialReason::HardwareError:
         RELEASE_LOG(MediaStream, "UserMediaRequest::deny - hardware error");
@@ -319,9 +320,9 @@ void UserMediaRequest::deny(MediaAccessDenialReason reason, const String& messag
     }
 
     if (!message.isEmpty())
-        m_promise.reject(code, message);
+        m_promise->reject(code, message);
     else
-        m_promise.reject(code);
+        m_promise->reject(code);
 }
 
 void UserMediaRequest::stop()
@@ -361,7 +362,7 @@ void UserMediaRequest::mediaStreamDidFail(RealtimeMediaSource::Type type)
         typeDescription = "unknown";
         break;
     }
-    m_promise.reject(NotReadableError, makeString("Failed starting capture of a "_s, typeDescription, " track"_s));
+    m_promise->reject(NotReadableError, makeString("Failed starting capture of a "_s, typeDescription, " track"_s));
 }
 
 } // namespace WebCore
index 3fbc473..f2c0efc 100644 (file)
 
 #include "ActiveDOMObject.h"
 #include "CaptureDevice.h"
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include "MediaConstraints.h"
 #include "MediaStreamPrivate.h"
 #include "MediaStreamRequest.h"
 #include <wtf/CompletionHandler.h>
 #include <wtf/ObjectIdentifier.h>
+#include <wtf/UniqueRef.h>
 
 namespace WebCore {
 
 class MediaStream;
 class SecurityOrigin;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 enum UserMediaRequestIdentifierType { };
 using UserMediaRequestIdentifier = ObjectIdentifier<UserMediaRequestIdentifierType>;
 
@@ -91,7 +94,7 @@ private:
     Vector<String> m_videoDeviceUIDs;
     Vector<String> m_audioDeviceUIDs;
 
-    DOMPromiseDeferred<IDLInterface<MediaStream>> m_promise;
+    UniqueRef<DOMPromiseDeferred<IDLInterface<MediaStream>>> m_promise;
     MediaStreamRequest m_request;
 };
 
index e8d06e1..d052b8f 100644 (file)
@@ -28,6 +28,7 @@
 #if USE(LIBWEBRTC)
 
 #include "EventNames.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSRTCStatsReport.h"
 #include "LibWebRTCDataChannelHandler.h"
 #include "LibWebRTCPeerConnectionBackend.h"
index 6aeea13..894258b 100644 (file)
@@ -27,6 +27,7 @@
 
 #if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
 
+#include "JSDOMPromiseDeferred.h"
 #include "LibWebRTCDTMFSenderBackend.h"
 #include "LibWebRTCPeerConnectionBackend.h"
 #include "LibWebRTCUtils.h"
index 5c0d7e9..e643a83 100644 (file)
@@ -27,6 +27,7 @@
 
 #if ENABLE(WEB_RTC) && USE(LIBWEBRTC)
 
+#include "JSDOMPromiseDeferred.h"
 #include "LibWebRTCRtpReceiverBackend.h"
 #include "LibWebRTCRtpSenderBackend.h"
 #include "LibWebRTCUtils.h"
index 0774fc6..cc0774b 100644 (file)
@@ -32,6 +32,7 @@
 #include "Document.h"
 #include "EventNames.h"
 #include "JSDOMPromise.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSPaymentDetailsUpdate.h"
 #include "JSPaymentResponse.h"
 #include "Page.h"
@@ -410,7 +411,7 @@ void PaymentRequest::show(Document& document, RefPtr<DOMPromise>&& detailsPromis
 
     m_state = State::Interactive;
     ASSERT(!m_showPromise);
-    m_showPromise = WTFMove(promise);
+    m_showPromise = WTF::makeUnique<ShowPromise>(WTFMove(promise));
 
     RefPtr<PaymentHandler> selectedPaymentHandler;
     for (auto& paymentMethod : m_serializedMethodData) {
@@ -468,7 +469,7 @@ void PaymentRequest::abortWithException(Exception&& exception)
 
 void PaymentRequest::settleShowPromise(ExceptionOr<PaymentResponse&>&& result)
 {
-    if (auto showPromise = std::exchange(m_showPromise, WTF::nullopt))
+    if (auto showPromise = std::exchange(m_showPromise, nullptr))
         showPromise->settle(WTFMove(result));
 }
 
index f7c3426..7f1b52f 100644 (file)
@@ -30,7 +30,7 @@
 #include "ActiveDOMObject.h"
 #include "EventTarget.h"
 #include "ExceptionOr.h"
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include "PaymentDetailsInit.h"
 #include "PaymentMethodChangeEvent.h"
 #include "PaymentOptions.h"
@@ -49,6 +49,7 @@ enum class PaymentComplete;
 enum class PaymentShippingType;
 struct PaymentDetailsUpdate;
 struct PaymentMethodData;
+template<typename IDLType> class DOMPromiseDeferred;
 
 class PaymentRequest final : public ActiveDOMObject, public CanMakeWeakPtr<PaymentRequest>, public EventTargetWithInlineData, public RefCounted<PaymentRequest> {
     WTF_MAKE_ISO_ALLOCATED(PaymentRequest);
@@ -142,7 +143,7 @@ private:
     String m_shippingOption;
     RefPtr<PaymentAddress> m_shippingAddress;
     State m_state { State::Created };
-    Optional<ShowPromise> m_showPromise;
+    std::unique_ptr<ShowPromise> m_showPromise;
     Optional<PaymentHandlerWithPendingActivity> m_activePaymentHandler;
     RefPtr<DOMPromise> m_detailsPromise;
     RefPtr<DOMPromise> m_merchantSessionPromise;
index d6c18b8..98b5d6c 100644 (file)
@@ -28,6 +28,7 @@
 
 #if ENABLE(PAYMENT_REQUEST)
 
+#include "JSDOMPromiseDeferred.h"
 #include "NotImplemented.h"
 #include "PaymentRequest.h"
 #include <wtf/IsoMallocInlines.h>
@@ -103,7 +104,7 @@ void PaymentResponse::retry(PaymentValidationErrors&& errors, DOMPromiseDeferred
         return;
     }
 
-    m_retryPromise = WTFMove(promise);
+    m_retryPromise = WTF::makeUnique<DOMPromiseDeferred<void>>(WTFMove(promise));
 }
 
 void PaymentResponse::abortWithException(Exception&& exception)
@@ -120,7 +121,8 @@ void PaymentResponse::settleRetryPromise(ExceptionOr<void>&& result)
 
     ASSERT(hasPendingActivity());
     ASSERT(m_state == State::Created);
-    std::exchange(m_retryPromise, WTF::nullopt)->settle(WTFMove(result));
+    m_retryPromise->settle(WTFMove(result));
+    m_retryPromise = nullptr;
 }
 
 bool PaymentResponse::canSuspendForDocumentSuspension() const
index ee226a0..9ae9f85 100644 (file)
@@ -30,7 +30,6 @@
 #include "ActiveDOMObject.h"
 #include "ContextDestructionObserver.h"
 #include "EventTarget.h"
-#include "JSDOMPromiseDeferred.h"
 #include "JSValueInWrappedObject.h"
 #include "PaymentAddress.h"
 #include "PaymentComplete.h"
@@ -42,6 +41,8 @@ class Document;
 class PaymentRequest;
 struct PaymentValidationErrors;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 class PaymentResponse final : public ActiveDOMObject, public EventTargetWithInlineData, public RefCounted<PaymentResponse> {
     WTF_MAKE_ISO_ALLOCATED(PaymentResponse);
 public:
@@ -123,7 +124,7 @@ private:
     String m_payerEmail;
     String m_payerPhone;
     State m_state { State::Created };
-    Optional<DOMPromiseDeferred<void>> m_retryPromise;
+    std::unique_ptr<DOMPromiseDeferred<void>> m_retryPromise;
     RefPtr<PendingActivity<PaymentResponse>> m_pendingActivity;
 };
 
diff --git a/Source/WebCore/Modules/streams/ReadableStreamSource.cpp b/Source/WebCore/Modules/streams/ReadableStreamSource.cpp
new file mode 100644 (file)
index 0000000..490f0e3
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * 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 "ReadableStreamSource.h"
+
+#include "JSDOMPromiseDeferred.h"
+
+#if ENABLE(STREAMS_API)
+
+namespace WebCore {
+
+ReadableStreamSource::~ReadableStreamSource() = default;
+
+void ReadableStreamSource::start(ReadableStreamDefaultController&& controller, DOMPromiseDeferred<void>&& promise)
+{
+    ASSERT(!m_promise);
+    m_promise = WTF::makeUnique<DOMPromiseDeferred<void>>(WTFMove(promise));
+    m_controller = WTFMove(controller);
+
+    setActive();
+    doStart();
+}
+
+void ReadableStreamSource::pull(DOMPromiseDeferred<void>&& promise)
+{
+    ASSERT(!m_promise);
+    ASSERT(m_controller);
+
+    m_promise = WTF::makeUnique<DOMPromiseDeferred<void>>(WTFMove(promise));
+
+    setActive();
+    doPull();
+}
+
+void ReadableStreamSource::startFinished()
+{
+    ASSERT(m_promise);
+    m_promise->resolve();
+    m_promise = nullptr;
+    setInactive();
+}
+
+void ReadableStreamSource::pullFinished()
+{
+    ASSERT(m_promise);
+    m_promise->resolve();
+    m_promise = nullptr;
+    setInactive();
+}
+
+void ReadableStreamSource::cancel(JSC::JSValue)
+{
+    clean();
+    doCancel();
+}
+
+void ReadableStreamSource::clean()
+{
+    if (m_promise) {
+        m_promise = nullptr;
+        setInactive();
+    }
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(STREAMS_API)
index f4f02b3..d4cefeb 100644 (file)
 
 #if ENABLE(STREAMS_API)
 
-#include "JSDOMPromiseDeferred.h"
 #include "ReadableStreamDefaultController.h"
 #include <wtf/Optional.h>
 
 namespace WebCore {
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 class ReadableStreamSource : public RefCounted<ReadableStreamSource> {
 public:
-    virtual ~ReadableStreamSource() = default;
+    virtual ~ReadableStreamSource();
 
     void start(ReadableStreamDefaultController&&, DOMPromiseDeferred<void>&&);
     void pull(DOMPromiseDeferred<void>&&);
@@ -63,59 +64,10 @@ protected:
     virtual void doCancel() = 0;
 
 private:
-    Optional<DOMPromiseDeferred<void>> m_promise;
+    std::unique_ptr<DOMPromiseDeferred<void>> m_promise;
     Optional<ReadableStreamDefaultController> m_controller;
 };
 
-inline void ReadableStreamSource::start(ReadableStreamDefaultController&& controller, DOMPromiseDeferred<void>&& promise)
-{
-    ASSERT(!m_promise);
-    m_promise = WTFMove(promise);
-    m_controller = WTFMove(controller);
-
-    setActive();
-    doStart();
-}
-
-inline void ReadableStreamSource::pull(DOMPromiseDeferred<void>&& promise)
-{
-    ASSERT(!m_promise);
-    ASSERT(m_controller);
-
-    m_promise = WTFMove(promise);
-
-    setActive();
-    doPull();
-}
-
-inline void ReadableStreamSource::startFinished()
-{
-    ASSERT(m_promise);
-    std::exchange(m_promise, WTF::nullopt).value().resolve();
-    setInactive();
-}
-
-inline void ReadableStreamSource::pullFinished()
-{
-    ASSERT(m_promise);
-    std::exchange(m_promise, WTF::nullopt).value().resolve();
-    setInactive();
-}
-
-inline void ReadableStreamSource::cancel(JSC::JSValue)
-{
-    clean();
-    doCancel();
-}
-
-inline void ReadableStreamSource::clean()
-{
-    if (m_promise) {
-        m_promise = WTF::nullopt;
-        setInactive();
-    }
-}
-
 } // namespace WebCore
 
 #endif // ENABLE(STREAMS_API)
index 3419981..0c45ad5 100644 (file)
@@ -30,7 +30,6 @@
 #include "AudioBus.h"
 #include "AudioDestinationNode.h"
 #include "EventTarget.h"
-#include "JSDOMPromiseDeferred.h"
 #include "MediaCanStartListener.h"
 #include "MediaProducer.h"
 #include "PlatformMediaSession.h"
@@ -78,6 +77,8 @@ class ScriptProcessorNode;
 class SecurityOrigin;
 class WaveShaperNode;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 // AudioContext is the cornerstone of the web audio API and all AudioNodes are created from it.
 // For thread safety between the audio thread and the main thread, it has a rendering graph locking mechanism. 
 
index 91934e8..847d266 100644 (file)
@@ -33,6 +33,7 @@
 #include "AuthenticatorAttestationResponse.h"
 #include "AuthenticatorCoordinatorClient.h"
 #include "JSBasicCredential.h"
+#include "JSDOMPromiseDeferred.h"
 #include "PublicKeyCredential.h"
 #include "PublicKeyCredentialCreationOptions.h"
 #include "PublicKeyCredentialData.h"
index 0b8b849..9c65ae6 100644 (file)
@@ -27,7 +27,7 @@
 
 #if ENABLE(WEB_AUTHN)
 
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include <wtf/Forward.h>
 #include <wtf/Noncopyable.h>
 
@@ -41,6 +41,8 @@ class SecurityOrigin;
 struct PublicKeyCredentialCreationOptions;
 struct PublicKeyCredentialRequestOptions;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 using CredentialPromise = DOMPromiseDeferred<IDLNullable<IDLInterface<BasicCredential>>>;
 
 class AuthenticatorCoordinator final {
index 12df0c2..4be715b 100644 (file)
@@ -29,7 +29,7 @@
 
 #include "BasicCredential.h"
 #include "ExceptionOr.h"
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include <JavaScriptCore/ArrayBuffer.h>
 #include <wtf/Forward.h>
 
@@ -40,6 +40,8 @@ class Document;
 
 struct PublicKeyCredentialData;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 class PublicKeyCredential final : public BasicCredential {
 public:
     struct AuthenticationExtensionsClientOutputs {
index 53e3788..e101636 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "WHLSLAST.h"
 #include "WHLSLASTDumper.h"
+#include "WHLSLLexer.h"
 #include "WHLSLProgram.h"
 #include "WHLSLReplaceWith.h"
 #include "WHLSLVisitor.h"
index 12dc350..508fe98 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "WHLSLCallExpression.h"
 #include "WHLSLParser.h"
+#include "WHLSLProgram.h"
 #include "WHLSLStandardLibrary.h"
 #include "WHLSLStandardLibraryFunctionMap.h"
 #include "WHLSLVisitor.h"
index 16ca4d9..6b39bdc 100644 (file)
@@ -29,6 +29,7 @@
 #if ENABLE(WEBGPU)
 
 #include "GPURequestAdapterOptions.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSWebGPUAdapter.h"
 #include <wtf/Optional.h>
 
index 78a38e2..161e6cd 100644 (file)
@@ -27,7 +27,7 @@
 
 #if ENABLE(WEBGPU)
 
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 
 namespace WebCore {
 
@@ -35,6 +35,8 @@ class WebGPUAdapter;
 
 struct GPURequestAdapterOptions;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 class WebGPU : public RefCounted<WebGPU> {
 public:
     static Ref<WebGPU> create();
index 69789d9..6dba7d0 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "Document.h"
 #include "InspectorInstrumentation.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSWebGPUDevice.h"
 
 namespace WebCore {
index 1849519..9d7c17c 100644 (file)
@@ -28,7 +28,7 @@
 #if ENABLE(WEBGPU)
 
 #include "GPURequestAdapterOptions.h"
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include <wtf/Optional.h>
 #include <wtf/Ref.h>
 #include <wtf/RefCounted.h>
@@ -38,6 +38,8 @@ namespace WebCore {
 class Document;
 class WebGPUDevice;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 class WebGPUAdapter : public RefCounted<WebGPUAdapter> {
 public:
     static Ref<WebGPUAdapter> create(Optional<GPURequestAdapterOptions>&&);
index ba25963..41f4168 100644 (file)
@@ -29,6 +29,7 @@
 #if ENABLE(WEBGPU)
 
 #include "GPUErrorScopes.h"
+#include "JSDOMPromiseDeferred.h"
 #include <wtf/text/StringConcatenate.h>
 
 namespace WebCore {
index d996b5e..b2eee20 100644 (file)
@@ -30,7 +30,7 @@
 #include "GPUBuffer.h"
 #include "GPUBufferUsage.h"
 #include "GPUObjectBase.h"
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include <wtf/RefPtr.h>
 
 namespace JSC {
@@ -41,6 +41,8 @@ namespace WebCore {
 
 struct GPUBufferDescriptor;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 class WebGPUBuffer : public GPUObjectBase {
 public:
     static Ref<WebGPUBuffer> create(RefPtr<GPUBuffer>&&, GPUErrorScopes&);
index 7d5de79..6dc8db3 100644 (file)
@@ -51,6 +51,7 @@
 #include "GPUUncapturedErrorEvent.h"
 #include "InspectorInstrumentation.h"
 #include "JSDOMConvertBufferSource.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSGPUOutOfMemoryError.h"
 #include "JSGPUValidationError.h"
 #include "JSWebGPUBuffer.h"
index 21b5417..5d35bcf 100644 (file)
@@ -30,7 +30,7 @@
 #include "EventTarget.h"
 #include "GPUDevice.h"
 #include "GPUErrorScopes.h"
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include "WebGPUAdapter.h"
 #include "WebGPUQueue.h"
 #include "WebGPUSwapChainDescriptor.h"
@@ -72,6 +72,8 @@ struct WebGPUShaderModuleDescriptor;
 
 enum class GPUErrorFilter;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 using ErrorIDLUnion = IDLUnion<IDLInterface<GPUOutOfMemoryError>, IDLInterface<GPUValidationError>>;
 using ErrorPromise = DOMPromiseDeferred<IDLNullable<ErrorIDLUnion>>;
 
index 776c43a..4df1021 100644 (file)
@@ -27,6 +27,7 @@
 #include "NavigatorWebVR.h"
 
 #include "Document.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSVRDisplay.h"
 #include "Navigator.h"
 #include "RuntimeEnabledFeatures.h"
index 5610ba1..ffd7139 100644 (file)
@@ -25,7 +25,7 @@
 
 #pragma once
 
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include "Supplementable.h"
 #include <wtf/Vector.h>
 
@@ -36,6 +36,8 @@ class Navigator;
 class Page;
 class VRDisplay;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 class NavigatorWebVR final : public Supplement<Navigator> {
     WTF_MAKE_FAST_ALLOCATED;
 public:
index c6667bb..806a7ab 100644 (file)
@@ -31,6 +31,7 @@
 #include "DOMException.h"
 #include "DOMWindow.h"
 #include "EventNames.h"
+#include "JSDOMPromiseDeferred.h"
 #include "Page.h"
 #include "ScriptedAnimationController.h"
 #include "UserGestureIndicator.h"
index 58513c6..1cad846 100644 (file)
@@ -27,7 +27,6 @@
 
 #include "ActiveDOMObject.h"
 #include "EventTarget.h"
-#include "JSDOMPromiseDeferred.h"
 #include "VREye.h"
 #include "VRLayerInit.h"
 #include "VRPlatformDisplayClient.h"
@@ -36,6 +35,7 @@
 namespace WebCore {
 
 enum ExceptionCode;
+class DeferredPromise;
 class RequestAnimationFrameCallback;
 class ScriptedAnimationController;
 class VRDisplayCapabilities;
index 264653c..e6e0958 100644 (file)
@@ -205,6 +205,7 @@ Modules/speech/SpeechSynthesisUtterance.cpp
 Modules/speech/SpeechSynthesisVoice.cpp
 
 Modules/streams/ReadableStreamSink.cpp
+Modules/streams/ReadableStreamSource.cpp
 
 Modules/webaudio/AnalyserNode.cpp
 Modules/webaudio/AsyncAudioDecoder.cpp
index 45c1a30..e95a5cd 100644 (file)
                2D3EF4451917915C00034184 /* WebActionDisablingCALayerDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebActionDisablingCALayerDelegate.mm; sourceTree = "<group>"; };
                2D3EF4461917915C00034184 /* WebCoreCALayerExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreCALayerExtras.h; sourceTree = "<group>"; };
                2D3EF4471917915C00034184 /* WebCoreCALayerExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreCALayerExtras.mm; sourceTree = "<group>"; };
+               2D43EB2D23472BC3002A1ED4 /* ReadableStreamSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReadableStreamSource.cpp; sourceTree = "<group>"; };
                2D46F04D17B96FBD005647F0 /* IntPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntPoint.cpp; sourceTree = "<group>"; };
                2D46F04F17B96FD2005647F0 /* IntSize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntSize.cpp; sourceTree = "<group>"; };
                2D4F96F11A1ECC240098BF88 /* TextIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextIndicator.cpp; sourceTree = "<group>"; };
                                4129C9871F58662D009D7403 /* ReadableStreamSink.cpp */,
                                4129C9801F5861C7009D7403 /* ReadableStreamSink.h */,
                                4129C9811F5861C7009D7403 /* ReadableStreamSink.idl */,
+                               2D43EB2D23472BC3002A1ED4 /* ReadableStreamSource.cpp */,
                                418C395B1C8F0A610051C8A3 /* ReadableStreamSource.h */,
                                418C395C1C8F0A610051C8A3 /* ReadableStreamSource.idl */,
                                9908B0F11BCACF9100ED0F55 /* StreamInternals.js */,
index c07a02f..fa157dc 100644 (file)
@@ -41,6 +41,7 @@
 #include "GeometryUtilities.h"
 #include "JSCompositeOperation.h"
 #include "JSCompositeOperationOrAuto.h"
+#include "JSDOMConvert.h"
 #include "JSKeyframeEffect.h"
 #include "RenderBox.h"
 #include "RenderBoxModelObject.h"
index 504a2f3..3194b32 100644 (file)
@@ -29,6 +29,7 @@
 #include "AnimationEffect.h"
 #include "AnimationPlaybackEvent.h"
 #include "AnimationTimeline.h"
+#include "DOMPromiseProxy.h"
 #include "DeclarativeAnimation.h"
 #include "Document.h"
 #include "DocumentTimeline.h"
index 3592d62..20b4cca 100644 (file)
@@ -26,9 +26,9 @@
 #pragma once
 
 #include "ActiveDOMObject.h"
-#include "DOMPromiseProxy.h"
 #include "EventTarget.h"
 #include "ExceptionOr.h"
+#include "IDLTypes.h"
 #include "WebAnimationUtilities.h"
 #include <wtf/Markable.h>
 #include <wtf/RefCounted.h>
@@ -45,6 +45,8 @@ class Document;
 class Element;
 class RenderStyle;
 
+template<typename IDLType> class DOMPromiseProxyWithResolveCallback;
+
 class WebAnimation : public RefCounted<WebAnimation>, public CanMakeWeakPtr<WebAnimation>, public EventTargetWithInlineData, public ActiveDOMObject {
     WTF_MAKE_ISO_ALLOCATED(WebAnimation);
 public:
index 5fb74e4..aac3d4a 100644 (file)
@@ -31,6 +31,7 @@
 #include "DOMWrapperWorld.h"
 #include "Frame.h"
 #include "JSDOMBinding.h"
+#include "JSDOMPromiseDeferred.h"
 #include "ModuleFetchParameters.h"
 #include "ResourceLoaderOptions.h"
 #include "ScriptController.h"
index 7c414d8..8688ad9 100644 (file)
 
 #pragma once
 
-#include "JSDOMPromiseDeferred.h"
-
 namespace WebCore {
 
 class CachedModuleScriptLoader;
+class DeferredPromise;
 
 class CachedModuleScriptLoaderClient {
 public:
index d96028b..bc74aaf 100644 (file)
@@ -166,6 +166,7 @@ private:
 };
 
 class DOMPromiseDeferredBase {
+    WTF_MAKE_FAST_ALLOCATED;
 public:
     DOMPromiseDeferredBase(Ref<DeferredPromise>&& genericPromise)
         : m_promiseDeferred(WTFMove(genericPromise))
index 5e34cde..835fd67 100644 (file)
@@ -31,9 +31,9 @@
 #include "config.h"
 #include "JSHTMLTemplateElement.h"
 
+#include "JSDOMConvert.h"
 #include "JSDocumentFragment.h"
 
-
 namespace WebCore {
 using namespace JSC;
 
index 7a8caed..fab40ca 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "JSImageData.h"
 
-#include "JSDOMConvertBufferSource.h"
+#include "JSDOMConvert.h"
 #include "JSDOMWrapperCache.h"
 #include <JavaScriptCore/HeapInlines.h>
 #include <JavaScriptCore/IdentifierInlines.h>
@@ -34,7 +34,6 @@
 #include <wtf/StdLibExtras.h>
 #include <wtf/text/WTFString.h>
 
-
 namespace WebCore {
 using namespace JSC;
 
index baa8fd7..ff68ef3 100644 (file)
@@ -34,9 +34,7 @@
 
 #include "JSBlob.h"
 #include "JSDOMBinding.h"
-#include "JSDOMConvertBufferSource.h"
-#include "JSDOMConvertInterface.h"
-#include "JSDOMConvertStrings.h"
+#include "JSDOMConvert.h"
 #include "JSDOMWindow.h"
 #include "JSEventTarget.h"
 #include "JSMessagePort.h"
index fe975fb..b65026e 100644 (file)
@@ -31,6 +31,7 @@
 
 #if ENABLE(STREAMS_API)
 
+#include "JSDOMPromiseDeferred.h"
 
 namespace WebCore {
 using namespace JSC;
index f1b447d..8e9cb9e 100644 (file)
@@ -32,6 +32,7 @@
 #include "JSCSSAnimation.h"
 #include "JSCSSTransition.h"
 #include "JSDOMConstructor.h"
+#include "JSDOMConvert.h"
 
 namespace WebCore {
 
index 9bd6644..fc36b33 100644 (file)
@@ -31,6 +31,7 @@
 #include "ActiveDOMCallbackMicrotask.h"
 #include "DOMWrapperWorld.h"
 #include "JSDOMGlobalObjectTask.h"
+#include "JSDOMGuardedObject.h"
 #include "JSDedicatedWorkerGlobalScope.h"
 #include "JSMicrotaskCallback.h"
 #include "JSWorkerGlobalScope.h"
index 0b7345a..dd3de2c 100644 (file)
 #include "config.h"
 #include "JSWorkerGlobalScope.h"
 
+#include "JSDOMExceptionHandling.h"
 #include "WorkerGlobalScope.h"
 #include <JavaScriptCore/JSMicrotask.h>
 
-
 namespace WebCore {
 using namespace JSC;
 
index 71513a7..89436e9 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "DOMWrapperWorld.h"
 #include "JSDOMGlobalObjectTask.h"
+#include "JSDOMGuardedObject.h"
 #include "JSWorkletGlobalScope.h"
 #include "WorkletGlobalScope.h"
 #include "WorkletScriptController.h"
index a941fb4..5eae212 100644 (file)
@@ -32,6 +32,7 @@
 #include "Document.h"
 #include "Frame.h"
 #include "JSDOMBinding.h"
+#include "JSDOMPromiseDeferred.h"
 #include "LoadableModuleScript.h"
 #include "MIMETypeRegistry.h"
 #include "ModuleFetchFailureKind.h"
index e1b1af2..a2e93e8 100644 (file)
@@ -35,6 +35,7 @@
 #include "CSSUnicodeRangeValue.h"
 #include "CSSValueList.h"
 #include "CSSValuePool.h"
+#include "DOMPromiseProxy.h"
 #include "Document.h"
 #include "FontVariantBuilder.h"
 #include "JSFontFace.h"
@@ -126,14 +127,14 @@ Ref<FontFace> FontFace::create(CSSFontFace& face)
 
 FontFace::FontFace(CSSFontSelector& fontSelector)
     : m_backing(CSSFontFace::create(&fontSelector, nullptr, this))
-    , m_loadedPromise(*this, &FontFace::loadedPromiseResolve)
+    , m_loadedPromise(makeUniqueRef<LoadedPromise>(*this, &FontFace::loadedPromiseResolve))
 {
     m_backing->addClient(*this);
 }
 
 FontFace::FontFace(CSSFontFace& face)
     : m_backing(face)
-    , m_loadedPromise(*this, &FontFace::loadedPromiseResolve)
+    , m_loadedPromise(makeUniqueRef<LoadedPromise>(*this, &FontFace::loadedPromiseResolve))
 {
     m_backing->addClient(*this);
 }
@@ -463,15 +464,15 @@ void FontFace::fontStateChanged(CSSFontFace& face, CSSFontFace::Status, CSSFontF
     case CSSFontFace::Status::Success:
         // 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);
+        if (!m_loadedPromise->isFulfilled())
+            m_loadedPromise->resolve(*this);
         deref();
         return;
     case CSSFontFace::Status::Failure:
         // 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 });
+        if (!m_loadedPromise->isFulfilled())
+            m_loadedPromise->reject(Exception { NetworkError });
         deref();
         return;
     case CSSFontFace::Status::Pending:
@@ -483,7 +484,7 @@ void FontFace::fontStateChanged(CSSFontFace& face, CSSFontFace::Status, CSSFontF
 auto FontFace::load() -> LoadedPromise&
 {
     m_backing->load();
-    return m_loadedPromise;
+    return m_loadedPromise.get();
 }
 
 FontFace& FontFace::loadedPromiseResolve()
index f05a7ef..dc7b1ac 100644 (file)
@@ -27,7 +27,8 @@
 
 #include "CSSFontFace.h"
 #include "CSSPropertyNames.h"
-#include "DOMPromiseProxy.h"
+#include "IDLTypes.h"
+#include <wtf/UniqueRef.h>
 #include <wtf/Variant.h>
 #include <wtf/WeakPtr.h>
 
@@ -38,6 +39,8 @@ class ArrayBufferView;
 
 namespace WebCore {
 
+template<typename IDLType> class DOMPromiseProxyWithResolveCallback;
+
 class FontFace final : public RefCounted<FontFace>, public CanMakeWeakPtr<FontFace>, private CSSFontFace::Client {
 public:
     struct Descriptors {
@@ -77,7 +80,7 @@ public:
     LoadStatus status() const;
 
     using LoadedPromise = DOMPromiseProxyWithResolveCallback<IDLInterface<FontFace>>;
-    LoadedPromise& loaded() { return m_loadedPromise; }
+    LoadedPromise& loaded() { return m_loadedPromise.get(); }
     LoadedPromise& load();
 
     void adopt(CSSFontFace&);
@@ -99,7 +102,7 @@ private:
     FontFace& loadedPromiseResolve();
 
     Ref<CSSFontFace> m_backing;
-    LoadedPromise m_loadedPromise;
+    UniqueRef<LoadedPromise> m_loadedPromise;
 };
 
 }
index 1ef34f5..35ef62f 100644 (file)
@@ -29,7 +29,9 @@
 #include "Document.h"
 #include "FontFace.h"
 #include "FrameLoader.h"
+#include "IDLTypes.h"
 #include "JSDOMBinding.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSFontFace.h"
 #include "JSFontFaceSet.h"
 #include <wtf/IsoMallocInlines.h>
@@ -55,7 +57,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_readyPromise(makeUniqueRef<ReadyPromise>(*this, &FontFaceSet::readyPromiseResolve))
     , m_taskQueue(SuspendableTaskQueue::create(document))
 {
     m_backing->addClient(*this);
@@ -66,14 +68,14 @@ 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(makeUniqueRef<ReadyPromise>(*this, &FontFaceSet::readyPromiseResolve))
     , m_taskQueue(SuspendableTaskQueue::create(document))
 {
     if (document.frame())
         m_isFirstLayoutDone = document.frame()->loader().stateMachine().firstLayoutDone();
 
     if (m_isFirstLayoutDone && !backing.hasActiveFontFaces())
-        m_readyPromise.resolve(*this);
+        m_readyPromise->resolve(*this);
 
     m_backing->addClient(*this);
 }
@@ -96,7 +98,7 @@ RefPtr<FontFace> FontFaceSet::Iterator::next()
 }
 
 FontFaceSet::PendingPromise::PendingPromise(LoadPromise&& promise)
-    : promise(WTFMove(promise))
+    : promise(makeUniqueRef<LoadPromise>(WTFMove(promise)))
 {
 }
 
@@ -170,7 +172,7 @@ void FontFaceSet::load(const String& font, const String& text, LoadPromise&& pro
     }
 
     if (!waiting)
-        pendingPromise->promise.resolve(pendingPromise->faces);
+        pendingPromise->promise->resolve(pendingPromise->faces);
 }
 
 ExceptionOr<bool> FontFaceSet::check(const String& family, const String& text)
@@ -203,20 +205,20 @@ void FontFaceSet::startedLoading()
 void FontFaceSet::didFirstLayout()
 {
     m_isFirstLayoutDone = true;
-    if (!m_backing->hasActiveFontFaces() && !m_readyPromise.isFulfilled()) {
+    if (!m_backing->hasActiveFontFaces() && !m_readyPromise->isFulfilled()) {
         m_taskQueue->enqueueTask([this] {
-            if (!m_readyPromise.isFulfilled())
-                m_readyPromise.resolve(*this);
+            if (!m_readyPromise->isFulfilled())
+                m_readyPromise->resolve(*this);
         });
     }
 }
 
 void FontFaceSet::completedLoading()
 {
-    if (m_isFirstLayoutDone && !m_readyPromise.isFulfilled()) {
+    if (m_isFirstLayoutDone && !m_readyPromise->isFulfilled()) {
         m_taskQueue->enqueueTask([this] {
-            if (!m_readyPromise.isFulfilled())
-                m_readyPromise.resolve(*this);
+            if (!m_readyPromise->isFulfilled())
+                m_readyPromise->resolve(*this);
         });
     }
 }
@@ -236,12 +238,12 @@ void FontFaceSet::faceFinished(CSSFontFace& face, CSSFontFace::Status newStatus)
                 continue;
             if (newStatus == CSSFontFace::Status::Success) {
                 if (pendingPromise->hasOneRef()) {
-                    pendingPromise->promise.resolve(pendingPromise->faces);
+                    pendingPromise->promise->resolve(pendingPromise->faces);
                     pendingPromise->hasReachedTerminalState = true;
                 }
             } else {
                 ASSERT(newStatus == CSSFontFace::Status::Failure);
-                pendingPromise->promise.reject(NetworkError);
+                pendingPromise->promise->reject(NetworkError);
                 pendingPromise->hasReachedTerminalState = true;
             }
         }
index c57b211..8f4835f 100644 (file)
 
 #include "ActiveDOMObject.h"
 #include "CSSFontFaceSet.h"
-#include "DOMPromiseProxy.h"
 #include "EventTarget.h"
-#include "JSDOMPromiseDeferred.h"
 #include "SuspendableTaskQueue.h"
 
 namespace WebCore {
 
+template<typename IDLType> class DOMPromiseDeferred;
+template<typename IDLType> class DOMPromiseProxyWithResolveCallback;
+
 class DOMException;
 
 class FontFaceSet final : public RefCounted<FontFaceSet>, private CSSFontFaceSetClient, public EventTargetWithInlineData, private  ActiveDOMObject {
@@ -57,7 +58,7 @@ public:
     LoadStatus status() const;
 
     using ReadyPromise = DOMPromiseProxyWithResolveCallback<IDLInterface<FontFaceSet>>;
-    ReadyPromise& ready() { return m_readyPromise; }
+    ReadyPromise& ready() { return m_readyPromise.get(); }
     void didFirstLayout();
 
     CSSFontFaceSet& backing() { return m_backing; }
@@ -89,7 +90,7 @@ private:
 
     public:
         Vector<Ref<FontFace>> faces;
-        LoadPromise promise;
+        UniqueRef<LoadPromise> promise;
         bool hasReachedTerminalState { false };
     };
 
@@ -116,7 +117,7 @@ private:
 
     Ref<CSSFontFaceSet> m_backing;
     HashMap<RefPtr<FontFace>, Vector<Ref<PendingPromise>>> m_pendingPromises;
-    ReadyPromise m_readyPromise;
+    UniqueRef<ReadyPromise> m_readyPromise;
     UniqueRef<SuspendableTaskQueue> m_taskQueue;
     bool m_isFirstLayoutDone { true };
 };
index 769b16b..94582ef 100644 (file)
@@ -32,6 +32,7 @@
 #include "Element.h"
 #include "ElementTraversal.h"
 #include "JSCustomElementInterface.h"
+#include "JSDOMPromiseDeferred.h"
 #include "MathMLNames.h"
 #include "QualifiedName.h"
 #include "ShadowRoot.h"
index 69e06e7..15c056d 100644 (file)
@@ -27,6 +27,7 @@
 #include "DeviceOrientationOrMotionEvent.h"
 
 #include "Document.h"
+#include "JSDOMPromiseDeferred.h"
 
 namespace WebCore {
 
index 1bae681..7a30f3d 100644 (file)
 #pragma once
 
 #include "DeviceOrientationOrMotionPermissionState.h"
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 
 namespace WebCore {
 
 class Document;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 class DeviceOrientationOrMotionEvent {
 public:
 
index 121668b..0132e68 100644 (file)
@@ -34,6 +34,7 @@
 #include "JSEventTargetCustom.h"
 #include "PlatformMouseEvent.h"
 #include "RuntimeApplicationChecks.h"
+#include <JavaScriptCore/CallFrame.h>
 #include <wtf/IsoMallocInlines.h>
 
 namespace WebCore {
index d6bd1da..d1911b0 100644 (file)
 #include "PlatformTouchEventIOS.h"
 #endif
 
+namespace JSC {
+class ExecState;
+class JSValue;
+}
+
 namespace WebCore {
 
 class DataTransfer;
index 21d2d0c..9520b88 100644 (file)
 
 #include "AffineTransform.h"
 #include "CanvasBase.h"
+#include "ContextDestructionObserver.h"
 #include "EventTarget.h"
 #include "ExceptionOr.h"
 #include "ImageBuffer.h"
 #include "IntSize.h"
-#include "JSDOMPromiseDeferred.h"
 #include "ScriptWrappable.h"
 #include <wtf/Forward.h>
 #include <wtf/RefCounted.h>
index 6b0c7a3..2070d0e 100644 (file)
@@ -40,6 +40,7 @@
 #include "ImageBuffer.h"
 #include "ImageData.h"
 #include "IntRect.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSImageBitmap.h"
 #include "LayoutSize.h"
 #include "RenderElement.h"
index 9c3720f..9a1eeff 100644 (file)
@@ -25,7 +25,7 @@
 
 #pragma once
 
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include "ScriptWrappable.h"
 #include <wtf/RefCounted.h>
 
@@ -45,6 +45,8 @@ class ScriptExecutionContext;
 class TypedOMCSSImageValue;
 struct ImageBitmapOptions;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 class ImageBitmap final : public ScriptWrappable, public RefCounted<ImageBitmap> {
     WTF_MAKE_ISO_ALLOCATED(ImageBitmap);
 public:
index 1d72a75..6e939cb 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "CanvasRenderingContext.h"
 #include "ImageBitmap.h"
+#include "JSDOMPromiseDeferred.h"
 #include "WebGLRenderingContext.h"
 #include <wtf/IsoMallocInlines.h>
 
index 57a6f37..af75fcc 100644 (file)
 
 #include "AffineTransform.h"
 #include "CanvasBase.h"
+#include "ContextDestructionObserver.h"
 #include "EventTarget.h"
 #include "ExceptionOr.h"
+#include "IDLTypes.h"
 #include "IntSize.h"
-#include "JSDOMPromiseDeferred.h"
 #include "ScriptWrappable.h"
 #include <wtf/Forward.h>
 #include <wtf/RefCounted.h>
index 3b850fc..a8342e1 100644 (file)
@@ -38,6 +38,7 @@
 #include "HTMLObjectElement.h"
 #include "HTMLParserIdioms.h"
 #include "InspectorInstrumentation.h"
+#include "JSDOMPromiseDeferred.h"
 #include "Page.h"
 #include "RenderImage.h"
 #include "RenderSVGImage.h"
index 487ece6..1622992 100644 (file)
 
 #include "CachedImageClient.h"
 #include "CachedResourceHandle.h"
-#include "JSDOMPromiseDeferred.h"
 #include "Timer.h"
 #include <wtf/Vector.h>
 #include <wtf/text/AtomString.h>
 
 namespace WebCore {
 
+class DeferredPromise;
 class Element;
 class ImageLoader;
 class RenderImageResource;
index ab96856..df47d8e 100644 (file)
@@ -69,6 +69,7 @@
 #include "HTTPParsers.h"
 #include "History.h"
 #include "InspectorInstrumentation.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSDOMWindowBase.h"
 #include "JSExecState.h"
 #include "Location.h"
index 050142d..38daba7 100644 (file)
@@ -20,7 +20,6 @@
 #pragma once
 
 #include "DOMWindowProperty.h"
-#include "JSDOMPromiseDeferred.h"
 #include "NavigatorBase.h"
 #include "ScriptWrappable.h"
 #include "ShareData.h"
@@ -29,6 +28,7 @@
 
 namespace WebCore {
 
+class DeferredPromise;
 class DOMMimeTypeArray;
 class DOMPluginArray;
 
index 6f2b138..cc0c21f 100644 (file)
@@ -67,6 +67,7 @@
 #include <JavaScriptCore/ScriptArguments.h>
 #include <JavaScriptCore/ScriptCallStack.h>
 #include <JavaScriptCore/ScriptCallStackFactory.h>
+#include <JavaScriptCore/StrongInlines.h>
 #include <wtf/text/WTFString.h>
 
 #if ENABLE(WEBGL)
index 6f7d09a..fd51bc4 100644 (file)
@@ -37,6 +37,7 @@
 #include "ImageBitmap.h"
 #include "ImageBuffer.h"
 #include "JSCSSPaintCallback.h"
+#include "JSDOMExceptionHandling.h"
 #include "PaintRenderingContext2D.h"
 #include "RenderElement.h"
 #include "StylePropertyMap.h"
index 584206f..1807870 100644 (file)
 #include "InstrumentingAgents.h"
 #include "IntRect.h"
 #include "InternalSettings.h"
+#include "JSDOMPromiseDeferred.h"
 #include "JSImageData.h"
 #include "LibWebRTCProvider.h"
 #include "LoaderStrategy.h"
@@ -4787,7 +4788,7 @@ void Internals::observeMediaStreamTrack(MediaStreamTrack& track)
 
 void Internals::grabNextMediaStreamTrackFrame(TrackFramePromise&& promise)
 {
-    m_nextTrackFramePromise = WTFMove(promise);
+    m_nextTrackFramePromise = WTF::makeUnique<TrackFramePromise>(promise);
 }
 
 void Internals::videoSampleAvailable(MediaSample& sample)
@@ -4809,7 +4810,7 @@ void Internals::videoSampleAvailable(MediaSample& sample)
         m_nextTrackFramePromise->resolve(imageData.releaseReturnValue().releaseNonNull());
     else
         m_nextTrackFramePromise->reject(imageData.exception().code());
-    m_nextTrackFramePromise = WTF::nullopt;
+    m_nextTrackFramePromise = nullptr;
 }
 
 void Internals::delayMediaStreamTrackSamples(MediaStreamTrack& track, float delay)
index 5870de4..816595c 100644 (file)
@@ -31,7 +31,7 @@
 #include "Cookie.h"
 #include "ExceptionOr.h"
 #include "HEVCUtilities.h"
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include "OrientationNotifier.h"
 #include "PageConsoleClient.h"
 #include "RealtimeMediaSource.h"
@@ -96,8 +96,10 @@ class StringCallback;
 class StyleSheet;
 class TimeRanges;
 class TypeConversions;
+class UnsuspendableActiveDOMObject;
 class VoidCallback;
 class WebGLRenderingContext;
+class WindowProxy;
 class XMLHttpRequest;
 
 #if ENABLE(VIDEO_TRACK)
@@ -108,7 +110,7 @@ class TextTrackCueGeneric;
 class ServiceWorker;
 #endif
 
-class UnsuspendableActiveDOMObject;
+template<typename IDLType> class DOMPromiseDeferred;
 
 class Internals final : public RefCounted<Internals>, private ContextDestructionObserver
 #if ENABLE(MEDIA_STREAM)
@@ -898,7 +900,7 @@ private:
     unsigned long m_trackVideoSampleCount { 0 };
     unsigned long m_trackAudioSampleCount { 0 };
     RefPtr<MediaStreamTrack> m_track;
-    Optional<TrackFramePromise> m_nextTrackFramePromise;
+    std::unique_ptr<TrackFramePromise> m_nextTrackFramePromise;
 #endif
 
     std::unique_ptr<InspectorStubFrontend> m_inspectorFrontend;
index 8939574..9348a0c 100644 (file)
@@ -27,7 +27,7 @@
 
 #if ENABLE(SERVICE_WORKER)
 
-#include "JSDOMPromiseDeferred.h"
+#include "IDLTypes.h"
 #include "ServiceWorkerIdentifier.h"
 #include <wtf/RefCounted.h>
 
@@ -37,6 +37,8 @@ class FetchEvent;
 class FetchResponse;
 class ScriptExecutionContext;
 
+template<typename IDLType> class DOMPromiseDeferred;
+
 class WEBCORE_TESTSUPPORT_EXPORT ServiceWorkerInternals : public RefCounted<ServiceWorkerInternals> {
 public:
     static Ref<ServiceWorkerInternals> create(ServiceWorkerIdentifier identifier) { return adoptRef(*new ServiceWorkerInternals { identifier }); }
index 0d6d01d..fe9b1d1 100644 (file)
@@ -30,6 +30,7 @@
 
 #if PLATFORM(MAC)
 
+#import "JSDOMPromiseDeferred.h"
 #import <pal/spi/cocoa/LaunchServicesSPI.h>
 
 namespace WebCore {
index 7211eb6..6d807eb 100644 (file)
@@ -28,6 +28,7 @@
 
 #if ENABLE(SERVICE_WORKER)
 
+#include "DOMPromiseProxy.h"
 #include "Document.h"
 #include "Event.h"
 #include "EventNames.h"
index 75ea953..2e0d9d0 100644 (file)
@@ -28,9 +28,9 @@
 #if ENABLE(SERVICE_WORKER)
 
 #include "ActiveDOMObject.h"
-#include "DOMPromiseProxy.h"
 #include "EventTarget.h"
 #include "GenericEventQueue.h"
+#include "IDLTypes.h"
 #include "SWClientConnection.h"
 #include "SWServer.h"
 #include "ServiceWorkerJobClient.h"
@@ -48,6 +48,8 @@ class ServiceWorker;
 enum class ServiceWorkerUpdateViaCache : uint8_t;
 enum class WorkerType;
 
+template<typename IDLType> class DOMPromiseProxy;
+
 class ServiceWorkerContainer final : public EventTargetWithInlineData, public ActiveDOMObject, public ServiceWorkerJobClient {
     WTF_MAKE_NONCOPYABLE(ServiceWorkerContainer);
     WTF_MAKE_ISO_ALLOCATED(ServiceWorkerContainer);
index 71965fd..c6d2a28 100644 (file)
@@ -53,6 +53,11 @@ ServiceWorkerJob::~ServiceWorkerJob()
     ASSERT(m_creationThread.ptr() == &Thread::current());
 }
 
+RefPtr<DeferredPromise> ServiceWorkerJob::takePromise()
+{
+    return WTFMove(m_promise);
+}
+
 void ServiceWorkerJob::failedWithException(const Exception& exception)
 {
     ASSERT(m_creationThread.ptr() == &Thread::current());
index b55ab95..7dbb7d3 100644 (file)
@@ -27,7 +27,6 @@
 
 #if ENABLE(SERVICE_WORKER)
 
-#include "JSDOMPromiseDeferred.h"
 #include "ResourceResponse.h"
 #include "ServiceWorkerJobClient.h"
 #include "ServiceWorkerJobData.h"
@@ -63,7 +62,7 @@ public:
 
     const ServiceWorkerJobData& data() const { return m_jobData; }
     bool hasPromise() const { return !!m_promise; }
-    RefPtr<DeferredPromise> takePromise() { return WTFMove(m_promise); }
+    RefPtr<DeferredPromise> takePromise();
 
     void fetchScriptWithContext(ScriptExecutionContext&, FetchOptions::Cache);
 
index e190307..4d3bc6f 100644 (file)
@@ -31,6 +31,7 @@
 #include "Document.h"
 #include "Event.h"
 #include "EventNames.h"
+#include "JSDOMPromiseDeferred.h"
 #include "Logging.h"
 #include "ServiceWorker.h"
 #include "ServiceWorkerContainer.h"
index 012a77d..052665c 100644 (file)
 
 #include "ActiveDOMObject.h"
 #include "EventTarget.h"
-#include "JSDOMPromiseDeferred.h"
 #include "SWClientConnection.h"
 #include "ServiceWorkerRegistrationData.h"
 #include "Timer.h"
 
 namespace WebCore {
 
+class DeferredPromise;
 class ScriptExecutionContext;
 class ServiceWorker;
 class ServiceWorkerContainer;
index 658a392..26b9af9 100644 (file)
@@ -31,8 +31,7 @@
 #include "DOMWindow.h"
 #include "Document.h"
 #include "JSCSSPaintCallback.h"
-#include "JSDOMConvertCallbacks.h"
-#include "JSDOMConvertSequences.h"
+#include "JSDOMConvert.h"
 #include "RenderView.h"
 #include <wtf/IsoMallocInlines.h>
 #include <wtf/SetForScope.h>