Skip to content

Commit bb3f568

Browse files
authored
Implement "owners" in dedicated workers (#621)
1 parent b6adb45 commit bb3f568

File tree

1 file changed

+37
-10
lines changed

1 file changed

+37
-10
lines changed

index.bs

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,17 @@ spec: HTML; urlPrefix: https://html.spec.whatwg.org/multipage/
191191
text: report an error; url: webappapis.html#report-the-error
192192
text: run the animation frame callbacks; url: imagebitmap-and-animations.html#run-the-animation-frame-callbacks
193193
text: same origin domain; url: browsers.html#same-origin-domain
194-
text: session history; url: history.html#session-history
195194
text: session history entry; url: browsing-the-web.html#session-history-entry
196195
text: session history traversal queue; url: document-sequences.html#tn-session-history-traversal-queue
196+
text: session history; url: history.html#session-history
197197
text: set up a window environment settings object; url: window-object.html#set-up-a-window-environment-settings-object
198198
text: set up a worker environment settings object; url: workers.html#set-up-a-worker-environment-settings-object
199199
text: set up a worklet environment settings object; url: worklets.html#set-up-a-worklet-environment-settings-object
200200
text: shared worker; url: workers.html#shared-workers
201201
text: system visibility state; url: document-sequences.html#system-visibility-state
202202
text: traversable navigable; url:document-sequences.html#traversable-navigable
203-
text: visible; url: document-sequences.html#system-visibility-state
204203
text: traverse the history by a delta; url: browsing-the-web.html#traverse-the-history-by-a-delta
204+
text: visible; url: document-sequences.html#system-visibility-state
205205
text: window open steps; url: window-object.html#window-open-steps
206206
text: worker event loop; url: webappapis.html#worker-event-loop-2
207207
text: worklet global scopes; url:worklets.html#concept-document-worklet-global-scopes
@@ -7037,17 +7037,20 @@ script.WindowRealmInfo = {
70377037

70387038
script.DedicatedWorkerRealmInfo = {
70397039
script.BaseRealmInfo,
7040-
type: "dedicated-worker"
7040+
type: "dedicated-worker",
7041+
owners: [script.Realm]
70417042
}
70427043

70437044
script.SharedWorkerRealmInfo = {
70447045
script.BaseRealmInfo,
7045-
type: "shared-worker"
7046+
type: "shared-worker",
7047+
owners: [+script.Realm]
70467048
}
70477049

70487050
script.ServiceWorkerRealmInfo = {
70497051
script.BaseRealmInfo,
70507052
type: "service-worker"
7053+
owners: [*script.Realm]
70517054
}
70527055

70537056
script.WorkerRealmInfo = {
@@ -7090,6 +7093,25 @@ To <dfn>get the browsing context</dfn> with given |realm|:
70907093

70917094
1. Return |document|'s [=/browsing context=].
70927095

7096+
</div>
7097+
<div algorithm>
7098+
To <dfn>get the worker's owners</dfn> with given |global object|:
7099+
7100+
1. Assert: |global object| is a {{WorkerGlobalScope}} object.
7101+
7102+
1. Let |owners| be an empty [=/list=].
7103+
7104+
1. For each |owner| in the |global object|'s associated [=owner set=]:
7105+
7106+
1. Let |owner environment settings| be |owner|'s [=relevant settings object=].
7107+
7108+
1. Let |owner realm info| be the result of [=get the realm info=] given
7109+
|owner environment settings|.
7110+
7111+
1. Append |owner realm info|["<code>id</code>"] to |owners|.
7112+
7113+
1. Return |owners|.
7114+
70937115
</div>
70947116

70957117
<div algorithm>
@@ -7135,21 +7157,26 @@ To <dfn>get the realm info</dfn> given |environment settings|:
71357157

71367158
<dt>|global object| is a {{DedicatedWorkerGlobalScope}} object
71377159
<dd>
7160+
1. Let |owners| be the result of [=get the worker's owners=] given |global object|.
7161+
1. Assert: |owners| has precisely one item.
71387162
1. Let |realm info| be a [=/map=] matching the <code>script.DedicatedWorkerRealmInfo</code> production,
7139-
with the <code>realm</code> field set to |realm id|, and the <code>origin</code> field
7140-
set to |origin|.
7163+
with the <code>realm</code> field set to |realm id|, the <code>origin</code> field
7164+
set to |origin|, and the <code>owners</code> field set to |owners|.
71417165

71427166
<dt>|global object| is a {{SharedWorkerGlobalScope}} object
71437167
<dd>
7168+
1. Let |owners| be the result of [=get the worker's owners=] given |global object|.
7169+
1. Assert: |owners| has at least one item.
71447170
1. Let |realm info| be a [=/map=] matching the <code>script.SharedWorkerRealmInfo</code> production,
7145-
with the <code>realm</code> field set to |realm id|, and the <code>origin</code>
7146-
field set to |origin|.
7171+
with the <code>realm</code> field set to |realm id|, the <code>origin</code> field
7172+
set to |origin|, and the <code>owners</code> field set to |owners|.
71477173

71487174
<dt>|global object| is a {{ServiceWorkerGlobalScope}} object
71497175
<dd>
7176+
1. Let |owners| be the result of [=get the worker's owners=] given |global object|.
71507177
1. Let |realm info| be a [=/map=] matching the <code>script.ServiceWorkerRealmInfo</code> production,
7151-
with the <code>realm</code> field set to |realm id|, and the <code>origin</code> field
7152-
set to |origin|.
7178+
with the <code>realm</code> field set to |realm id|, the <code>origin</code> field
7179+
set to |origin|, and the <code>owners</code> field set to |owners|.
71537180

71547181
<dt>|global object| is a {{WorkerGlobalScope}} object
71557182
<dd>

0 commit comments

Comments
 (0)