Bug 1880383 [wpt PR 44596] - [shared storage] Support cross-origin worklet, a=testonly
commit9146501826ecc2b6be3e69177f6de9cc2fed1b30
authorYao Xiao <yaoxia@chromium.org>
Wed, 28 Feb 2024 08:40:58 +0000 (28 08:40 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Fri, 1 Mar 2024 20:10:32 +0000 (1 20:10 +0000)
treef98a91f9bff1d7b1a352f038f4a47e41239822b6
parente6442c884f5d869f28f7c419630990eb67723e91
Bug 1880383 [wpt PR 44596] - [shared storage] Support cross-origin worklet, a=testonly

Automatic update from web-platform-tests
[shared storage] Support cross-origin worklet

For the sharedStorage.createWorklet() API, relax the same-origin
restriction to additionally allow cross-origin script, in which case
a cross-origin worklet will be created.

How:
- Rely on CORS for the worklet to be created/used by the embedder.
- In general, we want to mimic the subframe's process allocation
behavior (i.e. it should end up using a process as if an iframe is
created with the script URL). It leverages the process allocation
and management logic from service workers and re-use SiteInstanceImpl::CreateForServiceWorker(). To keep this
CL focused, the refactoring will occur in a separate CL, as it
will involve refactoring other downstream components like
'UnmatchedServiceWorkerProcessTracker'.

Explainer: https://github.com/WICG/shared-storage/pull/130
Spec: https://github.com/WICG/shared-storage/pull/131
Design doc:
https://docs.google.com/document/d/1QTaaroCMeFVZVghI6JkUcDvmDQEacjvpyTfk6mpvQhA/edit?usp=sharing

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5296843
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1265583}

--

wpt-commits: e8e7749139ca3a1bd1048d50966b3069e07a3f7e
wpt-pr: 44596
testing/web-platform/tests/shared-storage/cross-origin-create-worklet-credentials-include.tentative.https.sub.html [new file with mode: 0644]
testing/web-platform/tests/shared-storage/cross-origin-create-worklet-credentials-omit.tentative.https.sub.html [new file with mode: 0644]
testing/web-platform/tests/shared-storage/cross-origin-create-worklet-credentials-same-origin.tentative.https.sub.html [new file with mode: 0644]
testing/web-platform/tests/shared-storage/cross-origin-create-worklet-failure-missing-access-control-allow-credentials.tentative.https.sub.html [new file with mode: 0644]
testing/web-platform/tests/shared-storage/cross-origin-create-worklet-failure-missing-access-control-allow-origin.tentative.https.sub.html [new file with mode: 0644]
testing/web-platform/tests/shared-storage/resources/credentials-test-helper.py