Title: [289054] trunk
Revision
289054
Author
[email protected]
Date
2022-02-03 07:21:42 -0800 (Thu, 03 Feb 2022)

Log Message

Start connecting SharedWorker to the WebKit2 layer
https://bugs.webkit.org/show_bug.cgi?id=236052

Reviewed by Darin Adler.

Source/WebCore:

Start connecting SharedWorker to the WebKit2 layer with a provider / connection, similarly to what is done
for service workers.

* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* workers/shared/SharedWorker.cpp:
(WebCore::mainThreadConnection):
(WebCore::SharedWorker::create):
* workers/shared/SharedWorkerManager.h:
* workers/shared/SharedWorkerObjectConnection.cpp: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
* workers/shared/SharedWorkerObjectConnection.h: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
* workers/shared/SharedWorkerProvider.cpp: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
(WebCore::SharedWorkerProvider::singleton):
(WebCore::SharedWorkerProvider::setSharedProvider):
* workers/shared/SharedWorkerProvider.h: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
(WebCore::SharedWorkerProvider::~SharedWorkerProvider):
* workers/shared/SharedWorkerScriptLoader.h:

Source/WebKit:

Start connecting SharedWorker to the WebKit2 layer with a provider / connection, similarly to what is done
for service workers.

* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::sharedWorkerConnection):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Storage/WebSharedWorkerObjectConnection.cpp: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
(WebKit::WebSharedWorkerObjectConnection::messageSenderConnection const):
(WebKit::WebSharedWorkerObjectConnection::requestSharedWorker):
* WebProcess/Storage/WebSharedWorkerObjectConnection.h: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
* WebProcess/Storage/WebSharedWorkerProvider.cpp: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
(WebKit::WebSharedWorkerProvider::singleton):
(WebKit::WebSharedWorkerProvider::sharedWorkerConnection):
* WebProcess/Storage/WebSharedWorkerProvider.h: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

LayoutTests:

Skip pure SharedWorkers tests on WK1 since we will only implement this for WebKit2 in the short term.
Land WK1-specific baselines for tests that use SharedWorkers but also cover other things.

* platform/mac-wk1/TestExpectations:
* platform/mac-wk1/imported/w3c/web-platform-tests/content-security-policy/script-src/worker-importscripts.sub-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/content-security-policy/script-src/worker-set-timeout.sub-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.https-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/workers-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/workers/abrupt-completion-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/workers/semantics/multiple-workers/001-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/workers/semantics/run-a-worker/003-expected.txt: Added.
* platform/win/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (289053 => 289054)


--- trunk/LayoutTests/ChangeLog	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/LayoutTests/ChangeLog	2022-02-03 15:21:42 UTC (rev 289054)
@@ -1,3 +1,25 @@
+2022-02-03  Chris Dumez  <[email protected]>
+
+        Start connecting SharedWorker to the WebKit2 layer
+        https://bugs.webkit.org/show_bug.cgi?id=236052
+
+        Reviewed by Darin Adler.
+
+        Skip pure SharedWorkers tests on WK1 since we will only implement this for WebKit2 in the short term.
+        Land WK1-specific baselines for tests that use SharedWorkers but also cover other things.
+
+        * platform/mac-wk1/TestExpectations:
+        * platform/mac-wk1/imported/w3c/web-platform-tests/content-security-policy/script-src/worker-importscripts.sub-expected.txt: Added.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/content-security-policy/script-src/worker-set-timeout.sub-expected.txt: Added.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.https-expected.txt: Added.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt: Added.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin-expected.txt: Added.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/workers-expected.txt: Added.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/workers/abrupt-completion-expected.txt: Added.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/workers/semantics/multiple-workers/001-expected.txt: Added.
+        * platform/mac-wk1/imported/w3c/web-platform-tests/workers/semantics/run-a-worker/003-expected.txt: Added.
+        * platform/win/TestExpectations:
+
 2022-02-03  Youenn Fablet  <[email protected]>
 
         RealtimeIncomingVideoSourceCocoa should not need to create IOSurfaces

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (289053 => 289054)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2022-02-03 15:21:42 UTC (rev 289054)
@@ -66,6 +66,127 @@
 http/tests/navigation/page-cache-mediastream.html [ Skip ]
 media/audio-session-category.html [ Skip ]
 
