Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

Explainer update: Support multiple & cross-origin worklets - #130

Merged
xyaoinum merged 4 commits into
mainfrom
yao
Feb 5, 2024
Merged

xyaoinum merged 4 commits into
mainfrom
yao

Conversation

@xyaoinum

Copy link
Copy Markdown
Collaborator
  • selectURL() and run() will be exposed to the shared storage worklet object. When calling on the default scoped worklet (i.e. sharedStorage.worklet.selectURL()/run()), the behavior is equivalent to sharedStorage.selectURL()/run().
  • Users can create new worklets via const worklet = await sharedStorage.createWorklet(url, options). This can be used to start multiple and potentially cross-origin worklets from a single document.

- selectURL() and run() will be exposed to the shared storage worklet object. When calling on the default scoped worklet (i.e. sharedStorage.worklet.selectURL()/run()), the behavior is equivalent to sharedStorage.selectURL()/run().
- Users can create new worklets via `const worklet = await sharedStorage.createWorklet(url, options)`. This can be used to start multiple and potentially cross-origin worklets from a single document.
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 18, 2024
Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 18, 2024
Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 18, 2024
Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12

@pythagoraskitty pythagoraskitty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM % comments

Comment thread README.md Resolved
Comment thread README.md Resolved
@xyaoinum

Copy link
Copy Markdown
Collaborator Author

Thanks for the review Cammie! I will wait to merge this until we receive CMA approval.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jan 31, 2024
Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 1, 2024
Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
@xyaoinum
xyaoinum merged commit cf04543 into main Feb 5, 2024
@xyaoinum
xyaoinum deleted the yao branch February 5, 2024 17:23
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 5, 2024
Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 5, 2024
Explainer PR: WICG/shared-storage#130

How:
- Introduce sharedStorage.createWorklet() method. In this patch,
we still restrict the script to same origin. Ultimately, we will
support cross-origin script/worklet (for the createWorklet() API).
- Also, move the document service Remote to a window supplement
class: This is a forward-looking change (e.g. it'll enable
constructing the worklet via `new SharedStorageWorklet()` / not
needing the `sharedStorage` object at all, although this isn't
in the current proposal).

Bug: 1218540
Change-Id: I5bf64bdf6648a76875748b194e5dbceeb1400624
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 5, 2024
Explainer PR: WICG/shared-storage#130

How:
- Introduce sharedStorage.createWorklet() method. In this patch,
we still restrict the script to same origin. Ultimately, we will
support cross-origin script/worklet (for the createWorklet() API).
- Also, move the document service Remote to a window supplement
class: This is a forward-looking change (e.g. it'll enable
constructing the worklet via `new SharedStorageWorklet()` / not
needing to be coupled `sharedStorage`, although this isn't in the
current proposal).

Bug: 1218540
Change-Id: I5bf64bdf6648a76875748b194e5dbceeb1400624
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 6, 2024
Explainer PR: WICG/shared-storage#130

How:
- Introduce sharedStorage.createWorklet() method. In this patch,
we still restrict the script to same origin. Ultimately, we will
support cross-origin script/worklet (for the createWorklet() API).
- Also, move the document service Remote to a window supplement
class: This is a forward-looking change (e.g. it'll enable
constructing the worklet via `new SharedStorageWorklet()` / not
needing to be coupled `sharedStorage`, although this isn't in the
current proposal).

Bug: 1218540
Change-Id: I5bf64bdf6648a76875748b194e5dbceeb1400624
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 6, 2024
… interface

Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 6, 2024
Explainer PR: WICG/shared-storage#130

