WebKit Bugzilla
Attachment 339563 Details for
Bug 185274
: Allow WebResourceLoader to cancel a load served from a service worker
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185274-20180504103013.patch (text/plain), 62.33 KB, created by
youenn fablet
on 2018-05-04 10:30:14 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-05-04 10:30:14 PDT
Size:
62.33 KB
patch
obsolete
>Subversion Revision: 231318 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 8ae0fcab720717762c4e3d993c5e2db17d14847b..06279fb136ae89953b6b08217733fbc9271250be 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2018-05-03 Youenn Fablet <youenn@apple.com> >+ >+ Allow WebResourceLoader to cancel a load served from a service worker >+ https://bugs.webkit.org/show_bug.cgi?id=185274 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add support for cancelling a fetch from WebProcess to service worker process. >+ Use FetchIdentifier instead of uint64_t. >+ >+ * Modules/fetch/FetchIdentifier.h: Added. >+ * WebCore.xcodeproj/project.pbxproj: >+ * workers/service/context/ServiceWorkerFetch.h: >+ * workers/service/context/ServiceWorkerThreadProxy.cpp: >+ (WebCore::ServiceWorkerThreadProxy::startFetch): >+ (WebCore::ServiceWorkerThreadProxy::cancelFetch): >+ * workers/service/context/ServiceWorkerThreadProxy.h: >+ > 2018-05-03 Youenn Fablet <youenn@apple.com> > > PeerConnection should have its connectionState closed even if doing gathering >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index a48a7c759a587e4b8465847c515856b060ee8fc3..088aba27778f94dc1d41db097209bde684be6b69 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,65 @@ >+2018-05-03 Youenn Fablet <youenn@apple.com> >+ >+ Allow WebResourceLoader to cancel a load served from a service worker >+ https://bugs.webkit.org/show_bug.cgi?id=185274 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Use FetchIdentifier instead of uint64_t. >+ Add IPC support for cancelling a fetch from WebProcess to service worker process. >+ Ask service worker process to cancel the fetch when its corresponding WebResourceLoader is cancelled. >+ No change of behavior as once a WebResourceLoader is cancelled, any related IPC is not processed. >+ A follow-up patch should try to cancel the FetchResponse load, meaning to either cancel the network load >+ or to abort reading the readable stream. >+ >+ * Scripts/webkit/messages.py: >+ * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: >+ (WebKit::WebSWServerConnection::cancelFetch): >+ (WebKit::WebSWServerConnection::startFetch): >+ (WebKit::WebSWServerConnection::didReceiveFetchResponse): >+ (WebKit::WebSWServerConnection::didReceiveFetchData): >+ (WebKit::WebSWServerConnection::didReceiveFetchFormData): >+ (WebKit::WebSWServerConnection::didFinishFetch): >+ (WebKit::WebSWServerConnection::didFailFetch): >+ (WebKit::WebSWServerConnection::didNotHandleFetch): >+ * StorageProcess/ServiceWorker/WebSWServerConnection.h: >+ * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: >+ * StorageProcess/StorageProcess.cpp: >+ (WebKit::StorageProcess::didFailFetch): >+ (WebKit::StorageProcess::didNotHandleFetch): >+ (WebKit::StorageProcess::didReceiveFetchResponse): >+ (WebKit::StorageProcess::didReceiveFetchData): >+ (WebKit::StorageProcess::didReceiveFetchFormData): >+ (WebKit::StorageProcess::didFinishFetch): >+ * StorageProcess/StorageProcess.h: >+ * StorageProcess/StorageProcess.messages.in: >+ * WebProcess/Network/WebLoaderStrategy.cpp: >+ (WebKit::WebLoaderStrategy::remove): >+ * WebProcess/Storage/ServiceWorkerClientFetch.cpp: >+ (WebKit::ServiceWorkerClientFetch::create): >+ (WebKit::ServiceWorkerClientFetch::ServiceWorkerClientFetch): >+ (WebKit::ServiceWorkerClientFetch::start): >+ (WebKit::ServiceWorkerClientFetch::cancel): >+ * WebProcess/Storage/ServiceWorkerClientFetch.h: >+ * WebProcess/Storage/WebSWClientConnection.cpp: >+ (WebKit::WebSWClientConnection::startFetch): >+ (WebKit::WebSWClientConnection::cancelFetch): >+ * WebProcess/Storage/WebSWClientConnection.h: >+ * WebProcess/Storage/WebSWContextManagerConnection.cpp: >+ (WebKit::WebSWContextManagerConnection::cancelFetch): >+ (WebKit::WebSWContextManagerConnection::startFetch): >+ * WebProcess/Storage/WebSWContextManagerConnection.h: >+ * WebProcess/Storage/WebSWContextManagerConnection.messages.in: >+ * WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp: >+ (WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient): >+ (WebKit::WebServiceWorkerFetchTaskClient::cancel): >+ * WebProcess/Storage/WebServiceWorkerFetchTaskClient.h: >+ * WebProcess/Storage/WebServiceWorkerProvider.cpp: >+ (WebKit::WebServiceWorkerProvider::handleFetch): >+ (WebKit::WebServiceWorkerProvider::cancelFetch): >+ (WebKit::WebServiceWorkerProvider::fetchFinished): >+ * WebProcess/Storage/WebServiceWorkerProvider.h: >+ > 2018-05-03 Commit Queue <commit-queue@webkit.org> > > Unreviewed, rolling out r231223 and r231288. >diff --git a/Source/WebCore/Modules/fetch/FetchIdentifier.h b/Source/WebCore/Modules/fetch/FetchIdentifier.h >new file mode 100644 >index 0000000000000000000000000000000000000000..b5979e9f298186d166cc6eaba561d322b0e74fd5 >--- /dev/null >+++ b/Source/WebCore/Modules/fetch/FetchIdentifier.h >@@ -0,0 +1,35 @@ >+/* >+ * 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 <wtf/ObjectIdentifier.h> >+ >+namespace WebCore { >+ >+enum FetchIdentifierType { }; >+using FetchIdentifier = ObjectIdentifier<FetchIdentifierType>; >+ >+} >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index bf68d47ec2065e9281e45126b44db6a43cf3f91c..9454beb42b1a87c0f5166e2314d3b0d7794b4dab 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -1072,6 +1072,7 @@ > 4161E2D51FE48DC500EC2E96 /* FetchLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 4147E2B51C89912600A7E715 /* FetchLoader.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 4162A451101145AE00DFF3ED /* DedicatedWorkerGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 4162A44E101145AE00DFF3ED /* DedicatedWorkerGlobalScope.h */; }; > 4162A4581011464700DFF3ED /* JSDedicatedWorkerGlobalScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 4162A4561011464700DFF3ED /* JSDedicatedWorkerGlobalScope.h */; }; >+ 416E0B3A209BC3CB004A95D9 /* FetchIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 416E0B37209BC3C2004A95D9 /* FetchIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 416E29A6102FA962007FC14E /* WorkerReportingProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 416E29A5102FA962007FC14E /* WorkerReportingProxy.h */; }; > 416E6FE81BBD12DF000A3F64 /* ReadableStreamInternalsBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764D9 /* ReadableStreamInternalsBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 416E6FE81BBD12DF000A3F65 /* JSDOMBindingInternalsBuiltins.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B03D8061BB3110D00B764DA /* JSDOMBindingInternalsBuiltins.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -7198,6 +7199,7 @@ > 4162A44F101145AE00DFF3ED /* DedicatedWorkerGlobalScope.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DedicatedWorkerGlobalScope.idl; sourceTree = "<group>"; }; > 4162A4551011464700DFF3ED /* JSDedicatedWorkerGlobalScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDedicatedWorkerGlobalScope.cpp; sourceTree = "<group>"; }; > 4162A4561011464700DFF3ED /* JSDedicatedWorkerGlobalScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDedicatedWorkerGlobalScope.h; sourceTree = "<group>"; }; >+ 416E0B37209BC3C2004A95D9 /* FetchIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FetchIdentifier.h; sourceTree = "<group>"; }; > 416E29A5102FA962007FC14E /* WorkerReportingProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WorkerReportingProxy.h; sourceTree = "<group>"; }; > 4170A2E91D8C0CC000318452 /* JSDOMWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSDOMWrapper.cpp; sourceTree = "<group>"; }; > 417253A81354BBBC00360F2A /* MediaControlElements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaControlElements.cpp; sourceTree = "<group>"; }; >@@ -16987,6 +16989,7 @@ > 41F54F821C50C4F600338488 /* FetchHeaders.cpp */, > 41F54F831C50C4F600338488 /* FetchHeaders.h */, > 41F54F841C50C4F600338488 /* FetchHeaders.idl */, >+ 416E0B37209BC3C2004A95D9 /* FetchIdentifier.h */, > 4147E2B41C89912600A7E715 /* FetchLoader.cpp */, > 4147E2B51C89912600A7E715 /* FetchLoader.h */, > 4147E2B61C89912600A7E715 /* FetchLoaderClient.h */, >@@ -26953,6 +26956,7 @@ > 31DCD29D1AB4FBDE0072E817 /* AnimationTrigger.h in Headers */, > 0F580FAF149800D400FB5BD8 /* AnimationUtilities.h in Headers */, > 93309DD7099E64920056E581 /* AppendNodeCommand.h in Headers */, >+ 416E0B3A209BC3CB004A95D9 /* FetchIdentifier.h in Headers */, > A1DF5A941F7EC4320058A477 /* ApplePayContactField.h in Headers */, > A12C59EE2035FC9B0012236B /* ApplePayError.h in Headers */, > 7C6579E31E00827000E3A27A /* ApplePayLineItem.h in Headers */, >diff --git a/Source/WebCore/workers/service/context/ServiceWorkerFetch.h b/Source/WebCore/workers/service/context/ServiceWorkerFetch.h >index 7c06c8367fe0621459ec76c04f983a01b3f95bd5..c540388b45d7c45387b1442bbfb02fa0e9182549 100644 >--- a/Source/WebCore/workers/service/context/ServiceWorkerFetch.h >+++ b/Source/WebCore/workers/service/context/ServiceWorkerFetch.h >@@ -53,6 +53,7 @@ public: > virtual void didFail() = 0; > virtual void didFinish() = 0; > virtual void didNotHandle() = 0; >+ virtual void cancel() = 0; > }; > > void dispatchFetchEvent(Ref<Client>&&, ServiceWorkerGlobalScope&, std::optional<ServiceWorkerClientIdentifier>, ResourceRequest&&, String&& referrer, FetchOptions&&); >diff --git a/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp b/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp >index 89467f3efc8a175937cbd623377c64c9d14184d5..f0e1e7e563620ba55d0cff0ad9a0d72531781536 100644 >--- a/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp >+++ b/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.cpp >@@ -185,6 +185,30 @@ void ServiceWorkerThreadProxy::notifyNetworkStateChange(bool isOnline) > }, WorkerRunLoop::defaultMode()); > } > >+void ServiceWorkerThreadProxy::startFetch(SWServerConnectionIdentifier connectionIdentifier, FetchIdentifier fetchIdentifier, Ref<ServiceWorkerFetch::Client>&& client, std::optional<ServiceWorkerClientIdentifier>&& clientId, ResourceRequest&& request, String&& referrer, FetchOptions&& options) >+{ >+ auto key = std::make_pair(connectionIdentifier, fetchIdentifier); >+ >+ ASSERT(!m_fetches.contains(key)); >+ m_fetches.add(key, client.copyRef()); >+ thread().postFetchTask(WTFMove(client), WTFMove(clientId), WTFMove(request), WTFMove(referrer), WTFMove(options)); >+} >+ >+void ServiceWorkerThreadProxy::cancelFetch(SWServerConnectionIdentifier connectionIdentifier, FetchIdentifier fetchIdentifier) >+{ >+ auto iterator = m_fetches.find(std::make_pair(connectionIdentifier, fetchIdentifier)); >+ if (iterator == m_fetches.end()) >+ return; >+ iterator->value->cancel(); >+ m_fetches.remove(iterator); >+ >+} >+ >+void ServiceWorkerThreadProxy::removeFetch(SWServerConnectionIdentifier connectionIdentifier, FetchIdentifier fetchIdentifier) >+{ >+ m_fetches.remove(std::make_pair(connectionIdentifier, fetchIdentifier)); >+} >+ > } // namespace WebCore > > #endif // ENABLE(SERVICE_WORKER) >diff --git a/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h b/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h >index 6edcc0337b7a2d14dd32043c9f970cd14e236772..e723cac0a30aa145fc8aa7796f7d5391f95c34c6 100644 >--- a/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h >+++ b/Source/WebCore/workers/service/context/ServiceWorkerThreadProxy.h >@@ -29,6 +29,7 @@ > > #include "CacheStorageConnection.h" > #include "Document.h" >+#include "FetchIdentifier.h" > #include "Page.h" > #include "SecurityOrigin.h" > #include "ServiceWorkerDebuggable.h" >@@ -70,6 +71,10 @@ public: > // Public only for testing purposes. > WEBCORE_TESTSUPPORT_EXPORT void notifyNetworkStateChange(bool isOnline); > >+ WEBCORE_EXPORT void startFetch(SWServerConnectionIdentifier, FetchIdentifier, Ref<ServiceWorkerFetch::Client>&&, std::optional<ServiceWorkerClientIdentifier>&&, ResourceRequest&&, String&& referrer, FetchOptions&&); >+ WEBCORE_EXPORT void cancelFetch(SWServerConnectionIdentifier, FetchIdentifier); >+ WEBCORE_EXPORT void removeFetch(SWServerConnectionIdentifier, FetchIdentifier); >+ > private: > WEBCORE_EXPORT ServiceWorkerThreadProxy(PageConfiguration&&, const ServiceWorkerContextData&, PAL::SessionID, String&& userAgent, CacheStorageProvider&, SecurityOrigin::StorageBlockingPolicy); > >@@ -96,6 +101,7 @@ private: > #if ENABLE(REMOTE_INSPECTOR) > std::unique_ptr<ServiceWorkerDebuggable> m_remoteDebuggable; > #endif >+ HashMap<std::pair<SWServerConnectionIdentifier, FetchIdentifier>, Ref<ServiceWorkerFetch::Client>> m_fetches; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/Scripts/webkit/messages.py b/Source/WebKit/Scripts/webkit/messages.py >index 3ca1ff73f5f57e6a787977c627f54d1814267074..31b280a73823d3a4320a6d865b16a2652e0dcbec 100644 >--- a/Source/WebKit/Scripts/webkit/messages.py >+++ b/Source/WebKit/Scripts/webkit/messages.py >@@ -189,6 +189,7 @@ def forward_declarations_and_headers(receiver): > 'MachSendRight', > 'String', > 'WebCore::DocumentIdentifier', >+ 'WebCore::FetchIdentifier', > 'WebCore::ServiceWorkerIdentifier', > 'WebCore::ServiceWorkerJobIdentifier', > 'WebCore::ServiceWorkerOrClientData', >diff --git a/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp b/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp >index 38c3991eefd1aeebec5572f9081ac4da16da6e38..a3a44217f34ada6f2dcecc7c4e11223855d5eff4 100644 >--- a/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp >+++ b/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp >@@ -131,12 +131,25 @@ void WebSWServerConnection::updateWorkerStateInClient(ServiceWorkerIdentifier wo > send(Messages::WebSWClientConnection::UpdateWorkerState(worker, state)); > } > >-void WebSWServerConnection::startFetch(uint64_t fetchIdentifier, ServiceWorkerRegistrationIdentifier serviceWorkerRegistrationIdentifier, ResourceRequest&& request, FetchOptions&& options, IPC::FormDataReference&& formData, String&& referrer) >+void WebSWServerConnection::cancelFetch(ServiceWorkerRegistrationIdentifier serviceWorkerRegistrationIdentifier, FetchIdentifier fetchIdentifier) >+{ >+ auto* worker = server().activeWorkerFromRegistrationID(serviceWorkerRegistrationIdentifier); >+ if (!worker || !worker->isRunning()) >+ return; >+ >+ auto serviceWorkerIdentifier = worker->identifier(); >+ server().runServiceWorkerIfNecessary(serviceWorkerIdentifier, [weakThis = makeWeakPtr(this), this, serviceWorkerIdentifier, fetchIdentifier](auto* contextConnection) mutable { >+ if (weakThis && contextConnection) >+ sendToContextProcess(*contextConnection, Messages::WebSWContextManagerConnection::CancelFetch { this->identifier(), serviceWorkerIdentifier, fetchIdentifier }); >+ }); >+} >+ >+void WebSWServerConnection::startFetch(ServiceWorkerRegistrationIdentifier serviceWorkerRegistrationIdentifier, FetchIdentifier fetchIdentifier, ResourceRequest&& request, FetchOptions&& options, IPC::FormDataReference&& formData, String&& referrer) > { > auto* worker = server().activeWorkerFromRegistrationID(serviceWorkerRegistrationIdentifier); > if (!worker) { >- SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED("startFetch: fetchIdentifier: %" PRIu64 " -> DidNotHandle because no active worker", fetchIdentifier); >- m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier); >+ SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED("startFetch: fetchIdentifier: %" PRIu64 " -> DidNotHandle because no active worker", fetchIdentifier.toUInt64()); >+ m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier.toUInt64()); > return; > } > auto serviceWorkerIdentifier = worker->identifier(); >@@ -146,14 +159,14 @@ void WebSWServerConnection::startFetch(uint64_t fetchIdentifier, ServiceWorkerRe > return; > > if (!success) { >- SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED("startFetch: fetchIdentifier: %" PRIu64 " -> DidNotHandle because worker did not become activated", fetchIdentifier); >- m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier); >+ SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED("startFetch: fetchIdentifier: %" PRIu64 " -> DidNotHandle because worker did not become activated", fetchIdentifier.toUInt64()); >+ m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier.toUInt64()); > return; > } > > auto* worker = server().workerByID(serviceWorkerIdentifier); > if (!worker) { >- m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier); >+ m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier.toUInt64()); > return; > } > >@@ -165,11 +178,11 @@ void WebSWServerConnection::startFetch(uint64_t fetchIdentifier, ServiceWorkerRe > return; > > if (contextConnection) { >- SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("startFetch: Starting fetch %" PRIu64 " via service worker %" PRIu64, fetchIdentifier, serviceWorkerIdentifier.toUInt64()); >- sendToContextProcess(*contextConnection, Messages::WebSWContextManagerConnection::StartFetch { this->identifier(), fetchIdentifier, serviceWorkerIdentifier, request, options, formData, referrer }); >+ SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("startFetch: Starting fetch %" PRIu64 " via service worker %" PRIu64, fetchIdentifier.toUInt64(), serviceWorkerIdentifier.toUInt64()); >+ sendToContextProcess(*contextConnection, Messages::WebSWContextManagerConnection::StartFetch { this->identifier(), serviceWorkerIdentifier, fetchIdentifier, request, options, formData, referrer }); > } else { >- SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED("startFetch: fetchIdentifier: %" PRIu64 " -> DidNotHandle because failed to run service worker", fetchIdentifier); >- m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier); >+ SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED("startFetch: fetchIdentifier: %" PRIu64 " -> DidNotHandle because failed to run service worker", fetchIdentifier.toUInt64()); >+ m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier.toUInt64()); > } > }); > }; >@@ -222,38 +235,37 @@ void WebSWServerConnection::scheduleJobInServer(ServiceWorkerJobData&& jobData) > server().scheduleJob(WTFMove(jobData)); > } > >- >-void WebSWServerConnection::didReceiveFetchResponse(uint64_t fetchIdentifier, const ResourceResponse& response) >+void WebSWServerConnection::didReceiveFetchResponse(FetchIdentifier fetchIdentifier, const ResourceResponse& response) > { >- m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidReceiveResponse { response }, fetchIdentifier); >+ m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidReceiveResponse { response }, fetchIdentifier.toUInt64()); > } > >-void WebSWServerConnection::didReceiveFetchData(uint64_t fetchIdentifier, const IPC::DataReference& data, int64_t encodedDataLength) >+void WebSWServerConnection::didReceiveFetchData(FetchIdentifier fetchIdentifier, const IPC::DataReference& data, int64_t encodedDataLength) > { >- m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidReceiveData { data, encodedDataLength }, fetchIdentifier); >+ m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidReceiveData { data, encodedDataLength }, fetchIdentifier.toUInt64()); > } > >-void WebSWServerConnection::didReceiveFetchFormData(uint64_t fetchIdentifier, const IPC::FormDataReference& formData) >+void WebSWServerConnection::didReceiveFetchFormData(FetchIdentifier fetchIdentifier, const IPC::FormDataReference& formData) > { >- m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidReceiveFormData { formData }, fetchIdentifier); >+ m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidReceiveFormData { formData }, fetchIdentifier.toUInt64()); > } > >-void WebSWServerConnection::didFinishFetch(uint64_t fetchIdentifier) >+void WebSWServerConnection::didFinishFetch(FetchIdentifier fetchIdentifier) > { >- SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("didFinishFetch: fetchIdentifier: %" PRIu64, fetchIdentifier); >- m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidFinish { }, fetchIdentifier); >+ SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("didFinishFetch: fetchIdentifier: %" PRIu64, fetchIdentifier.toUInt64()); >+ m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidFinish { }, fetchIdentifier.toUInt64()); > } > >-void WebSWServerConnection::didFailFetch(uint64_t fetchIdentifier) >+void WebSWServerConnection::didFailFetch(FetchIdentifier fetchIdentifier) > { >- SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED("didFailFetch: fetchIdentifier: %" PRIu64, fetchIdentifier); >- m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidFail { }, fetchIdentifier); >+ SWSERVERCONNECTION_RELEASE_LOG_ERROR_IF_ALLOWED("didFailFetch: fetchIdentifier: %" PRIu64, fetchIdentifier.toUInt64()); >+ m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidFail { }, fetchIdentifier.toUInt64()); > } > >-void WebSWServerConnection::didNotHandleFetch(uint64_t fetchIdentifier) >+void WebSWServerConnection::didNotHandleFetch(FetchIdentifier fetchIdentifier) > { >- SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("didNotHandleFetch: fetchIdentifier: %" PRIu64, fetchIdentifier); >- m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier); >+ SWSERVERCONNECTION_RELEASE_LOG_IF_ALLOWED("didNotHandleFetch: fetchIdentifier: %" PRIu64, fetchIdentifier.toUInt64()); >+ m_contentConnection->send(Messages::ServiceWorkerClientFetch::DidNotHandle { }, fetchIdentifier.toUInt64()); > } > > void WebSWServerConnection::postMessageToServiceWorkerClient(DocumentIdentifier destinationContextIdentifier, MessageWithMessagePorts&& message, ServiceWorkerIdentifier sourceIdentifier, const String& sourceOrigin) >diff --git a/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h b/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h >index 726d02e676d35b4ae26af02f930e8659ff25c54d..f4ccb6b99181cc5f5d53a1baaa274a43c301b243 100644 >--- a/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h >+++ b/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h >@@ -29,6 +29,7 @@ > > #include "MessageReceiver.h" > #include "MessageSender.h" >+#include <WebCore/FetchIdentifier.h> > #include <WebCore/SWServer.h> > #include <pal/SessionID.h> > #include <wtf/HashMap.h> >@@ -61,12 +62,12 @@ public: > > PAL::SessionID sessionID() const { return m_sessionID; } > >- void didReceiveFetchResponse(uint64_t fetchIdentifier, const WebCore::ResourceResponse&); >- void didReceiveFetchData(uint64_t fetchIdentifier, const IPC::DataReference&, int64_t encodedDataLength); >- void didReceiveFetchFormData(uint64_t fetchIdentifier, const IPC::FormDataReference&); >- void didFinishFetch(uint64_t fetchIdentifier); >- void didFailFetch(uint64_t fetchIdentifier); >- void didNotHandleFetch(uint64_t fetchIdentifier); >+ void didReceiveFetchResponse(WebCore::FetchIdentifier, const WebCore::ResourceResponse&); >+ void didReceiveFetchData(WebCore::FetchIdentifier, const IPC::DataReference&, int64_t encodedDataLength); >+ void didReceiveFetchFormData(WebCore::FetchIdentifier, const IPC::FormDataReference&); >+ void didFinishFetch(WebCore::FetchIdentifier); >+ void didFailFetch(WebCore::FetchIdentifier); >+ void didNotHandleFetch(WebCore::FetchIdentifier); > > void postMessageToServiceWorkerClient(WebCore::DocumentIdentifier destinationContextIdentifier, WebCore::MessageWithMessagePorts&&, WebCore::ServiceWorkerIdentifier sourceServiceWorkerIdentifier, const String& sourceOrigin); > void postMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, WebCore::MessageWithMessagePorts&&, const WebCore::ServiceWorkerOrClientIdentifier& source); >@@ -87,7 +88,8 @@ private: > > void scheduleJobInServer(WebCore::ServiceWorkerJobData&&); > >- void startFetch(uint64_t fetchIdentifier, WebCore::ServiceWorkerRegistrationIdentifier, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&, String&& referrer); >+ void startFetch(WebCore::ServiceWorkerRegistrationIdentifier, WebCore::FetchIdentifier, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&, String&& referrer); >+ void cancelFetch(WebCore::ServiceWorkerRegistrationIdentifier, WebCore::FetchIdentifier); > > void matchRegistration(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const WebCore::URL& clientURL); > void getRegistrations(uint64_t registrationMatchRequestIdentifier, const WebCore::SecurityOriginData& topOrigin, const WebCore::URL& clientURL); >diff --git a/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in b/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in >index e1b3d01da4d3ea545cc5e2429b483777c849d33f..06195b8ad194618cdff6ffe9d575e9f3a444a7ed 100644 >--- a/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in >+++ b/Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in >@@ -29,7 +29,8 @@ messages -> WebSWServerConnection { > AddServiceWorkerRegistrationInServer(WebCore::ServiceWorkerRegistrationIdentifier identifier) > RemoveServiceWorkerRegistrationInServer(WebCore::ServiceWorkerRegistrationIdentifier identifier) > >- StartFetch(uint64_t identifier, WebCore::ServiceWorkerRegistrationIdentifier serviceWorkerRegistrationIdentifier, WebCore::ResourceRequest request, struct WebCore::FetchOptions options, IPC::FormDataReference requestBody, String referrer) >+ StartFetch(WebCore::ServiceWorkerRegistrationIdentifier serviceWorkerRegistrationIdentifier, WebCore::FetchIdentifier fetchIdentifier, WebCore::ResourceRequest request, struct WebCore::FetchOptions options, IPC::FormDataReference requestBody, String referrer) >+ CancelFetch(WebCore::ServiceWorkerRegistrationIdentifier serviceWorkerRegistrationIdentifier, WebCore::FetchIdentifier fetchIdentifier) > > PostMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, struct WebCore::MessageWithMessagePorts message, WebCore::ServiceWorkerOrClientIdentifier source) > >diff --git a/Source/WebKit/StorageProcess/StorageProcess.cpp b/Source/WebKit/StorageProcess/StorageProcess.cpp >index 9bbbbaac55217c49311cffadcc378aa5c3704233..48a5bf2cdf7df168e144390f83662acd7af20b45 100644 >--- a/Source/WebKit/StorageProcess/StorageProcess.cpp >+++ b/Source/WebKit/StorageProcess/StorageProcess.cpp >@@ -478,37 +478,37 @@ void StorageProcess::createServerToContextConnection(const SecurityOriginData& s > parentProcessConnection()->send(Messages::StorageProcessProxy::EstablishWorkerContextConnectionToStorageProcess(securityOrigin), 0); > } > >-void StorageProcess::didFailFetch(SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier) >+void StorageProcess::didFailFetch(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier) > { > if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier)) > connection->didFailFetch(fetchIdentifier); > } > >-void StorageProcess::didNotHandleFetch(SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier) >+void StorageProcess::didNotHandleFetch(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier) > { > if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier)) > connection->didNotHandleFetch(fetchIdentifier); > } > >-void StorageProcess::didReceiveFetchResponse(SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier, const WebCore::ResourceResponse& response) >+void StorageProcess::didReceiveFetchResponse(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier, const WebCore::ResourceResponse& response) > { > if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier)) > connection->didReceiveFetchResponse(fetchIdentifier, response); > } > >-void StorageProcess::didReceiveFetchData(SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier, const IPC::DataReference& data, int64_t encodedDataLength) >+void StorageProcess::didReceiveFetchData(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier, const IPC::DataReference& data, int64_t encodedDataLength) > { > if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier)) > connection->didReceiveFetchData(fetchIdentifier, data, encodedDataLength); > } > >-void StorageProcess::didReceiveFetchFormData(SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier, const IPC::FormDataReference& formData) >+void StorageProcess::didReceiveFetchFormData(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier, const IPC::FormDataReference& formData) > { > if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier)) > connection->didReceiveFetchFormData(fetchIdentifier, formData); > } > >-void StorageProcess::didFinishFetch(SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier) >+void StorageProcess::didFinishFetch(SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier) > { > if (auto* connection = m_swServerConnections.get(serverConnectionIdentifier)) > connection->didFinishFetch(fetchIdentifier); >diff --git a/Source/WebKit/StorageProcess/StorageProcess.h b/Source/WebKit/StorageProcess/StorageProcess.h >index 6010a9ef196b7baf5cb33877585a0d6c4051e019..fa43f41791ea634f1279a72d6e52c923721fca53 100644 >--- a/Source/WebKit/StorageProcess/StorageProcess.h >+++ b/Source/WebKit/StorageProcess/StorageProcess.h >@@ -27,6 +27,7 @@ > > #include "ChildProcess.h" > #include "SandboxExtension.h" >+#include <WebCore/FetchIdentifier.h> > #include <WebCore/IDBBackingStore.h> > #include <WebCore/IDBServer.h> > #include <WebCore/SecurityOriginData.h> >@@ -136,12 +137,12 @@ private: > void didGetSandboxExtensionsForBlobFiles(uint64_t requestID, SandboxExtension::HandleArray&&); > #endif > #if ENABLE(SERVICE_WORKER) >- void didReceiveFetchResponse(WebCore::SWServerConnectionIdentifier, uint64_t fetchIdentifier, const WebCore::ResourceResponse&); >- void didReceiveFetchData(WebCore::SWServerConnectionIdentifier, uint64_t fetchIdentifier, const IPC::DataReference&, int64_t encodedDataLength); >- void didReceiveFetchFormData(WebCore::SWServerConnectionIdentifier, uint64_t fetchIdentifier, const IPC::FormDataReference&); >- void didFinishFetch(WebCore::SWServerConnectionIdentifier, uint64_t fetchIdentifier); >- void didFailFetch(WebCore::SWServerConnectionIdentifier, uint64_t fetchIdentifier); >- void didNotHandleFetch(WebCore::SWServerConnectionIdentifier, uint64_t fetchIdentifier); >+ void didReceiveFetchResponse(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, const WebCore::ResourceResponse&); >+ void didReceiveFetchData(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, const IPC::DataReference&, int64_t encodedDataLength); >+ void didReceiveFetchFormData(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier, const IPC::FormDataReference&); >+ void didFinishFetch(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier); >+ void didFailFetch(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier); >+ void didNotHandleFetch(WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier); > > void postMessageToServiceWorkerClient(const WebCore::ServiceWorkerClientIdentifier& destinationIdentifier, WebCore::MessageWithMessagePorts&&, WebCore::ServiceWorkerIdentifier sourceIdentifier, const String& sourceOrigin); > void postMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, WebCore::MessageWithMessagePorts&&, const WebCore::ServiceWorkerOrClientIdentifier& source, WebCore::SWServerConnectionIdentifier); >diff --git a/Source/WebKit/StorageProcess/StorageProcess.messages.in b/Source/WebKit/StorageProcess/StorageProcess.messages.in >index 81d1930e4a147a345057f195d4008d794e995369..56aa746f7ebb7a7496391d3edc34f78456345396 100644 >--- a/Source/WebKit/StorageProcess/StorageProcess.messages.in >+++ b/Source/WebKit/StorageProcess/StorageProcess.messages.in >@@ -36,12 +36,12 @@ messages -> StorageProcess LegacyReceiver { > #endif > > #if ENABLE(SERVICE_WORKER) >- DidNotHandleFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier) >- DidFailFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier) >- DidReceiveFetchResponse(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier, WebCore::ResourceResponse response) >- DidReceiveFetchData(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier, IPC::DataReference data, int64_t encodedDataLength) >- DidReceiveFetchFormData(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier, IPC::FormDataReference data) >- DidFinishFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier) >+ DidNotHandleFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier) >+ DidFailFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier) >+ DidReceiveFetchResponse(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier, WebCore::ResourceResponse response) >+ DidReceiveFetchData(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier, IPC::DataReference data, int64_t encodedDataLength) >+ DidReceiveFetchFormData(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier, IPC::FormDataReference data) >+ DidFinishFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchIdentifier) > PostMessageToServiceWorkerClient(struct WebCore::ServiceWorkerClientIdentifier destinationIdentifier, struct WebCore::MessageWithMessagePorts message, WebCore::ServiceWorkerIdentifier sourceIdentifier, String sourceOrigin) > > PostMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destination, struct WebCore::MessageWithMessagePorts message, WebCore::ServiceWorkerOrClientIdentifier source, WebCore::SWServerConnectionIdentifier connectionIdentifier) >diff --git a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp >index b691fee2f08b3a608a4086e14236a2bc5ab9749e..968f13956fec25c416961df133494cf7815a7004 100644 >--- a/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp >+++ b/Source/WebKit/WebProcess/Network/WebLoaderStrategy.cpp >@@ -404,7 +404,7 @@ void WebLoaderStrategy::remove(ResourceLoader* resourceLoader) > } > > #if ENABLE(SERVICE_WORKER) >- if (WebServiceWorkerProvider::singleton().cancelFetch(identifier)) >+ if (WebServiceWorkerProvider::singleton().cancelFetch(makeObjectIdentifier<FetchIdentifierType>(identifier))) > return; > #endif > >diff --git a/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp b/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp >index 7101a7c0b6489d2b9b818d4c5306b3dbda7f94a0..1397deab38e63d4ab8986daf4619264ccc9de9b4 100644 >--- a/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp >+++ b/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.cpp >@@ -40,7 +40,7 @@ using namespace WebCore; > > namespace WebKit { > >-Ref<ServiceWorkerClientFetch> ServiceWorkerClientFetch::create(WebServiceWorkerProvider& serviceWorkerProvider, Ref<WebCore::ResourceLoader>&& loader, uint64_t identifier, Ref<WebSWClientConnection>&& connection, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Callback&& callback) >+Ref<ServiceWorkerClientFetch> ServiceWorkerClientFetch::create(WebServiceWorkerProvider& serviceWorkerProvider, Ref<WebCore::ResourceLoader>&& loader, FetchIdentifier identifier, Ref<WebSWClientConnection>&& connection, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Callback&& callback) > { > auto fetch = adoptRef(*new ServiceWorkerClientFetch { serviceWorkerProvider, WTFMove(loader), identifier, WTFMove(connection), shouldClearReferrerOnHTTPSToHTTPRedirect, WTFMove(callback) }); > fetch->start(); >@@ -51,7 +51,7 @@ ServiceWorkerClientFetch::~ServiceWorkerClientFetch() > { > } > >-ServiceWorkerClientFetch::ServiceWorkerClientFetch(WebServiceWorkerProvider& serviceWorkerProvider, Ref<WebCore::ResourceLoader>&& loader, uint64_t identifier, Ref<WebSWClientConnection>&& connection, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Callback&& callback) >+ServiceWorkerClientFetch::ServiceWorkerClientFetch(WebServiceWorkerProvider& serviceWorkerProvider, Ref<WebCore::ResourceLoader>&& loader, FetchIdentifier identifier, Ref<WebSWClientConnection>&& connection, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Callback&& callback) > : m_serviceWorkerProvider(serviceWorkerProvider) > , m_loader(WTFMove(loader)) > , m_identifier(identifier) >@@ -75,7 +75,8 @@ void ServiceWorkerClientFetch::start() > cleanHTTPRequestHeadersForAccessControl(request, options.httpHeadersToKeep); > > ASSERT(options.serviceWorkersMode != ServiceWorkersMode::None); >- m_connection->startFetch(m_loader->identifier(), options.serviceWorkerRegistrationIdentifier.value(), request, options, referrer); >+ m_serviceWorkerRegistrationIdentifier = options.serviceWorkerRegistrationIdentifier.value(); >+ m_connection->startFetch(m_identifier, m_serviceWorkerRegistrationIdentifier, request, options, referrer); > > m_redirectionStatus = RedirectionStatus::None; > } >@@ -259,6 +260,11 @@ void ServiceWorkerClientFetch::cancel() > { > if (auto callback = WTFMove(m_callback)) > callback(Result::Cancelled); >+ >+ if (!m_didFinish && !m_didFail) { >+ m_connection->cancelFetch(m_identifier, m_serviceWorkerRegistrationIdentifier); >+ >+ } > m_loader = nullptr; > m_buffer = nullptr; > } >diff --git a/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h b/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h >index 8da1419dc58d2f9eeb2ad89331cfbea924c09055..7d6df82bb300fe581065d4735bba9c4c06e93041 100644 >--- a/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h >+++ b/Source/WebKit/WebProcess/Storage/ServiceWorkerClientFetch.h >@@ -31,6 +31,7 @@ > #include "FormDataReference.h" > #include "MessageReceiver.h" > #include "MessageSender.h" >+#include <WebCore/FetchIdentifier.h> > #include <WebCore/ResourceLoader.h> > #include <wtf/CompletionHandler.h> > >@@ -44,7 +45,7 @@ public: > enum class Result { Succeeded, Cancelled, Unhandled }; > using Callback = WTF::CompletionHandler<void(Result)>; > >- static Ref<ServiceWorkerClientFetch> create(WebServiceWorkerProvider&, Ref<WebCore::ResourceLoader>&&, uint64_t identifier, Ref<WebSWClientConnection>&&, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Callback&&); >+ static Ref<ServiceWorkerClientFetch> create(WebServiceWorkerProvider&, Ref<WebCore::ResourceLoader>&&, WebCore::FetchIdentifier, Ref<WebSWClientConnection>&&, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Callback&&); > ~ServiceWorkerClientFetch(); > > void start(); >@@ -55,7 +56,7 @@ public: > bool isOngoing() const { return !!m_callback; } > > private: >- ServiceWorkerClientFetch(WebServiceWorkerProvider&, Ref<WebCore::ResourceLoader>&&, uint64_t identifier, Ref<WebSWClientConnection>&&, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Callback&&); >+ ServiceWorkerClientFetch(WebServiceWorkerProvider&, Ref<WebCore::ResourceLoader>&&, WebCore::FetchIdentifier, Ref<WebSWClientConnection>&&, bool shouldClearReferrerOnHTTPSToHTTPRedirect, Callback&&); > > std::optional<WebCore::ResourceError> validateResponse(const WebCore::ResourceResponse&); > >@@ -70,7 +71,7 @@ private: > > WebServiceWorkerProvider& m_serviceWorkerProvider; > RefPtr<WebCore::ResourceLoader> m_loader; >- uint64_t m_identifier { 0 }; >+ WebCore::FetchIdentifier m_identifier; > Ref<WebSWClientConnection> m_connection; > Callback m_callback; > enum class RedirectionStatus { None, Receiving, Following, Received }; >@@ -81,6 +82,8 @@ private: > bool m_isCheckingResponse { false }; > bool m_didFinish { false }; > bool m_didFail { false }; >+ >+ WebCore::ServiceWorkerRegistrationIdentifier m_serviceWorkerRegistrationIdentifier; > }; > > } // namespace WebKit >diff --git a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp >index 04bbae431cad5ced4d5933680bb8d03632d1e71d..0cf949959a41bfda57b577f531db25927b70c80c 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp >+++ b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp >@@ -199,9 +199,14 @@ void WebSWClientConnection::getRegistrations(SecurityOriginData&& topOrigin, con > }); > } > >-void WebSWClientConnection::startFetch(uint64_t fetchIdentifier, WebCore::ServiceWorkerRegistrationIdentifier serviceWorkerRegistrationIdentifier, const WebCore::ResourceRequest& request, const WebCore::FetchOptions& options, const String& referrer) >+void WebSWClientConnection::startFetch(WebCore::FetchIdentifier fetchIdentifier, WebCore::ServiceWorkerRegistrationIdentifier serviceWorkerRegistrationIdentifier, const WebCore::ResourceRequest& request, const WebCore::FetchOptions& options, const String& referrer) > { >- send(Messages::WebSWServerConnection::StartFetch { fetchIdentifier, serviceWorkerRegistrationIdentifier, request, options, IPC::FormDataReference { request.httpBody() }, referrer }); >+ send(Messages::WebSWServerConnection::StartFetch { serviceWorkerRegistrationIdentifier, fetchIdentifier, request, options, IPC::FormDataReference { request.httpBody() }, referrer }); >+} >+ >+void WebSWClientConnection::cancelFetch(WebCore::FetchIdentifier fetchIdentifier, WebCore::ServiceWorkerRegistrationIdentifier serviceWorkerRegistrationIdentifier) >+{ >+ send(Messages::WebSWServerConnection::CancelFetch { serviceWorkerRegistrationIdentifier, fetchIdentifier }); > } > > void WebSWClientConnection::postMessageToServiceWorkerClient(DocumentIdentifier destinationContextIdentifier, MessageWithMessagePorts&& message, ServiceWorkerData&& source, const String& sourceOrigin) >diff --git a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h >index 7fd7694fc2b7460a948bb03be3aa45b7e4d817bc..2bfaee476e1f4bcccdb2660fe5d8e66bd674a3d7 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h >+++ b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h >@@ -61,7 +61,8 @@ public: > void didReceiveMessage(IPC::Connection&, IPC::Decoder&) final; > > bool mayHaveServiceWorkerRegisteredForOrigin(const WebCore::SecurityOriginData&) const final; >- void startFetch(uint64_t fetchIdentifier, WebCore::ServiceWorkerRegistrationIdentifier, const WebCore::ResourceRequest&, const WebCore::FetchOptions&, const String& referrer); >+ void startFetch(WebCore::FetchIdentifier, WebCore::ServiceWorkerRegistrationIdentifier, const WebCore::ResourceRequest&, const WebCore::FetchOptions&, const String& referrer); >+ void cancelFetch(WebCore::FetchIdentifier, WebCore::ServiceWorkerRegistrationIdentifier); > > void postMessageToServiceWorkerClient(WebCore::DocumentIdentifier destinationContextIdentifier, WebCore::MessageWithMessagePorts&&, WebCore::ServiceWorkerData&& source, const String& sourceOrigin); > >diff --git a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp >index 015d70e9f87c7d07be4b3431f33f7d1b46d7b2e7..1c42d0ba6020aefa6d8a9fdbf3298823a8989d45 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp >+++ b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp >@@ -198,11 +198,17 @@ static inline bool isValidFetch(const ResourceRequest& request, const FetchOptio > return protocolHostAndPortAreEqual(url, serviceWorkerURL); > } > >-void WebSWContextManagerConnection::startFetch(SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, ResourceRequest&& request, FetchOptions&& options, IPC::FormDataReference&& formData, String&& referrer) >+void WebSWContextManagerConnection::cancelFetch(SWServerConnectionIdentifier serverConnectionIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, FetchIdentifier fetchIdentifier) >+{ >+ if (auto* serviceWorkerThreadProxy = SWContextManager::singleton().serviceWorkerThreadProxy(serviceWorkerIdentifier)) >+ serviceWorkerThreadProxy->cancelFetch(serverConnectionIdentifier, fetchIdentifier); >+} >+ >+void WebSWContextManagerConnection::startFetch(SWServerConnectionIdentifier serverConnectionIdentifier, ServiceWorkerIdentifier serviceWorkerIdentifier, FetchIdentifier fetchIdentifier, ResourceRequest&& request, FetchOptions&& options, IPC::FormDataReference&& formData, String&& referrer) > { > auto* serviceWorkerThreadProxy = SWContextManager::singleton().serviceWorkerThreadProxy(serviceWorkerIdentifier); > if (!serviceWorkerThreadProxy) { >- m_connectionToStorageProcess->send(Messages::StorageProcess::DidNotHandleFetch(serverConnectionIdentifier, fetchIdentifier), 0); >+ m_connectionToStorageProcess->send(Messages::StorageProcess::DidNotHandleFetch { serverConnectionIdentifier, fetchIdentifier }, 0); > return; > } > >@@ -214,7 +220,7 @@ void WebSWContextManagerConnection::startFetch(SWServerConnectionIdentifier serv > clientId = ServiceWorkerClientIdentifier { serverConnectionIdentifier, options.clientIdentifier.value() }; > > request.setHTTPBody(formData.takeData()); >- serviceWorkerThreadProxy->thread().postFetchTask(WTFMove(client), WTFMove(clientId), WTFMove(request), WTFMove(referrer), WTFMove(options)); >+ serviceWorkerThreadProxy->startFetch(serverConnectionIdentifier, fetchIdentifier, WTFMove(client), WTFMove(clientId), WTFMove(request), WTFMove(referrer), WTFMove(options)); > } > > void WebSWContextManagerConnection::postMessageToServiceWorker(ServiceWorkerIdentifier destinationIdentifier, MessageWithMessagePorts&& message, ServiceWorkerOrClientData&& sourceData) >diff --git a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h >index 8e8207d69df017cc4ee7e686f6199deacded7368..2b2174f8c85978eb0c8656a13783d5a161c4f96c 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h >+++ b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h >@@ -76,7 +76,8 @@ private: > // IPC messages. > void serviceWorkerStartedWithMessage(std::optional<WebCore::ServiceWorkerJobDataIdentifier>, WebCore::ServiceWorkerIdentifier, const String& exceptionMessage) final; > void installServiceWorker(const WebCore::ServiceWorkerContextData&, PAL::SessionID); >- void startFetch(WebCore::SWServerConnectionIdentifier, uint64_t fetchIdentifier, WebCore::ServiceWorkerIdentifier, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&, String&& referrer); >+ void startFetch(WebCore::SWServerConnectionIdentifier, WebCore::ServiceWorkerIdentifier, WebCore::FetchIdentifier, WebCore::ResourceRequest&&, WebCore::FetchOptions&&, IPC::FormDataReference&&, String&& referrer); >+ void cancelFetch(WebCore::SWServerConnectionIdentifier, WebCore::ServiceWorkerIdentifier, WebCore::FetchIdentifier); > void postMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destinationIdentifier, WebCore::MessageWithMessagePorts&&, WebCore::ServiceWorkerOrClientData&& sourceData); > void fireInstallEvent(WebCore::ServiceWorkerIdentifier); > void fireActivateEvent(WebCore::ServiceWorkerIdentifier); >diff --git a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in >index 27bee323ebb9acdc30fb2f68a260e2cb497df4cd..be0d593a68a791f14586f6f950c2d679ebe5e01b 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in >+++ b/Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in >@@ -24,7 +24,8 @@ > > messages -> WebSWContextManagerConnection { > InstallServiceWorker(struct WebCore::ServiceWorkerContextData contextData, PAL::SessionID sessionID) >- StartFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchIdentifier, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, WebCore::ResourceRequest request, struct WebCore::FetchOptions options, IPC::FormDataReference requestBody, String referrer) >+ StartFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, WebCore::FetchIdentifier fetchIdentifier, WebCore::ResourceRequest request, struct WebCore::FetchOptions options, IPC::FormDataReference requestBody, String referrer) >+ CancelFetch(WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, WebCore::FetchIdentifier fetchIdentifier) > PostMessageToServiceWorker(WebCore::ServiceWorkerIdentifier destinationIdentifier, struct WebCore::MessageWithMessagePorts message, WebCore::ServiceWorkerOrClientData sourceData) > FireInstallEvent(WebCore::ServiceWorkerIdentifier identifier) > FireActivateEvent(WebCore::ServiceWorkerIdentifier identifier) >diff --git a/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp b/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp >index fa243c454817899697bf04a3382f340fac3677ce..4e44506362f43503784bae3592bd623ef20551ab 100644 >--- a/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp >+++ b/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp >@@ -46,11 +46,11 @@ WebServiceWorkerFetchTaskClient::~WebServiceWorkerFetchTaskClient() > RunLoop::main().dispatch([connection = WTFMove(m_connection)] { }); > } > >-WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient(Ref<IPC::Connection>&& connection, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchTaskIdentifier) >+WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient(Ref<IPC::Connection>&& connection, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, FetchIdentifier fetchIdentifier) > : m_connection(WTFMove(connection)) > , m_serverConnectionIdentifier(serverConnectionIdentifier) > , m_serviceWorkerIdentifier(serviceWorkerIdentifier) >- , m_fetchTaskIdentifier(fetchTaskIdentifier) >+ , m_fetchIdentifier(fetchIdentifier) > { > } > >@@ -58,7 +58,7 @@ void WebServiceWorkerFetchTaskClient::didReceiveResponse(const ResourceResponse& > { > if (!m_connection) > return; >- m_connection->send(Messages::StorageProcess::DidReceiveFetchResponse { m_serverConnectionIdentifier, m_fetchTaskIdentifier, response }, 0); >+ m_connection->send(Messages::StorageProcess::DidReceiveFetchResponse { m_serverConnectionIdentifier, m_fetchIdentifier, response }, 0); > } > > void WebServiceWorkerFetchTaskClient::didReceiveData(Ref<SharedBuffer>&& buffer) >@@ -66,7 +66,7 @@ void WebServiceWorkerFetchTaskClient::didReceiveData(Ref<SharedBuffer>&& buffer) > if (!m_connection) > return; > IPC::SharedBufferDataReference dataReference { buffer.ptr() }; >- m_connection->send(Messages::StorageProcess::DidReceiveFetchData { m_serverConnectionIdentifier, m_fetchTaskIdentifier, dataReference, static_cast<int64_t>(buffer->size()) }, 0); >+ m_connection->send(Messages::StorageProcess::DidReceiveFetchData { m_serverConnectionIdentifier, m_fetchIdentifier, dataReference, static_cast<int64_t>(buffer->size()) }, 0); > } > > void WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish(Ref<FormData>&& formData) >@@ -78,7 +78,7 @@ void WebServiceWorkerFetchTaskClient::didReceiveFormDataAndFinish(Ref<FormData>& > // For now and for the case of blobs, we read it there and send the data through IPC. > URL blobURL = formData->asBlobURL(); > if (blobURL.isNull()) { >- m_connection->send(Messages::StorageProcess::DidReceiveFetchFormData { m_serverConnectionIdentifier, m_fetchTaskIdentifier, IPC::FormDataReference { WTFMove(formData) } }, 0); >+ m_connection->send(Messages::StorageProcess::DidReceiveFetchFormData { m_serverConnectionIdentifier, m_fetchIdentifier, IPC::FormDataReference { WTFMove(formData) } }, 0); > return; > } > >@@ -107,7 +107,7 @@ void WebServiceWorkerFetchTaskClient::didReceiveBlobChunk(const char* data, size > return; > > IPC::DataReference dataReference { reinterpret_cast<const uint8_t*>(data), size }; >- m_connection->send(Messages::StorageProcess::DidReceiveFetchData { m_serverConnectionIdentifier, m_fetchTaskIdentifier, dataReference, static_cast<int64_t>(size) }, 0); >+ m_connection->send(Messages::StorageProcess::DidReceiveFetchData { m_serverConnectionIdentifier, m_fetchIdentifier, dataReference, static_cast<int64_t>(size) }, 0); > } > > void WebServiceWorkerFetchTaskClient::didFinishBlobLoading() >@@ -121,8 +121,10 @@ void WebServiceWorkerFetchTaskClient::didFail() > { > if (!m_connection) > return; >- m_connection->send(Messages::StorageProcess::DidFailFetch { m_serverConnectionIdentifier, m_fetchTaskIdentifier }, 0); >- m_connection = nullptr; >+ >+ m_connection->send(Messages::StorageProcess::DidFailFetch { m_serverConnectionIdentifier, m_fetchIdentifier }, 0); >+ >+ cleanup(); > } > > void WebServiceWorkerFetchTaskClient::didFinish() >@@ -130,16 +132,39 @@ void WebServiceWorkerFetchTaskClient::didFinish() > if (!m_connection) > return; > >- m_connection->send(Messages::StorageProcess::DidFinishFetch { m_serverConnectionIdentifier, m_fetchTaskIdentifier }, 0); >- m_connection = nullptr; >+ m_connection->send(Messages::StorageProcess::DidFinishFetch { m_serverConnectionIdentifier, m_fetchIdentifier }, 0); >+ >+ cleanup(); > } > > void WebServiceWorkerFetchTaskClient::didNotHandle() > { > if (!m_connection) > return; >- m_connection->send(Messages::StorageProcess::DidNotHandleFetch { m_serverConnectionIdentifier, m_fetchTaskIdentifier }, 0); >+ >+ m_connection->send(Messages::StorageProcess::DidNotHandleFetch { m_serverConnectionIdentifier, m_fetchIdentifier }, 0); >+ >+ cleanup(); >+} >+ >+void WebServiceWorkerFetchTaskClient::cancel() >+{ >+ m_connection = nullptr; >+} >+ >+void WebServiceWorkerFetchTaskClient::cleanup() >+{ >+ ASSERT(m_connection); > m_connection = nullptr; >+ >+ if (!isMainThread()) { >+ callOnMainThread([protectedThis = makeRef(*this)] () { >+ protectedThis->cleanup(); >+ }); >+ return; >+ } >+ if (auto* serviceWorkerThreadProxy = SWContextManager::singleton().serviceWorkerThreadProxy(m_serviceWorkerIdentifier)) >+ serviceWorkerThreadProxy->removeFetch(m_serverConnectionIdentifier, m_fetchIdentifier); > } > > } // namespace WebKit >diff --git a/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h b/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h >index e785ad0bde70d5c3a9db0e4c983002a9f4bcb9d6..1a8daca78945a019047f0f8204169943481dddb6 100644 >--- a/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h >+++ b/Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h >@@ -28,6 +28,7 @@ > #if ENABLE(SERVICE_WORKER) > > #include "Connection.h" >+#include <WebCore/FetchIdentifier.h> > #include <WebCore/FetchLoader.h> > #include <WebCore/FetchLoaderClient.h> > #include <WebCore/ServiceWorkerFetch.h> >@@ -37,7 +38,7 @@ namespace WebKit { > > class WebServiceWorkerFetchTaskClient final : public WebCore::ServiceWorkerFetch::Client { > public: >- static Ref<WebServiceWorkerFetchTaskClient> create(Ref<IPC::Connection>&& connection, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, uint64_t fetchTaskIdentifier) >+ static Ref<WebServiceWorkerFetchTaskClient> create(Ref<IPC::Connection>&& connection, WebCore::ServiceWorkerIdentifier serviceWorkerIdentifier, WebCore::SWServerConnectionIdentifier serverConnectionIdentifier, WebCore::FetchIdentifier fetchTaskIdentifier) > { > return adoptRef(*new WebServiceWorkerFetchTaskClient(WTFMove(connection), serviceWorkerIdentifier, serverConnectionIdentifier, fetchTaskIdentifier)); > } >@@ -45,7 +46,7 @@ public: > ~WebServiceWorkerFetchTaskClient(); > > private: >- WebServiceWorkerFetchTaskClient(Ref<IPC::Connection>&&, WebCore::ServiceWorkerIdentifier, WebCore::SWServerConnectionIdentifier, uint64_t fetchTaskIdentifier); >+ WebServiceWorkerFetchTaskClient(Ref<IPC::Connection>&&, WebCore::ServiceWorkerIdentifier, WebCore::SWServerConnectionIdentifier, WebCore::FetchIdentifier); > > void didReceiveResponse(const WebCore::ResourceResponse&) final; > void didReceiveData(Ref<WebCore::SharedBuffer>&&) final; >@@ -53,7 +54,10 @@ private: > void didFail() final; > void didFinish() final; > void didNotHandle() final; >+ void cancel() final; > >+ void cleanup(); >+ > void didReceiveBlobChunk(const char* data, size_t size); > void didFinishBlobLoading(); > >@@ -73,7 +77,7 @@ private: > RefPtr<IPC::Connection> m_connection; > WebCore::SWServerConnectionIdentifier m_serverConnectionIdentifier; > WebCore::ServiceWorkerIdentifier m_serviceWorkerIdentifier; >- uint64_t m_fetchTaskIdentifier { 0 }; >+ WebCore::FetchIdentifier m_fetchIdentifier; > std::optional<BlobLoader> m_blobLoader; > }; > >diff --git a/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp b/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp >index cff9a54fb7733f12cc660c4398a3dd7a8c26e943..a870a18c3f7f0181c430016807d1412a978254d6 100644 >--- a/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp >+++ b/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp >@@ -88,20 +88,21 @@ void WebServiceWorkerProvider::handleFetch(ResourceLoader& loader, CachedResourc > } > > auto& connection = WebProcess::singleton().ensureWebToStorageProcessConnection(sessionID).serviceWorkerConnectionForSession(sessionID); >- m_ongoingFetchTasks.add(loader.identifier(), ServiceWorkerClientFetch::create(*this, loader, loader.identifier(), connection, shouldClearReferrerOnHTTPSToHTTPRedirect, WTFMove(callback))); >+ auto fetchIdentifier = makeObjectIdentifier<FetchIdentifierType>(loader.identifier()); >+ m_ongoingFetchTasks.add(fetchIdentifier.toUInt64(), ServiceWorkerClientFetch::create(*this, loader, fetchIdentifier, connection, shouldClearReferrerOnHTTPSToHTTPRedirect, WTFMove(callback))); > } > >-bool WebServiceWorkerProvider::cancelFetch(uint64_t fetchIdentifier) >+bool WebServiceWorkerProvider::cancelFetch(FetchIdentifier fetchIdentifier) > { >- auto fetch = m_ongoingFetchTasks.take(fetchIdentifier); >+ auto fetch = m_ongoingFetchTasks.take(fetchIdentifier.toUInt64()); > if (fetch) > (*fetch)->cancel(); > return !!fetch; > } > >-void WebServiceWorkerProvider::fetchFinished(uint64_t fetchIdentifier) >+void WebServiceWorkerProvider::fetchFinished(FetchIdentifier fetchIdentifier) > { >- m_ongoingFetchTasks.take(fetchIdentifier); >+ m_ongoingFetchTasks.take(fetchIdentifier.toUInt64()); > } > > void WebServiceWorkerProvider::didReceiveServiceWorkerClientFetchMessage(IPC::Connection& connection, IPC::Decoder& decoder) >diff --git a/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h b/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h >index c41102329e340874e2bb63375e8ac8c2d7fbfe18..d3c5caa8c7f5b9bbe6501217900536de8efcb9d7 100644 >--- a/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h >+++ b/Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.h >@@ -42,8 +42,8 @@ public: > static WebServiceWorkerProvider& singleton(); > > void handleFetch(WebCore::ResourceLoader&, WebCore::CachedResource*, PAL::SessionID, bool shouldClearReferrerOnHTTPSToHTTPRedirect, ServiceWorkerClientFetch::Callback&&); >- bool cancelFetch(uint64_t fetchIdentifier); >- void fetchFinished(uint64_t fetchIdentifier); >+ bool cancelFetch(WebCore::FetchIdentifier); >+ void fetchFinished(WebCore::FetchIdentifier); > > void didReceiveServiceWorkerClientFetchMessage(IPC::Connection&, IPC::Decoder&); > void didReceiveServiceWorkerClientRegistrationMatch(IPC::Connection&, IPC::Decoder&);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185274
:
339546
|
339556
|
339563
|
339757
|
339767
|
339793
|
339804
|
339954
|
339981
|
339999