+# Shared workers are only implemented for WebKit2.
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-wildcard/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-wildcard/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-wildcard/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-wildcard/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/inside-worker/sharedworker-connect-src.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/inside-worker/sharedworker-report-only.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/inside-worker/sharedworker-script-src.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/sandbox/shared-worker-sandbox.html  [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/script-src/worker-data-set-timeout.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-child.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-wildcard/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-wildcard/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-fallback.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-list.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-none.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-self.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-worker-src-child-fallback-blocked.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-worker-src-child-fallback.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-worker-src-default-fallback.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-worker-src-script-fallback.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-worker-src-self-fallback.sub.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/data-url-shared-worker.html [ Skip ]
+imported/w3c/web-platform-tests/html/browsers/offline/no-appcache-in-shared-workers-historical.https.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-1-nothrow-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-1-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-2-import-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-3-dynamic-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/evaluation-order-1-nothrow-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/evaluation-order-1-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/promise-rejection-events.sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/wasm/serialization/module/broadcastchannel-success-and-failure.html [ Skip ]
+imported/w3c/web-platform-tests/workers/SharedWorkerPerformanceNow.html [ Skip ]
+imported/w3c/web-platform-tests/workers/baseurl/alpha/importScripts-in-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/workers/baseurl/alpha/xhr-in-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/workers/interfaces/SharedWorkerGlobalScope [ Skip ]
+imported/w3c/web-platform-tests/workers/interfaces/WorkerGlobalScope/location/redirect-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-import-blob-url.window.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-import-data-url-cross-origin.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-import-data-url.window.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-import-failure.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-import-meta.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-import.window.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-options-credentials.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-options-type.html [ Skip ]
+imported/w3c/web-platform-tests/workers/SharedWorker_dataUrl.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-parse-error-failure.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/encodings/002.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/encodings/004.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/multiple-workers/004.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/multiple-workers/008.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/reporting-errors/001.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/reporting-errors/002.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/reporting-errors/003.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/reporting-errors/004.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/run-a-worker/002.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/structured-clone/shared.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/xhr/003.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/xhr/004.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/xhr/006.html [ Skip ]
+imported/w3c/web-platform-tests/workers/shared-worker-from-blob-url.window.html [ Skip ]
+imported/w3c/web-platform-tests/workers/shared-worker-name-via-options.html [ Skip ]
+imported/w3c/web-platform-tests/workers/shared-worker-options-mismatch.html [ Skip ]
+imported/w3c/web-platform-tests/workers/shared-worker-parse-error-failure.html [ Skip ]
+imported/w3c/web-platform-tests/wasm/serialization/module/window-sharedworker-failure.html [ Skip ]
+imported/w3c/web-platform-tests/xhr/open-url-redirected-sharedworker-origin.htm [ Skip ]
+
 http/wpt/mediarecorder [ Skip ]
 imported/w3c/web-platform-tests/mediacapture-record [ Skip ]
 fast/history/page-cache-media-recorder.html [ Skip ]

Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/content-security-policy/script-src/worker-importscripts.sub-expected.txt (0 => 289054)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/content-security-policy/script-src/worker-importscripts.sub-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/content-security-policy/script-src/worker-importscripts.sub-expected.txt	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,4 @@
+
+FAIL Dedicated worker inherits CSP from main document assert_equals: expected "importScripts allowed" but got "importScripts blocked"
+FAIL Shared worker delivers its own CSP Shared workers are not supported
+

Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/content-security-policy/script-src/worker-set-timeout.sub-expected.txt (0 => 289054)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/content-security-policy/script-src/worker-set-timeout.sub-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/content-security-policy/script-src/worker-set-timeout.sub-expected.txt	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,4 @@
+
+FAIL Dedicated worker inherits CSP from main document assert_equals: expected "setTimeout allowed" but got "setTimeout blocked"
+FAIL Shared worker delivers its own CSP Shared workers are not supported
+

Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.https-expected.txt (0 => 289054)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.https-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker.https-expected.txt	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,9 @@
+CONSOLE MESSAGE: ApplicationCache is deprecated. Please use ServiceWorkers instead.
+
+PASS Dedicated worker of the cached script
+PASS Dedicated worker of the fallbacked script
+PASS Dedicated worker of the not-in-cache script
+FAIL Shared worker of the cached script promise_test: Unhandled rejection with value: object "NotSupportedError: Shared workers are not supported"
+FAIL Shared worker of the fallbacked script promise_test: Unhandled rejection with value: object "NotSupportedError: Shared workers are not supported"
+FAIL Shared worker of the not-in-cache script promise_test: Unhandled rejection with value: object "NotSupportedError: Shared workers are not supported"
+

Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt (0 => 289054)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/import-meta/import-meta-url-expected.txt	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,11 @@
+
+PASS import.meta.url in a root external script
+PASS import.meta.url in a dependent external script
+PASS import.meta is an object
+PASS import.meta is extensible
+PASS import.meta's properties are writable, configurable, and enumerable
+PASS import.meta.url when importing the module with different fragments
+PASS import.meta.url in a root inline script
+PASS import.meta.url at top-level module DedicatedWorker
+FAIL import.meta.url at top-level module SharedWorker promise_test: Unhandled rejection with value: object "NotSupportedError: Shared workers are not supported"
+

Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin-expected.txt (0 => 289054)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/html/webappapis/the-windoworworkerglobalscope-mixin/Worker_Self_Origin-expected.txt	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,8 @@
+
+PASS Same Origin Worker
+FAIL Same Origin SharedWorker Shared workers are not supported
+PASS Data Url Worker
+FAIL Data Url SharedWorker Shared workers are not supported
+PASS Blob Url Worker
+FAIL Blob Url SharedWorker Shared workers are not supported
+

Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/workers-expected.txt (0 => 289054)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/workers-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/workers-expected.txt	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,12 @@
+
+PASS BroadcastChannel works in workers
+FAIL BroadcastChannel works in shared workers Shared workers are not supported
+PASS Closing and re-opening a channel works.
+PASS BroadcastChannel created after a worker self.close()
+PASS BroadcastChannel messages from closed worker to parent should be ignored (BC created before closing)
+PASS BroadcastChannel messages from closed worker to parent should be ignored (BC created after closing)
+PASS BroadcastChannel messages from parent to closed worker should be ignored (BC created before closing)
+PASS BroadcastChannel messages from parent to closed worker should be ignored (BC created after closing)
+PASS BroadcastChannel messages within closed worker should be ignored (BCs created before closing)
+PASS BroadcastChannel messages within closed worker should be ignored (BCs created after closing)
+

Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/workers/abrupt-completion-expected.txt (0 => 289054)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/workers/abrupt-completion-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/workers/abrupt-completion-expected.txt	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,4 @@
+
+PASS DedicatedWorker should correctly handle abrupt completion
+FAIL SharedWorker should correctly handle abrupt completion promise_test: Unhandled rejection with value: object "NotSupportedError: Shared workers are not supported"
+

Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/workers/semantics/multiple-workers/001-expected.txt (0 => 289054)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/workers/semantics/multiple-workers/001-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/workers/semantics/multiple-workers/001-expected.txt	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,4 @@
+
+PASS dedicated
+FAIL shared Shared workers are not supported
+

Added: trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/workers/semantics/run-a-worker/003-expected.txt (0 => 289054)


--- trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/workers/semantics/run-a-worker/003-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/imported/w3c/web-platform-tests/workers/semantics/run-a-worker/003-expected.txt	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,4 @@
+
+PASS worker
+FAIL shared Shared workers are not supported
+

Modified: trunk/LayoutTests/platform/win/TestExpectations (289053 => 289054)


--- trunk/LayoutTests/platform/win/TestExpectations	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/LayoutTests/platform/win/TestExpectations	2022-02-03 15:21:42 UTC (rev 289054)
@@ -162,8 +162,129 @@
 http/tests/referrer-policy/unsafe-url/cross-origin-http.https.html [ Skip ] 
 http/tests/referrer-policy-img/no-referrer-when-downgrade/ [ Skip ] 
 http/tests/referrer-policy-img/unsafe-url/cross-origin-http-http.html [ Skip ] 
-http/tests/referrer-policy-img/unsafe-url/cross-origin-http.https.html [ Skip ] 
+http/tests/referrer-policy-img/unsafe-url/cross-origin-http.https.html [ Skip ]
 
+# Shared workers are only implemented for WebKit2.
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-wildcard/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-wildcard/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-wildcard/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-wildcard/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/inside-worker/sharedworker-connect-src.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/inside-worker/sharedworker-report-only.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/inside-worker/sharedworker-script-src.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/sandbox/shared-worker-sandbox.html  [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/script-src/worker-data-set-timeout.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-child.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-self/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/script-src-wildcard/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-none/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-self/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.http-rp/worker-src-wildcard/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-self/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/script-src-wildcard/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-classic.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-classic.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-module.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-none/sharedworker-module.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-self/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-wildcard/sharedworker-import-data.http.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/gen/top.meta/worker-src-wildcard/sharedworker-import-data.https.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-fallback.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-list.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-none.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-self.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-worker-src-child-fallback-blocked.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-worker-src-child-fallback.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-worker-src-default-fallback.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-worker-src-script-fallback.sub.html [ Skip ]
+imported/w3c/web-platform-tests/content-security-policy/worker-src/shared-worker-src-self-fallback.sub.html [ Skip ]
+imported/w3c/web-platform-tests/fetch/api/cors/data-url-shared-worker.html [ Skip ]
+imported/w3c/web-platform-tests/html/browsers/offline/no-appcache-in-shared-workers-historical.https.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-1-nothrow-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-1-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-2-import-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-3-dynamic-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/evaluation-order-1-nothrow-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/evaluation-order-1-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/unhandled-promise-rejections/promise-rejection-events.sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/wasm/serialization/module/broadcastchannel-success-and-failure.html [ Skip ]
+imported/w3c/web-platform-tests/workers/SharedWorkerPerformanceNow.html [ Skip ]
+imported/w3c/web-platform-tests/workers/baseurl/alpha/importScripts-in-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/workers/baseurl/alpha/xhr-in-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/workers/interfaces/SharedWorkerGlobalScope [ Skip ]
+imported/w3c/web-platform-tests/workers/interfaces/WorkerGlobalScope/location/redirect-sharedworker.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-import-blob-url.window.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-import-data-url-cross-origin.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-import-data-url.window.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-import-failure.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-import-meta.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-import.window.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-options-credentials.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-options-type.html [ Skip ]
+imported/w3c/web-platform-tests/workers/SharedWorker_dataUrl.html [ Skip ]
+imported/w3c/web-platform-tests/workers/modules/shared-worker-parse-error-failure.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/encodings/002.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/encodings/004.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/multiple-workers/004.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/multiple-workers/008.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/reporting-errors/001.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/reporting-errors/002.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/reporting-errors/003.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/reporting-errors/004.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/run-a-worker/002.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/structured-clone/shared.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/xhr/003.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/xhr/004.html [ Skip ]
+imported/w3c/web-platform-tests/workers/semantics/xhr/006.html [ Skip ]
+imported/w3c/web-platform-tests/workers/shared-worker-from-blob-url.window.html [ Skip ]
+imported/w3c/web-platform-tests/workers/shared-worker-name-via-options.html [ Skip ]
+imported/w3c/web-platform-tests/workers/shared-worker-options-mismatch.html [ Skip ]
+imported/w3c/web-platform-tests/workers/shared-worker-parse-error-failure.html [ Skip ]
+imported/w3c/web-platform-tests/wasm/serialization/module/window-sharedworker-failure.html [ Skip ]
+imported/w3c/web-platform-tests/xhr/open-url-redirected-sharedworker-origin.htm [ Skip ]
+
 # Dark mode not supported on Windows
 css-dark-mode [ Skip ]
 

Modified: trunk/Source/WebCore/ChangeLog (289053 => 289054)


--- trunk/Source/WebCore/ChangeLog	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebCore/ChangeLog	2022-02-03 15:21:42 UTC (rev 289054)
@@ -1,3 +1,29 @@
+2022-02-03  Chris Dumez  <[email protected]>
+
+        Start connecting SharedWorker to the WebKit2 layer
+        https://bugs.webkit.org/show_bug.cgi?id=236052
+
+        Reviewed by Darin Adler.
+
+        Start connecting SharedWorker to the WebKit2 layer with a provider / connection, similarly to what is done
+        for service workers.
+
+        * Headers.cmake:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+        * workers/shared/SharedWorker.cpp:
+        (WebCore::mainThreadConnection):
+        (WebCore::SharedWorker::create):
+        * workers/shared/SharedWorkerManager.h:
+        * workers/shared/SharedWorkerObjectConnection.cpp: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
+        * workers/shared/SharedWorkerObjectConnection.h: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
+        * workers/shared/SharedWorkerProvider.cpp: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
+        (WebCore::SharedWorkerProvider::singleton):
+        (WebCore::SharedWorkerProvider::setSharedProvider):
+        * workers/shared/SharedWorkerProvider.h: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
+        (WebCore::SharedWorkerProvider::~SharedWorkerProvider):
+        * workers/shared/SharedWorkerScriptLoader.h:
+
 2022-02-03  Alan Bujtas  <[email protected]>
 
         [LFC][IFC] imported/w3c/web-platform-tests/css/css-writing-modes/text-align-vlr* tests are failing

Modified: trunk/Source/WebCore/Headers.cmake (289053 => 289054)


--- trunk/Source/WebCore/Headers.cmake	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebCore/Headers.cmake	2022-02-03 15:21:42 UTC (rev 289054)
@@ -2003,6 +2003,9 @@
     workers/service/server/SWServerWorker.h
 
     workers/shared/SharedWorkerIdentifier.h
+    workers/shared/SharedWorkerManager.h
+    workers/shared/SharedWorkerObjectConnection.h
+    workers/shared/SharedWorkerProvider.h
     workers/shared/context/SharedWorkerThread.h
     workers/shared/context/SharedWorkerThreadProxy.h
 

Modified: trunk/Source/WebCore/Sources.txt (289053 => 289054)


--- trunk/Source/WebCore/Sources.txt	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebCore/Sources.txt	2022-02-03 15:21:42 UTC (rev 289054)
@@ -2786,6 +2786,8 @@
 workers/shared/SharedWorker.cpp
 workers/shared/SharedWorkerGlobalScope.cpp
 workers/shared/SharedWorkerManager.cpp
+workers/shared/SharedWorkerObjectConnection.cpp
+workers/shared/SharedWorkerProvider.cpp
 workers/shared/SharedWorkerScriptLoader.cpp
 workers/shared/context/SharedWorkerThread.cpp
 workers/shared/context/SharedWorkerThreadProxy.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (289053 => 289054)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2022-02-03 15:21:42 UTC (rev 289054)
@@ -1336,6 +1336,8 @@
 		4650AD1926FCCA650047F7AD /* WorkerThreadMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4650AD1726FCCA5A0047F7AD /* WorkerThreadMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		465307D01DB6EE4800E4137C /* JSUIEventInit.h in Headers */ = {isa = PBXBuildFile; fileRef = 83E045EF1DAA104F00B0D8B9 /* JSUIEventInit.h */; };
 		46658DC91FA24B8700F7DD54 /* SWContextManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 4672413B1FA24B140088BD6D /* SWContextManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		4668A0B627AB601B00C720BC /* SharedWorkerObjectConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 4668A0B127AB600B00C720BC /* SharedWorkerObjectConnection.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		4668A0B727AB602100C720BC /* SharedWorkerProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 4668A0B527AB600C00C720BC /* SharedWorkerProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		466C2DAD26C73AFC00651931 /* PolicyContainer.h in Headers */ = {isa = PBXBuildFile; fileRef = 466C2DAB26C73AFB00651931 /* PolicyContainer.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		466ED8D31EDE0144005E43F6 /* JSDOMRectList.h in Headers */ = {isa = PBXBuildFile; fileRef = 466ED8D21EDE0135005E43F6 /* JSDOMRectList.h */; };
 		4671E0661D67A59600C6B497 /* CanvasPath.h in Headers */ = {isa = PBXBuildFile; fileRef = 4671E0641D67A57B00C6B497 /* CanvasPath.h */; };
@@ -1345,7 +1347,7 @@
 		467A68D7275EA991009B31C5 /* SharedWorkerThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 467A68D4275EA98B009B31C5 /* SharedWorkerThread.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		467A68D8275EA995009B31C5 /* SharedWorkerScriptLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 467A68D5275EA98C009B31C5 /* SharedWorkerScriptLoader.h */; };
 		467A68D9275EA998009B31C5 /* SharedWorkerThreadProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 467A68D6275EA98C009B31C5 /* SharedWorkerThreadProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		467A68DA275EA99C009B31C5 /* SharedWorkerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 467A68D2275EA98A009B31C5 /* SharedWorkerManager.h */; };
+		467A68DA275EA99C009B31C5 /* SharedWorkerManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 467A68D2275EA98A009B31C5 /* SharedWorkerManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		4682D2001F79783000C863DB /* StoredCredentialsPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4682D1FF1F79782300C863DB /* StoredCredentialsPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		468344E01EDDFAAA00B7795B /* DOMRectList.h in Headers */ = {isa = PBXBuildFile; fileRef = 468344DE1EDDFA5F00B7795B /* DOMRectList.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		4683DF402767DF98007D00C8 /* JSShadowRealmGlobalScopeBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 4683DF3E2767DF98007D00C8 /* JSShadowRealmGlobalScopeBase.h */; };
@@ -9216,6 +9218,10 @@
 		465EDD9F222F4EC300B46E16 /* DeviceOrientationOrMotionPermissionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceOrientationOrMotionPermissionState.h; sourceTree = "<group>"; };
 		465EDDA0222F4EC400B46E16 /* DeviceOrientationOrMotionPermissionState.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DeviceOrientationOrMotionPermissionState.idl; sourceTree = "<group>"; };
 		466536FA264C8DD100AAD1D7 /* JSAudioNodeCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSAudioNodeCustom.cpp; sourceTree = "<group>"; };
+		4668A0B127AB600B00C720BC /* SharedWorkerObjectConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SharedWorkerObjectConnection.h; sourceTree = "<group>"; };
+		4668A0B327AB600B00C720BC /* SharedWorkerObjectConnection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SharedWorkerObjectConnection.cpp; sourceTree = "<group>"; };
+		4668A0B427AB600C00C720BC /* SharedWorkerProvider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SharedWorkerProvider.cpp; sourceTree = "<group>"; };
+		4668A0B527AB600C00C720BC /* SharedWorkerProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SharedWorkerProvider.h; sourceTree = "<group>"; };
 		46694CE02759448C00E3150E /* SharedWorkerGlobalScope.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = SharedWorkerGlobalScope.idl; sourceTree = "<group>"; };
 		46694CE12759448C00E3150E /* SharedWorkerGlobalScope.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SharedWorkerGlobalScope.h; sourceTree = "<group>"; };
 		46694CE22759448D00E3150E /* SharedWorker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SharedWorker.h; sourceTree = "<group>"; };
@@ -21583,6 +21589,10 @@
 				46EC444827AB337F00FFCD96 /* SharedWorkerIdentifier.h */,
 				467A68D3275EA98B009B31C5 /* SharedWorkerManager.cpp */,
 				467A68D2275EA98A009B31C5 /* SharedWorkerManager.h */,
+				4668A0B327AB600B00C720BC /* SharedWorkerObjectConnection.cpp */,
+				4668A0B127AB600B00C720BC /* SharedWorkerObjectConnection.h */,
+				4668A0B427AB600C00C720BC /* SharedWorkerProvider.cpp */,
+				4668A0B527AB600C00C720BC /* SharedWorkerProvider.h */,
 				467A68D1275EA98A009B31C5 /* SharedWorkerScriptLoader.cpp */,
 				467A68D5275EA98C009B31C5 /* SharedWorkerScriptLoader.h */,
 			);