How:
- Introduce sharedStorage.createWorklet() method. In this patch,
we still restrict the script to same origin. Ultimately, we will
support cross-origin script/worklet (for the createWorklet() API).
- Also, move the document service Remote to a window supplement
class: This is a forward-looking change (e.g. it'll enable
constructing the worklet via `new SharedStorageWorklet()` / not
needing to exist along with the `sharedStorage` object, although
this isn't in the current proposal).

Bug: 1218540
Change-Id: I5bf64bdf6648a76875748b194e5dbceeb1400624
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 6, 2024
… interface

Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 6, 2024
… interface

Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 6, 2024
… interface

Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 6, 2024
Explainer PR: WICG/shared-storage#130

How:
- Introduce sharedStorage.createWorklet() method. In this patch,
we still restrict the script to same origin. Ultimately, we will
support cross-origin script/worklet (for the createWorklet() API).
- Also, move the document service Remote to a window supplement
class: This is a forward-looking change (e.g. it'll enable
constructing the worklet via `new SharedStorageWorklet()` / not
needing to exist along with the `sharedStorage` object, although
this isn't in the current proposal).

Bug: 1218540
Change-Id: I5bf64bdf6648a76875748b194e5dbceeb1400624
aarongable pushed a commit to chromium/chromium that referenced this pull request Feb 6, 2024
… interface

Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209512
Commit-Queue: Yao Xiao <[email protected]>
Reviewed-by: Dominic Farolino <[email protected]>
Reviewed-by: Cammie Smith Barnes <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1256903}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 6, 2024
… interface

Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209512
Commit-Queue: Yao Xiao <[email protected]>
Reviewed-by: Dominic Farolino <[email protected]>
Reviewed-by: Cammie Smith Barnes <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1256903}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 6, 2024
… interface

Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209512
Commit-Queue: Yao Xiao <[email protected]>
Reviewed-by: Dominic Farolino <[email protected]>
Reviewed-by: Cammie Smith Barnes <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1256903}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 7, 2024
Explainer PR: WICG/shared-storage#130

How:
- Introduce sharedStorage.createWorklet() method. In this patch,
we still restrict the script to same origin. Ultimately, we will
support cross-origin script/worklet (for the createWorklet() API).
- Also, move the document service Remote to a window supplement
class: This is a forward-looking change (e.g. it'll enable
constructing the worklet via `new SharedStorageWorklet()` / not
needing to exist along with the `sharedStorage` object, although
this isn't in the current proposal).

Bug: 1218540
Change-Id: I5bf64bdf6648a76875748b194e5dbceeb1400624
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 15, 2024
For the sharedStorage.createWorklet() API, relax the same-origin
restriction to allow cross-origin script, in which case a
cross-origin worklet will be created.

How:
- Rely on CORS for the worklet to be loaded/used by the embedder.
- Leverage the existing process allocation and management logic from
service workers and directly re-use SiteInstanceImpl::CreateForServiceWorker(). To keep this CL focused,
renaming will occur in a separate CL, as it will involve renaming
other downstream components like
'UnmatchedServiceWorkerProcessTracker'.

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

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 15, 2024
For the sharedStorage.createWorklet() API, relax the same-origin
restriction to allow cross-origin script, in which case a
cross-origin worklet will be created.

How:
- Rely on CORS for the worklet to be loaded/used by the embedder.
- Leverage the existing process allocation and management logic from
service workers and directly re-use SiteInstanceImpl::CreateForServiceWorker(). To keep this CL focused,
renaming will occur in a separate CL, as it will involve renaming
other downstream components like
'UnmatchedServiceWorkerProcessTracker'.

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

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 15, 2024
For the sharedStorage.createWorklet() API, relax the same-origin
restriction to allow cross-origin script, in which case a
cross-origin worklet will be created.

How:
- Rely on CORS for the worklet to be loaded/used by the embedder.
- Leverage the existing process allocation and management logic from
service workers and directly re-use SiteInstanceImpl::CreateForServiceWorker(). To keep this CL focused,
renaming will occur in a separate CL, as it will involve renaming
other downstream components like
'UnmatchedServiceWorkerProcessTracker'.

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

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 15, 2024
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 loaded/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 first checks to see whether we can
reuse the worklet's creator frame's SiteInstance. If so, use it.
Otherwise, leverage 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 renaming other downstream components like
'UnmatchedServiceWorkerProcessTracker'.

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

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Feb 15, 2024
…) on the SharedStorageWorklet interface, a=testonly

Automatic update from web-platform-tests
[shared storage] Expose selectURL()/run() on the SharedStorageWorklet interface

Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209512
Commit-Queue: Yao Xiao <[email protected]>
Reviewed-by: Dominic Farolino <[email protected]>
Reviewed-by: Cammie Smith Barnes <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1256903}

