[webkit-changes] [WebKit/WebKit] 6facf7: REGRESSION (Safari 16): Service worker clientId is...
youennf
noreply at github.com
Wed Sep 28 00:24:16 PDT 2022
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 6facf7d89d16cabe9fddd73cdfc28cb2881c40de
https://github.com/WebKit/WebKit/commit/6facf7d89d16cabe9fddd73cdfc28cb2881c40de
Author: Youenn Fablet <youennf at gmail.com>
Date: 2022-09-28 (Wed, 28 Sep 2022)
Changed paths:
M LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample-worker-interceptor.js
M LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https-expected.txt
M LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https.html
M LayoutTests/platform/glib/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https-expected.txt
M Source/WebCore/loader/DocumentLoader.cpp
M Source/WebCore/loader/FetchOptions.h
M Source/WebCore/workers/WorkerScriptLoader.cpp
M Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp
M Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp
M Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp
M Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp
Log Message:
-----------
REGRESSION (Safari 16): Service worker clientId is empty for web worker fetches
https://bugs.webkit.org/show_bug.cgi?id=245425
rdar://problem/100368228
Reviewed by Chris Dumez.
After introducing correct matching of service worker registration for worker loads, we correctly filled resultingClientId to the worker context id.
As per https://html.spec.whatwg.org/multipage/webappapis.html#fetch-a-classic-worker-script, we need to set clientId to the context Id creating the worker.
To do so, we introduce resultingClientId as a FetchOptions so that we can set both clientId and resultingClientId when doing a load.
Set resultingClientId in DocumentLoader and set both clientId and resultingClientId for workers.
Update networking process code to pass clientId and resultingClientId when starting a fetch event.
Drive=by fix, updateAppInitiatedValue needs to hop to main thread.
Covered by newly added test.
* LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/resources/sample-worker-interceptor.js:
* LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https.html:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/service-workers/service-worker/worker-interception.https-expected.txt:
* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadMainResource):
* Source/WebCore/loader/FetchOptions.h:
(WebCore::FetchOptions::encode const):
(WebCore::FetchOptions::decode):
* Source/WebCore/workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadAsynchronously):
* Source/WebKit/NetworkProcess/ServiceWorker/ServiceWorkerFetchTask.cpp:
(WebKit::ServiceWorkerFetchTask::startFetch):
* Source/WebKit/NetworkProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::controlClient):
(WebKit::WebSWServerConnection::createFetchTask):
* Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::updateAppInitiatedValue):
Canonical link: https://commits.webkit.org/254944@main
More information about the webkit-changes
mailing list