@@ -37196,6 +37206,8 @@
 				41DC04FE27A83C93008CF968 /* SharedVideoFrameInfo.h in Headers */,
 				46EC444A27AB338900FFCD96 /* SharedWorkerIdentifier.h in Headers */,
 				467A68DA275EA99C009B31C5 /* SharedWorkerManager.h in Headers */,
+				4668A0B627AB601B00C720BC /* SharedWorkerObjectConnection.h in Headers */,
+				4668A0B727AB602100C720BC /* SharedWorkerProvider.h in Headers */,
 				467A68D8275EA995009B31C5 /* SharedWorkerScriptLoader.h in Headers */,
 				467A68D7275EA991009B31C5 /* SharedWorkerThread.h in Headers */,
 				467A68D9275EA998009B31C5 /* SharedWorkerThreadProxy.h in Headers */,

Modified: trunk/Source/WebCore/workers/shared/SharedWorker.cpp (289053 => 289054)


--- trunk/Source/WebCore/workers/shared/SharedWorker.cpp	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebCore/workers/shared/SharedWorker.cpp	2022-02-03 15:21:42 UTC (rev 289054)
@@ -32,6 +32,8 @@
 #include "MessagePort.h"
 #include "SecurityOrigin.h"
 #include "SharedWorkerManager.h"
+#include "SharedWorkerObjectConnection.h"
+#include "SharedWorkerProvider.h"
 #include "SharedWorkerThreadProxy.h"
 #include "WorkerOptions.h"
 #include <_javascript_Core/IdentifiersFactory.h>
@@ -41,8 +43,16 @@
 
 WTF_MAKE_ISO_ALLOCATED_IMPL(SharedWorker);
 
+static inline SharedWorkerObjectConnection* mainThreadConnection()
+{
+    return SharedWorkerProvider::singleton().sharedWorkerConnection();
+}
+
 ExceptionOr<Ref<SharedWorker>> SharedWorker::create(Document& document, JSC::RuntimeFlags runtimeFlags, String&& scriptURLString, std::optional<std::variant<String, WorkerOptions>>&& maybeOptions)
 {
+    if (!mainThreadConnection())
+        return Exception { NotSupportedError, "Shared workers are not supported" };
+
     if (!document.securityOrigin().canAccessSharedWorkers(document.topOrigin()))
         return Exception { SecurityError, "This iframe doesn't have storage access"_s };
 
@@ -70,7 +80,7 @@
     auto sharedWorker = adoptRef(*new SharedWorker(document, channel->port1(), runtimeFlags));
     sharedWorker->suspendIfNeeded();
 
-    SharedWorkerManager::singleton().connect(url, sharedWorker.get(), WTFMove(transferredPort), WTFMove(options));
+    mainThreadConnection()->requestSharedWorker(url, sharedWorker.get(), WTFMove(transferredPort), WTFMove(options));
     return sharedWorker;
 }
 