--

wpt-commits: aeff916bfb418f93a6d2a25fc90ae9060df5cc30
wpt-pr: 44059
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Feb 15, 2024
… worklets per Window context, a=testonly

Automatic update from web-platform-tests
[shared storage] Allow creating multiple worklets per Window context

Explainer PR: WICG/shared-storage#130

How:
- Introduce sharedStorage.createWorklet() method. In this patch,
we still restrict the script to same origin. Ultimately, we will
support cross-origin script/worklet (for the createWorklet() API).
- Also, move the document service Remote to a window supplement
class: This is a forward-looking change (e.g. it'll enable
constructing the worklet via `new SharedStorageWorklet()` / not
needing to exist along with the `sharedStorage` object, although
this isn't in the current proposal).

Bug: 1218540
Change-Id: I5bf64bdf6648a76875748b194e5dbceeb1400624
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209102
Reviewed-by: Dominic Farolino <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
Reviewed-by: Cammie Smith Barnes <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1257412}

--

wpt-commits: a973f277c12becac99d26f79d1a51e3f2efd452a
wpt-pr: 44060
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 15, 2024
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 loaded/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 first checks to see whether we can
reuse the worklet's creator frame's SiteInstance. If so, use it.
Otherwise, leverage 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 renaming other downstream components like
'UnmatchedServiceWorkerProcessTracker'.

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

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 15, 2024
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 first checks to see whether we can
reuse the worklet's creator frame's SiteInstance. If so, use it.
Otherwise, leverage 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: WICG/shared-storage#130
Spec: WICG/shared-storage#131
Design doc:
https://docs.google.com/document/d/1QTaaroCMeFVZVghI6JkUcDvmDQEacjvpyTfk6mpvQhA/edit?usp=sharing

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 15, 2024
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 first checks to see whether we can
reuse the worklet's creator frame's SiteInstance. If so, use it.
Otherwise, leverage 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: WICG/shared-storage#130
Spec: WICG/shared-storage#131
Design doc:
https://docs.google.com/document/d/1QTaaroCMeFVZVghI6JkUcDvmDQEacjvpyTfk6mpvQhA/edit?usp=sharing

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 15, 2024
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 first checks to see whether we can
reuse the worklet's creator frame's SiteInstance. If so, use it.
Otherwise, leverage 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: WICG/shared-storage#130
Spec: WICG/shared-storage#131
Design doc:
https://docs.google.com/document/d/1QTaaroCMeFVZVghI6JkUcDvmDQEacjvpyTfk6mpvQhA/edit?usp=sharing

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Feb 16, 2024
…) on the SharedStorageWorklet interface, a=testonly

