Skip to content

Commit 0aceaac

Browse files
Update agent and realm allocation (#1508)
* Update agent and realm allocation Follows whatwg/html#5411. * Update docs/index.bs * Update docs/index.bs * agent/event loop * Event loop and other ESO fixes Co-authored-by: Jake Archibald <[email protected]>
1 parent 5c6d27b commit 0aceaac

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

docs/index.bs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2853,33 +2853,28 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
28532853
1. Let |script| be |serviceWorker|'s [=service worker/script resource=].
28542854
1. Assert: |script| is not null.
28552855
1. Let |startFailed| be false.
2856-
1. Create a separate parallel execution environment (i.e. a separate thread or process or equivalent construct), and run the following steps in that context:
2857-
1. Call the JavaScript [=InitializeHostDefinedRealm|InitializeHostDefinedRealm()=] abstract operation with the following customizations:
2856+
1. Let |agent| be the result of [=obtain a service worker agent|obtaining a service worker agent=], and run the following steps in that context:
2857+
1. Let |realmExecutionContext| be the result of [=create a new JavaScript realm|creating a new JavaScript realm=] given |agent| and the following customizations:
28582858
* For the global object, create a new {{ServiceWorkerGlobalScope}} object. Let |workerGlobalScope| be the created object.
2859-
* Let |realmExecutionContext| be the created [=execution context|JavaScript execution context=].
28602859
1. Set |serviceWorker|'s [=service worker/global object=] to |workerGlobalScope|.
2861-
1. Let |workerEventLoop| be a newly created <a>event loop</a>.
28622860
1. Let |settingsObject| be a new <a>environment settings object</a> whose algorithms are defined as follows:
28632861

28642862
: The [=environment settings object/realm execution context=]
28652863
:: Return |realmExecutionContext|.
2866-
: The [=environment settings object/global object=]
2867-
:: Return |workerGlobalScope|.
2868-
: The <a>responsible event loop</a>
2869-
:: Return |workerEventLoop|.
2870-
: The [=environment settings object/referrer policy=]
2871-
:: Return |workerGlobalScope|'s [=WorkerGlobalScope/referrer policy=].
2864+
: The [=environment settings object/module map=]
2865+
:: Return |workerGlobalScope|'s [=WorkerGlobalScope/module map=].
28722866
: The <a>API URL character encoding</a>
2873-
:: Return UTF-8.
2867+
:: Return [=UTF-8=].
28742868
: The <a>API base URL</a>
28752869
:: Return |serviceWorker|'s [=service worker/script url=].
28762870
: The [=environment settings object/origin=]
28772871
:: Return its registering [=/service worker client=]'s [=environment settings object/origin=].
2878-
: The <a>creation URL</a>
2879-
:: Return |workerGlobalScope|'s [=WorkerGlobalScope/url=].
28802872
: The [=environment settings object/HTTPS state=]
28812873
:: Return |workerGlobalScope|'s [=WorkerGlobalScope/HTTPS state=].
2874+
: The [=environment settings object/referrer policy=]
2875+
:: Return |workerGlobalScope|'s [=WorkerGlobalScope/referrer policy=].
28822876

2877+
1. Set |settingsObject|'s [=environment/id=] to a new unique opaque string, its [=creation URL=] to |serviceWorker|'s [=service worker/script url=], its [=environment/target browsing context=] to null, and its [=active service worker=] to null.
28832878
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/url=] to |serviceWorker|'s [=service worker/script url=].
28842879
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/HTTPS state=] to |serviceWorker|'s <a>script resource</a>'s <a>HTTPS state</a>.
28852880
1. Set |workerGlobalScope|'s [=WorkerGlobalScope/referrer policy=] to |serviceWorker|'s <a>script resource</a>'s [=script resource/referrer policy=].

0 commit comments

Comments
 (0)