Modified: trunk/Source/WebCore/workers/shared/SharedWorkerManager.h (289053 => 289054)


--- trunk/Source/WebCore/workers/shared/SharedWorkerManager.h	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebCore/workers/shared/SharedWorkerManager.h	2022-02-03 15:21:42 UTC (rev 289054)
@@ -26,19 +26,22 @@
 #pragma once
 
 #include "MessagePortIdentifier.h"
-#include "SharedWorkerScriptLoader.h"
 
 namespace WebCore {
 
+class ScriptExecutionContext;
 class SharedWorker;
+class SharedWorkerScriptLoader;
 class ScriptBuffer;
 struct WorkerOptions;
 using TransferredMessagePort = std::pair<WebCore::MessagePortIdentifier, WebCore::MessagePortIdentifier>;
 
+using SharedWorkerScriptLoaderIdentifier = ObjectIdentifier<SharedWorkerScriptLoader>;
+
 class SharedWorkerManager {
 public:
-    static SharedWorkerManager& singleton();
-    void connect(const URL&, SharedWorker&, TransferredMessagePort&&, WorkerOptions&&);
+    WEBCORE_EXPORT static SharedWorkerManager& singleton();
+    WEBCORE_EXPORT void connect(const URL&, SharedWorker&, TransferredMessagePort&&, WorkerOptions&&);
 
     void scriptLoadFailed(SharedWorkerScriptLoader&);
     void scriptLoadedSuccessfully(SharedWorkerScriptLoader&, const ScriptBuffer&, ScriptExecutionContext&, SharedWorker&, TransferredMessagePort&&);

Copied: trunk/Source/WebCore/workers/shared/SharedWorkerObjectConnection.cpp (from rev 289053, trunk/Source/WebCore/workers/shared/SharedWorkerManager.h) (0 => 289054)


--- trunk/Source/WebCore/workers/shared/SharedWorkerObjectConnection.cpp	                        (rev 0)
+++ trunk/Source/WebCore/workers/shared/SharedWorkerObjectConnection.cpp	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 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 "SharedWorkerObjectConnection.h"
+
+namespace WebCore {
+
+SharedWorkerObjectConnection::SharedWorkerObjectConnection() = default;
+
+SharedWorkerObjectConnection::~SharedWorkerObjectConnection() = default;
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/workers/shared/SharedWorkerObjectConnection.h (from rev 289053, trunk/Source/WebCore/workers/shared/SharedWorkerManager.h) (0 => 289054)


--- trunk/Source/WebCore/workers/shared/SharedWorkerObjectConnection.h	                        (rev 0)
+++ trunk/Source/WebCore/workers/shared/SharedWorkerObjectConnection.h	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2022 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 "TransferredMessagePort.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class SharedWorker;
+struct WorkerOptions;
+
+class SharedWorkerObjectConnection : public RefCounted<SharedWorkerObjectConnection> {
+public:
+    WEBCORE_EXPORT virtual ~SharedWorkerObjectConnection();
+
+    virtual void requestSharedWorker(const URL&, SharedWorker&, TransferredMessagePort&&, WorkerOptions&&) = 0;
+
+protected:
+    WEBCORE_EXPORT SharedWorkerObjectConnection();
+};
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/workers/shared/SharedWorkerProvider.cpp (from rev 289053, trunk/Source/WebCore/workers/shared/SharedWorkerManager.h) (0 => 289054)


--- trunk/Source/WebCore/workers/shared/SharedWorkerProvider.cpp	                        (rev 0)
+++ trunk/Source/WebCore/workers/shared/SharedWorkerProvider.cpp	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2022 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 "SharedWorkerProvider.h"
+
+namespace WebCore {
+
+static SharedWorkerProvider* sharedProvider;
+
+// For WebKitLegacy.
+class DummySharedWorkerProvider final : public SharedWorkerProvider {
+public:
+    SharedWorkerObjectConnection* sharedWorkerConnection() final { return nullptr; }
+};
+
+SharedWorkerProvider& SharedWorkerProvider::singleton()
+{
+    if (!sharedProvider)
+        sharedProvider = new DummySharedWorkerProvider;
+    return *sharedProvider;
+}
+
+void SharedWorkerProvider::setSharedProvider(SharedWorkerProvider& newProvider)
+{
+    RELEASE_ASSERT(!sharedProvider);
+    sharedProvider = &newProvider;
+}
+
+} // namespace WebCore

Copied: trunk/Source/WebCore/workers/shared/SharedWorkerProvider.h (from rev 289053, trunk/Source/WebCore/workers/shared/SharedWorkerManager.h) (0 => 289054)


--- trunk/Source/WebCore/workers/shared/SharedWorkerProvider.h	                        (rev 0)
+++ trunk/Source/WebCore/workers/shared/SharedWorkerProvider.h	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2022 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
+
+namespace WebCore {
+
+class SharedWorkerObjectConnection;
+
+class SharedWorkerProvider {
+public:
+    static SharedWorkerProvider& singleton();
+    WEBCORE_EXPORT static void setSharedProvider(SharedWorkerProvider&);
+
+    virtual ~SharedWorkerProvider() { }
+    virtual SharedWorkerObjectConnection* sharedWorkerConnection() = 0;
+};
+
+} // namespace WebCore

Modified: trunk/Source/WebCore/workers/shared/SharedWorkerScriptLoader.h (289053 => 289054)


--- trunk/Source/WebCore/workers/shared/SharedWorkerScriptLoader.h	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebCore/workers/shared/SharedWorkerScriptLoader.h	2022-02-03 15:21:42 UTC (rev 289054)
@@ -40,7 +40,6 @@
 class WorkerScriptLoader;
 
 class SharedWorkerScriptLoader;
-using SharedWorkerScriptLoaderIdentifier = ObjectIdentifier<SharedWorkerScriptLoader>;
 
 using TransferredMessagePort = std::pair<WebCore::MessagePortIdentifier, WebCore::MessagePortIdentifier>;
 

Modified: trunk/Source/WebKit/ChangeLog (289053 => 289054)


--- trunk/Source/WebKit/ChangeLog	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebKit/ChangeLog	2022-02-03 15:21:42 UTC (rev 289054)
@@ -1,3 +1,29 @@
+2022-02-03  Chris Dumez  <[email protected]>
+
+        Start connecting SharedWorker to the WebKit2 layer
+        https://bugs.webkit.org/show_bug.cgi?id=236052
+
+        Reviewed by Darin Adler.
+
+        Start connecting SharedWorker to the WebKit2 layer with a provider / connection, similarly to what is done
+        for service workers.
+
+        * Sources.txt:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/Network/NetworkProcessConnection.cpp:
+        (WebKit::NetworkProcessConnection::sharedWorkerConnection):
+        * WebProcess/Network/NetworkProcessConnection.h:
+        * WebProcess/Storage/WebSharedWorkerObjectConnection.cpp: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
+        (WebKit::WebSharedWorkerObjectConnection::messageSenderConnection const):
+        (WebKit::WebSharedWorkerObjectConnection::requestSharedWorker):
+        * WebProcess/Storage/WebSharedWorkerObjectConnection.h: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
+        * WebProcess/Storage/WebSharedWorkerProvider.cpp: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
+        (WebKit::WebSharedWorkerProvider::singleton):
+        (WebKit::WebSharedWorkerProvider::sharedWorkerConnection):
+        * WebProcess/Storage/WebSharedWorkerProvider.h: Copied from Source/WebCore/workers/shared/SharedWorkerManager.h.
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::initializeWebProcess):
+
 2022-02-03  Per Arne Vollan  <[email protected]>
 
         [iOS][GPUP] Add access to sysctl property

Modified: trunk/Source/WebKit/Sources.txt (289053 => 289054)


--- trunk/Source/WebKit/Sources.txt	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebKit/Sources.txt	2022-02-03 15:21:42 UTC (rev 289054)
@@ -783,6 +783,8 @@
 WebProcess/Storage/WebSWOriginTable.cpp
 WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp
 WebProcess/Storage/WebServiceWorkerProvider.cpp
+WebProcess/Storage/WebSharedWorkerProvider.cpp
+WebProcess/Storage/WebSharedWorkerObjectConnection.cpp
 
 WebProcess/UserContent/WebUserContentController.cpp
 

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (289053 => 289054)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2022-02-03 15:21:42 UTC (rev 289054)
@@ -886,6 +886,8 @@
 		4659F25F275FF6B200BBB369 /* CaptivePortalModeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4659F25E275FF6B200BBB369 /* CaptivePortalModeObserver.h */; };
 		465F4E06230B2E95003CEDB7 /* StorageNamespaceIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 465F4E05230B2E7C003CEDB7 /* StorageNamespaceIdentifier.h */; };
 		465FA7262757D93D0072362B /* WebLockRegistryProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 465FA7232757D9180072362B /* WebLockRegistryProxy.h */; };
+		4668A0BC27AB605000C720BC /* WebSharedWorkerProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 4668A0BA27AB604000C720BC /* WebSharedWorkerProvider.h */; };
+		4668A0BD27AB605600C720BC /* WebSharedWorkerObjectConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 4668A0B827AB603F00C720BC /* WebSharedWorkerObjectConnection.h */; };
 		466BC03C1FA266DA002FA9C1 /* WebSWContextManagerConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 466BC0391FA266C9002FA9C1 /* WebSWContextManagerConnection.h */; };
 		4671FF1F23217EFF001B64C7 /* WebResourceLoadObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 4671FF1D23217EFF001B64C7 /* WebResourceLoadObserver.h */; };
 		467E43E82243FF7D00B13924 /* WebProcessDataStoreParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 467E43E72243FF6D00B13924 /* WebProcessDataStoreParameters.h */; };
@@ -4239,6 +4241,10 @@
 		465FA7232757D9180072362B /* WebLockRegistryProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebLockRegistryProxy.h; sourceTree = "<group>"; };
 		465FA7242757D9180072362B /* WebLockRegistryProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebLockRegistryProxy.messages.in; sourceTree = "<group>"; };
 		465FA7252757D9180072362B /* WebLockRegistryProxy.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebLockRegistryProxy.cpp; sourceTree = "<group>"; };
+		4668A0B827AB603F00C720BC /* WebSharedWorkerObjectConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebSharedWorkerObjectConnection.h; sourceTree = "<group>"; };
+		4668A0B927AB603F00C720BC /* WebSharedWorkerProvider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebSharedWorkerProvider.cpp; sourceTree = "<group>"; };
+		4668A0BA27AB604000C720BC /* WebSharedWorkerProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebSharedWorkerProvider.h; sourceTree = "<group>"; };
+		4668A0BB27AB604000C720BC /* WebSharedWorkerObjectConnection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebSharedWorkerObjectConnection.cpp; sourceTree = "<group>"; };
 		466BC0381FA266C9002FA9C1 /* WebSWContextManagerConnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSWContextManagerConnection.cpp; sourceTree = "<group>"; };
 		466BC0391FA266C9002FA9C1 /* WebSWContextManagerConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSWContextManagerConnection.h; sourceTree = "<group>"; };
 		466BC03A1FA266C9002FA9C1 /* WebSWContextManagerConnection.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebSWContextManagerConnection.messages.in; sourceTree = "<group>"; };
@@ -9454,6 +9460,10 @@
 				419ACF9B1F981D26009F1A83 /* WebServiceWorkerFetchTaskClient.h */,
 				51BEB6291F3A5ACD005029B9 /* WebServiceWorkerProvider.cpp */,
 				51BEB62A1F3A5ACD005029B9 /* WebServiceWorkerProvider.h */,
+				4668A0BB27AB604000C720BC /* WebSharedWorkerObjectConnection.cpp */,
+				4668A0B827AB603F00C720BC /* WebSharedWorkerObjectConnection.h */,
+				4668A0B927AB603F00C720BC /* WebSharedWorkerProvider.cpp */,
+				4668A0BA27AB604000C720BC /* WebSharedWorkerProvider.h */,
 				517A53031F4793B200DCDC0A /* WebSWClientConnection.cpp */,
 				517A53021F4793B200DCDC0A /* WebSWClientConnection.h */,
 				517A530C1F479E9700DCDC0A /* WebSWClientConnection.messages.in */,
@@ -13648,6 +13658,8 @@
 				7C361D731927FA360036A59D /* WebScriptMessageHandler.h in Headers */,
 				D3B9484911FF4B6500032B39 /* WebSearchPopupMenu.h in Headers */,
 				51BEB62C1F3A5AD7005029B9 /* WebServiceWorkerProvider.h in Headers */,
+				4668A0BD27AB605600C720BC /* WebSharedWorkerObjectConnection.h in Headers */,
+				4668A0BC27AB605000C720BC /* WebSharedWorkerProvider.h in Headers */,
 				5C8DD3801FE4521600F2A556 /* WebsiteAutoplayPolicy.h in Headers */,
 				1A4832D71A9CDF96008B4DFE /* WebsiteData.h in Headers */,
 				1A4832D11A9BDC2F008B4DFE /* WebsiteDataRecord.h in Headers */,

Modified: trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp (289053 => 289054)


--- trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp	2022-02-03 15:21:42 UTC (rev 289054)
@@ -57,6 +57,7 @@
 #include "WebSWContextManagerConnection.h"
 #include "WebSWContextManagerConnectionMessages.h"
 #include "WebServiceWorkerProvider.h"
+#include "WebSharedWorkerObjectConnection.h"
 #include "WebSocketChannel.h"
 #include "WebSocketChannelMessages.h"
 #include "WebSocketStream.h"
@@ -307,6 +308,13 @@
 }
 #endif
 
+WebSharedWorkerObjectConnection& NetworkProcessConnection::sharedWorkerConnection()
+{
+    if (!m_sharedWorkerConnection)
+        m_sharedWorkerConnection = WebSharedWorkerObjectConnection::create();
+    return *m_sharedWorkerConnection;
+}
+
 void NetworkProcessConnection::messagesAvailableForPort(const WebCore::MessagePortIdentifier& messagePortIdentifier)
 {
     WebProcess::singleton().messagesAvailableForPort(messagePortIdentifier);

Modified: trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h (289053 => 289054)


--- trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.h	2022-02-03 15:21:42 UTC (rev 289054)
@@ -49,6 +49,7 @@
 
 class WebIDBConnectionToServer;
 class WebSWClientConnection;
+class WebSharedWorkerObjectConnection;
 
 class NetworkProcessConnection : public RefCounted<NetworkProcessConnection>, IPC::Connection::Client {
 public:
@@ -70,6 +71,7 @@
 #if ENABLE(SERVICE_WORKER)
     WebSWClientConnection& serviceWorkerConnection();
 #endif
+    WebSharedWorkerObjectConnection& sharedWorkerConnection();
 
 #if HAVE(AUDIT_TOKEN)
     void setNetworkProcessAuditToken(std::optional<audit_token_t> auditToken) { m_networkProcessAuditToken = auditToken; }
@@ -123,6 +125,7 @@
 #if ENABLE(SERVICE_WORKER)
     RefPtr<WebSWClientConnection> m_swConnection;
 #endif
+    RefPtr<WebSharedWorkerObjectConnection> m_sharedWorkerConnection;
     WebCore::HTTPCookieAcceptPolicy m_cookieAcceptPolicy;
 };
 

Copied: trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerObjectConnection.cpp (from rev 289053, trunk/Source/WebCore/workers/shared/SharedWorkerManager.h) (0 => 289054)


--- trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerObjectConnection.cpp	                        (rev 0)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerObjectConnection.cpp	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2022 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 "WebSharedWorkerObjectConnection.h"
+
+#include "NetworkProcessConnection.h"
+#include "WebProcess.h"
+#include <WebCore/SharedWorkerManager.h>
+
+namespace WebKit {
+
+WebSharedWorkerObjectConnection::WebSharedWorkerObjectConnection() = default;
+
+IPC::Connection* WebSharedWorkerObjectConnection::messageSenderConnection() const
+{
+    return &WebProcess::singleton().ensureNetworkProcessConnection().connection();
+}
+
+void WebSharedWorkerObjectConnection::requestSharedWorker(const URL& url, WebCore::SharedWorker& sharedWorker, WebCore::TransferredMessagePort&& port, WebCore::WorkerOptions&& workerOptions)
+{
+    // FIXME: Should send IPC to the network process.
+    WebCore::SharedWorkerManager::singleton().connect(url, sharedWorker, WTFMove(port), WTFMove(workerOptions));
+}
+
+} // namespace WebKit

Copied: trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerObjectConnection.h (from rev 289053, trunk/Source/WebCore/workers/shared/SharedWorkerManager.h) (0 => 289054)


--- trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerObjectConnection.h	                        (rev 0)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerObjectConnection.h	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2022 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 "MessageSender.h"
+#include <WebCore/SharedWorkerObjectConnection.h>
+
+namespace WebKit {
+
+class WebSharedWorkerObjectConnection final : public WebCore::SharedWorkerObjectConnection, private IPC::MessageSender {
+public:
+    static Ref<WebSharedWorkerObjectConnection> create() { return adoptRef(*new WebSharedWorkerObjectConnection); }
+
+private:
+    WebSharedWorkerObjectConnection();
+
+    // WebCore::SharedWorkerObjectConnection.
+    void requestSharedWorker(const URL&, WebCore::SharedWorker&, WebCore::TransferredMessagePort&&, WebCore::WorkerOptions&&) final;
+
+    // IPC::MessageSender.
+    IPC::Connection* messageSenderConnection() const final;
+    uint64_t messageSenderDestinationID() const final { return 0; }
+};
+
+} // namespace WebKit

Copied: trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerProvider.cpp (from rev 289053, trunk/Source/WebCore/workers/shared/SharedWorkerManager.h) (0 => 289054)


--- trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerProvider.cpp	                        (rev 0)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerProvider.cpp	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2022 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 "WebSharedWorkerProvider.h"
+
+#include "NetworkProcessConnection.h"
+#include "WebProcess.h"
+#include "WebSharedWorkerObjectConnection.h"
+
+namespace WebKit {
+
+WebSharedWorkerProvider& WebSharedWorkerProvider::singleton()
+{
+    static NeverDestroyed<WebSharedWorkerProvider> provider;
+    return provider;
+}
+
+WebSharedWorkerProvider::WebSharedWorkerProvider() = default;
+
+WebCore::SharedWorkerObjectConnection* WebSharedWorkerProvider::sharedWorkerConnection()
+{
+    return &WebProcess::singleton().ensureNetworkProcessConnection().sharedWorkerConnection();
+}
+
+} // namespace WebKit

Copied: trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerProvider.h (from rev 289053, trunk/Source/WebCore/workers/shared/SharedWorkerManager.h) (0 => 289054)


--- trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerProvider.h	                        (rev 0)
+++ trunk/Source/WebKit/WebProcess/Storage/WebSharedWorkerProvider.h	2022-02-03 15:21:42 UTC (rev 289054)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2022 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 <WebCore/SharedWorkerProvider.h>
+#include <wtf/NeverDestroyed.h>
+
+namespace WebKit {
+
+class WebSharedWorkerProvider final : public WebCore::SharedWorkerProvider {
+public:
+    static WebSharedWorkerProvider& singleton();
+
+private:
+    friend NeverDestroyed<WebSharedWorkerProvider>;
+    WebSharedWorkerProvider();
+
+    WebCore::SharedWorkerObjectConnection* sharedWorkerConnection() final;
+};
+
+} // namespace WebKit

Modified: trunk/Source/WebKit/WebProcess/WebProcess.cpp (289053 => 289054)


--- trunk/Source/WebKit/WebProcess/WebProcess.cpp	2022-02-03 15:19:27 UTC (rev 289053)
+++ trunk/Source/WebKit/WebProcess/WebProcess.cpp	2022-02-03 15:21:42 UTC (rev 289054)
@@ -84,6 +84,7 @@
 #include "WebSWContextManagerConnection.h"
 #include "WebSWContextManagerConnectionMessages.h"
 #include "WebServiceWorkerProvider.h"
+#include "WebSharedWorkerProvider.h"
 #include "WebSocketStream.h"
 #include "WebsiteData.h"
 #include "WebsiteDataStoreParameters.h"
@@ -569,6 +570,7 @@
 #if ENABLE(SERVICE_WORKER)
     ServiceWorkerProvider::setSharedProvider(WebServiceWorkerProvider::singleton());
 #endif
+    SharedWorkerProvider::setSharedProvider(WebSharedWorkerProvider::singleton());
 
 #if ENABLE(WEBASSEMBLY)
     JSC::Wasm::enableFastMemory();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to