Automatic update from web-platform-tests
[shared storage] Expose selectURL()/run() on the SharedStorageWorklet interface

Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209512
Commit-Queue: Yao Xiao <yaoxiachromium.org>
Reviewed-by: Dominic Farolino <domchromium.org>
Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
Cr-Commit-Position: refs/heads/main{#1256903}

--

wpt-commits: aeff916bfb418f93a6d2a25fc90ae9060df5cc30
wpt-pr: 44059

UltraBlame original commit: 85b2ef029188fb90f2200ae728902eccf3e2426e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Feb 16, 2024
… worklets per Window context, a=testonly

Automatic update from web-platform-tests
[shared storage] Allow creating multiple worklets per Window context

Explainer PR: WICG/shared-storage#130

How:
- Introduce sharedStorage.createWorklet() method. In this patch,
we still restrict the script to same origin. Ultimately, we will
support cross-origin script/worklet (for the createWorklet() API).
- Also, move the document service Remote to a window supplement
class: This is a forward-looking change (e.g. it'll enable
constructing the worklet via `new SharedStorageWorklet()` / not
needing to exist along with the `sharedStorage` object, although
this isn't in the current proposal).

Bug: 1218540
Change-Id: I5bf64bdf6648a76875748b194e5dbceeb1400624
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209102
Reviewed-by: Dominic Farolino <domchromium.org>
Reviewed-by: Avi Drissman <avichromium.org>
Commit-Queue: Yao Xiao <yaoxiachromium.org>
Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
Cr-Commit-Position: refs/heads/main{#1257412}

--

wpt-commits: a973f277c12becac99d26f79d1a51e3f2efd452a
wpt-pr: 44060

UltraBlame original commit: 5ed9382533b39c9e8af6813ef208aa4751249561
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Feb 20, 2024
…) on the SharedStorageWorklet interface, a=testonly

Automatic update from web-platform-tests
[shared storage] Expose selectURL()/run() on the SharedStorageWorklet interface

Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209512
Commit-Queue: Yao Xiao <yaoxiachromium.org>
Reviewed-by: Dominic Farolino <domchromium.org>
Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
Cr-Commit-Position: refs/heads/main{#1256903}

--

wpt-commits: aeff916bfb418f93a6d2a25fc90ae9060df5cc30
wpt-pr: 44059

UltraBlame original commit: 85b2ef029188fb90f2200ae728902eccf3e2426e
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Feb 20, 2024
… worklets per Window context, a=testonly

Automatic update from web-platform-tests
[shared storage] Allow creating multiple worklets per Window context

Explainer PR: WICG/shared-storage#130

How:
- Introduce sharedStorage.createWorklet() method. In this patch,
we still restrict the script to same origin. Ultimately, we will
support cross-origin script/worklet (for the createWorklet() API).
- Also, move the document service Remote to a window supplement
class: This is a forward-looking change (e.g. it'll enable
constructing the worklet via `new SharedStorageWorklet()` / not
needing to exist along with the `sharedStorage` object, although
this isn't in the current proposal).

Bug: 1218540
Change-Id: I5bf64bdf6648a76875748b194e5dbceeb1400624
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209102
Reviewed-by: Dominic Farolino <domchromium.org>
Reviewed-by: Avi Drissman <avichromium.org>
Commit-Queue: Yao Xiao <yaoxiachromium.org>
Reviewed-by: Cammie Smith Barnes <cammiechromium.org>
Cr-Commit-Position: refs/heads/main{#1257412}

--

wpt-commits: a973f277c12becac99d26f79d1a51e3f2efd452a
wpt-pr: 44060

UltraBlame original commit: 5ed9382533b39c9e8af6813ef208aa4751249561
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 23, 2024
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 first checks to see whether we can
reuse the worklet's creator frame's SiteInstance. If so, use it.
Otherwise, leverage 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: WICG/shared-storage#130
Spec: WICG/shared-storage#131
Design doc:
https://docs.google.com/document/d/1QTaaroCMeFVZVghI6JkUcDvmDQEacjvpyTfk6mpvQhA/edit?usp=sharing

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 23, 2024
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: WICG/shared-storage#130
Spec: WICG/shared-storage#131
Design doc:
https://docs.google.com/document/d/1QTaaroCMeFVZVghI6JkUcDvmDQEacjvpyTfk6mpvQhA/edit?usp=sharing

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
marcoscaceres pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 23, 2024
… interface

Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209512
Commit-Queue: Yao Xiao <[email protected]>
Reviewed-by: Dominic Farolino <[email protected]>
Reviewed-by: Cammie Smith Barnes <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1256903}
marcoscaceres pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 23, 2024
Explainer PR: WICG/shared-storage#130

How:
- Introduce sharedStorage.createWorklet() method. In this patch,
we still restrict the script to same origin. Ultimately, we will
support cross-origin script/worklet (for the createWorklet() API).
- Also, move the document service Remote to a window supplement
class: This is a forward-looking change (e.g. it'll enable
constructing the worklet via `new SharedStorageWorklet()` / not
needing to exist along with the `sharedStorage` object, although
this isn't in the current proposal).

Bug: 1218540
Change-Id: I5bf64bdf6648a76875748b194e5dbceeb1400624
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209102
Reviewed-by: Dominic Farolino <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
Reviewed-by: Cammie Smith Barnes <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1257412}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 26, 2024
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: WICG/shared-storage#130
Spec: WICG/shared-storage#131
Design doc:
https://docs.google.com/document/d/1QTaaroCMeFVZVghI6JkUcDvmDQEacjvpyTfk6mpvQhA/edit?usp=sharing

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 27, 2024
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: WICG/shared-storage#130
Spec: WICG/shared-storage#131
Design doc:
https://docs.google.com/document/d/1QTaaroCMeFVZVghI6JkUcDvmDQEacjvpyTfk6mpvQhA/edit?usp=sharing

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
aarongable pushed a commit to chromium/chromium that referenced this pull request Feb 27, 2024
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: WICG/shared-storage#130
Spec: WICG/shared-storage#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 <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1265583}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 27, 2024
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: WICG/shared-storage#130
Spec: WICG/shared-storage#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 <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1265583}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 27, 2024
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: WICG/shared-storage#130
Spec: WICG/shared-storage#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 <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1265583}
aarongable pushed a commit to chromium/chromium that referenced this pull request Feb 28, 2024
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: WICG/shared-storage#130
Spec: WICG/shared-storage#131
Design doc:
https://docs.google.com/document/d/1QTaaroCMeFVZVghI6JkUcDvmDQEacjvpyTfk6mpvQhA/edit?usp=sharing

(cherry picked from commit 6480d8c)

Bug: 325302836
Change-Id: I11c1fc87bc76f4400c54d9fa809349d1d1781247
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5296843
Reviewed-by: Alex Moshchuk <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
Cr-Original-Commit-Position: refs/heads/main@{#1265583}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5331494
Cr-Commit-Position: refs/branch-heads/6312@{#263}
Cr-Branched-From: 6711dcd-refs/heads/main@{#1262506}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Mar 2, 2024
…rklet, 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: WICG/shared-storage#130
Spec: WICG/shared-storage#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 <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1265583}

--

wpt-commits: e8e7749139ca3a1bd1048d50966b3069e07a3f7e
wpt-pr: 44596
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Mar 4, 2024
…rklet, 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: WICG/shared-storage#130
Spec: WICG/shared-storage#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 <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1265583}

--

wpt-commits: e8e7749139ca3a1bd1048d50966b3069e07a3f7e
wpt-pr: 44596
@jkarlin

jkarlin commented Apr 19, 2024

Copy link
Copy Markdown
Collaborator

Applies to issue #2

jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…) on the SharedStorageWorklet interface, a=testonly

Automatic update from web-platform-tests
[shared storage] Expose selectURL()/run() on the SharedStorageWorklet interface

Explainer PR: WICG/shared-storage#130

Bug: 1218540
Change-Id: I7dffe4e026a6ebf4e6705b1df43e2baf01dadb12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209512
Commit-Queue: Yao Xiao <[email protected]>
Reviewed-by: Dominic Farolino <[email protected]>
Reviewed-by: Cammie Smith Barnes <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1256903}

--

wpt-commits: aeff916bfb418f93a6d2a25fc90ae9060df5cc30
wpt-pr: 44059
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
… worklets per Window context, a=testonly

Automatic update from web-platform-tests
[shared storage] Allow creating multiple worklets per Window context

Explainer PR: WICG/shared-storage#130

How:
- Introduce sharedStorage.createWorklet() method. In this patch,
we still restrict the script to same origin. Ultimately, we will
support cross-origin script/worklet (for the createWorklet() API).
- Also, move the document service Remote to a window supplement
class: This is a forward-looking change (e.g. it'll enable
constructing the worklet via `new SharedStorageWorklet()` / not
needing to exist along with the `sharedStorage` object, although
this isn't in the current proposal).

Bug: 1218540
Change-Id: I5bf64bdf6648a76875748b194e5dbceeb1400624
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5209102
Reviewed-by: Dominic Farolino <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
Reviewed-by: Cammie Smith Barnes <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1257412}

--

wpt-commits: a973f277c12becac99d26f79d1a51e3f2efd452a
wpt-pr: 44060
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…rklet, 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: WICG/shared-storage#130
Spec: WICG/shared-storage#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 <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1265583}

--

wpt-commits: e8e7749139ca3a1bd1048d50966b3069e07a3f7e
wpt-pr: 44596
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants