Skip to content

Commit 28f45f7

Browse files
committed
rename maps since the key is not a simple id
1 parent eecef52 commit 28f45f7

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

docs/index.bs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,12 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
238238

239239
A [=/service worker registration=] has an associated <dfn export>navigation preload header value</dfn>, which is a [=byte sequence=]. It is initially set to \`<code>true</code>\`.
240240

241-
A [=/service worker registration=] is said to be <dfn export id="dfn-service-worker-registration-unregistered">unregistered</dfn> if [=id to registration map=][(|origin|,|id|)] is not this [=/service worker registration=], where |origin| and |id| are this [=service worker registration=]'s [=service worker registration/origin=] and [=service worker registration/id=] respectively.
241+
A [=/service worker registration=] is said to be <dfn export id="dfn-service-worker-registration-unregistered">unregistered</dfn> if [=registration map=][(|origin|,|id|)] is not this [=/service worker registration=], where |origin| and |id| are this [=service worker registration=]'s [=service worker registration/origin=] and [=service worker registration/id=] respectively.
242242

243243
<section>
244244
<h4 id="service-worker-registration-lifetime">Lifetime</h4>
245245

246-
A user agent *must* persistently keep a list of <a>registered</a> [=/service worker registrations=] unless otherwise they are explicitly <a>unregistered</a>. A user agent has an <a>id to registration map</a> that stores the entries of the tuple of [=/service worker registration=]'s ([=service worker registration/origin=],[=service worker registration/id=]) and the corresponding [=/service worker registration=]. The lifetime of [=/service worker registrations=] is beyond that of the {{ServiceWorkerRegistration}} objects which represent them within the lifetime of their corresponding [=/service worker clients=].
246+
A user agent *must* persistently keep a list of <a>registered</a> [=/service worker registrations=] unless otherwise they are explicitly <a>unregistered</a>. A user agent has a <a>registration map</a> that stores the entries of the tuple of [=/service worker registration=]'s ([=service worker registration/origin=],[=service worker registration/id=]) and the corresponding [=/service worker registration=]. The lifetime of [=/service worker registrations=] is beyond that of the {{ServiceWorkerRegistration}} objects which represent them within the lifetime of their corresponding [=/service worker clients=].
247247
</section>
248248
</section>
249249

@@ -785,7 +785,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
785785
1. Let |promise| be [=a new promise=].
786786
1. Run the following steps [=in parallel=]:
787787
1. Let |registrations| be a new [=list=].
788-
1. [=map/For each=] |key| → |registration| of [=id to registration map=]:
788+
1. [=map/For each=] |key| → |registration| of [=registration map=]:
789789
1. If |registration|'s [=service worker registration/origin=] is the [=same origin|same=] as |client|'s [=environment settings object/origin=], then [=append=] |registration| to |registrations|.
790790
1. [=Queue a task=] on |promise|'s [=relevant settings object=]'s [=responsible event loop=], using the [=DOM manipulation task source=], to run the following steps:
791791
1. Let |registrationObjects| be a new [=list=].
@@ -2293,7 +2293,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
22932293
<section>
22942294
<h3 id="privacy">Privacy</h3>
22952295

2296-
[=/Service workers=] introduce new persistent storage features including <a>id to registration map</a> (for [=/service worker registrations=] and their [=/service workers=]), [=request response list=] and <a>name to cache map</a> (for caches), and [=script resource map=] (for script resources). In order to protect users from any potential <a biblio data-biblio-type="informative" lt="unsanctioned-tracking">unsanctioned tracking</a> threat, these persistent storages *should* be cleared when users intend to clear them and *should* maintain and interoperate with existing user controls e.g. purging all existing persistent storages.
2296+
[=/Service workers=] introduce new persistent storage features including <a>registration map</a> (for [=/service worker registrations=] and their [=/service workers=]), [=request response list=] and <a>name to cache map</a> (for caches), and [=script resource map=] (for script resources). In order to protect users from any potential <a biblio data-biblio-type="informative" lt="unsanctioned-tracking">unsanctioned tracking</a> threat, these persistent storages *should* be cleared when users intend to clear them and *should* maintain and interoperate with existing user controls e.g. purging all existing persistent storages.
22972297
</section>
22982298
</section>
22992299

@@ -2354,7 +2354,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
23542354

23552355
The following definitions are the user agent's internal data structures used throughout the specification.
23562356

2357-
An <dfn id="dfn-id-to-registration-map">id to registration map</dfn> is an <a>ordered map</a> where the keys are ([=environment settings object/origin=],[=service worker registration/id=]) and the values are [=/service worker registrations=].
2357+
A <dfn id="dfn-id-to-registration-map">registration map</dfn> is an <a>ordered map</a> where the keys are ([=environment settings object/origin=],[=service worker registration/id=]) and the values are [=/service worker registrations=].
23582358

23592359
A <dfn id="dfn-job">job</dfn> is an abstraction of one of register, update, and unregister request for a [=/service worker registration=].
23602360

@@ -2395,7 +2395,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
23952395

23962396
A <dfn id="dfn-job-queue">job queue</dfn> is a thread safe [=queue=] used to synchronize the set of concurrent [=jobs=]. The [=job queue=] contains [=jobs=] as its [=queue/items=]. A [=job queue=] is initially empty.
23972397

2398-
A <dfn id="dfn-id-to-job-queue-map">id to job queue map</dfn> is an <a>ordered map</a> where the keys are ([=environment settings object/origin=],[=service worker registration/ids=]) and the values are [=job queues=].
2398+
A <dfn id="dfn-id-to-job-queue-map">job queue map</dfn> is an <a>ordered map</a> where the keys are ([=environment settings object/origin=],[=service worker registration/ids=]) and the values are [=job queues=].
23992399

24002400
A <dfn id="dfn-bad-import-script-response">bad import script response</dfn> is a [=/response=] for which any of the following conditions are met:
24012401

@@ -2443,8 +2443,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
24432443
1. Let |origin| be |job|'s [=job/origin=].
24442444
1. Let |id| be |job|'s [=job/id=].
24452445
1. Let |key| be (|origin|,|id|).
2446-
1. If [=id to job queue map=][|key|] does not [=map/exist=], [=map/set=] [=id to job queue map=][|key|] to a new [=job queue=].
2447-
1. Set |jobQueue| to [=id to job queue map=][|key|].
2446+
1. If [=job queue map=][|key|] does not [=map/exist=], [=map/set=] [=job queue map=][|key|] to a new [=job queue=].
2447+
1. Set |jobQueue| to [=job queue map=][|key|].
24482448
1. If |jobQueue| is empty, then:
24492449
1. Set |job|'s [=containing job queue=] to |jobQueue|, and [=queue/enqueue=] |job| to |jobQueue|.
24502450
1. Invoke [=Run Job=] with |jobQueue|.
@@ -2714,7 +2714,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
27142714

27152715
Note: This will do nothing if [=Reject Job Promise=] was previously invoked with "{{SecurityError}}" {{DOMException}}.
27162716

2717-
1. If |newestWorker| is null, then [=map/remove=] [=id to registration map=][(|origin|,|id|)].
2717+
1. If |newestWorker| is null, then [=map/remove=] [=registration map=][(|origin|,|id|)].
27182718
1. Invoke <a>Finish Job</a> with |job| and abort these steps.
27192719

27202720
Else, continue the rest of these steps after the algorithm's asynchronous completion, with |script| being the asynchronous completion value.
@@ -2732,7 +2732,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
27322732
1. Let |runResult| be the result of running the [=Run Service Worker=] algorithm with |worker| and |forceBypassCache|.
27332733
1. If |runResult| is *failure* or an [=abrupt completion=], then:
27342734
1. Invoke [=Reject Job Promise=] with |job| and `TypeError`.
2735-
1. If |newestWorker| is null, then [=map/remove=] [=id to registration map=][(|origin|,|id|)].
2735+
1. If |newestWorker| is null, then [=map/remove=] [=registration map=][(|origin|,|id|)].
27362736
1. Invoke [=Finish Job=] with |job|.
27372737
1. Else, invoke [=Install=] algorithm with |job|, |worker|, and |registration| as its arguments.
27382738
</section>
@@ -2805,7 +2805,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
28052805
1. Run the <a>Update Registration State</a> algorithm passing |registration|, "<code>installing</code>" and null as the arguments.
28062806
1. Let |id| be |registration|'s [=service worker registration/id=].
28072807
1. Let |origin| be |registration|'s [=service worker registration/origin=].
2808-
1. If |newestWorker| is null, then [=map/remove=] [=id to registration map=][(|origin|,|id|)].
2808+
1. If |newestWorker| is null, then [=map/remove=] [=registration map=][(|origin|,|id|)].
28092809
1. Invoke <a>Finish Job</a> with |job| and abort these steps.
28102810
1. Let |map| be |registration|'s [=installing worker=]'s [=script resource map=].
28112811
1. Let |usedSet| be |registration|'s [=installing worker=]'s [=set of used scripts=].
@@ -3178,7 +3178,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
31783178
: Output
31793179
:: None
31803180

3181-
1. [=map/For each=] <var ignore>key</var> → |registration| of <a>id to registration map</a>:
3181+
1. [=map/For each=] <var ignore>key</var> → |registration| of <a>registration map</a>:
31823182
1. If |registration|'s <a>installing worker</a> |installingWorker| is not null, then:
31833183
1. If |registration|'s [=waiting worker=] is null and |registration|'s [=active worker=] is null, invoke <a>Clear Registration</a> with |registration| and continue to the next iteration of the loop.
31843184
1. Else, set |installingWorker| to null.
@@ -3216,7 +3216,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
32163216
1. If |registration| is null, then:
32173217
1. Invoke <a>Resolve Job Promise</a> with |job| and false.
32183218
1. Invoke <a>Finish Job</a> with |job| and abort these steps.
3219-
1. [=map/Remove=] [=id to registration map=][(|job|'s [=job/origin=],|job|'s [=job/id=])].
3219+
1. [=map/Remove=] [=registration map=][(|job|'s [=job/origin=],|job|'s [=job/id=])].
32203220
1. Invoke <a>Resolve Job Promise</a> with |job| and true.
32213221
1. Invoke [=Try Clear Registration=] with |registration|.
32223222

@@ -3238,7 +3238,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
32383238
1. Run the following steps atomically.
32393239
1. Let |scopeString| be [=URL serializer|serialized=] |scope| with the *exclude fragment flag* set.
32403240
1. Let |registration| be a new [=/service worker registration=] whose [=service worker registration/origin=] is set to |origin|, [=service worker registration/id=] is set to |id|, and [=service worker registration/update via cache mode=] is set to |updateViaCache|.
3241-
1. [=map/Set=] <a>id to registration map</a>[|id|] to |registration|.
3241+
1. [=map/Set=] <a>registration map</a>[|id|] to |registration|.
32423242
1. Return |registration|.
32433243
</section>
32443244

@@ -3355,7 +3355,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
33553355
1. Let |clientURLString| be <a lt="URL serializer">serialized</a> |clientURL|.
33563356
1. Let |matchingScopeString| be the empty string.
33573357
1. Let |scopeMap| be the empty map.
3358-
1. [=map/For each=] |key| → |value| of <a>id to registration map</a>:
3358+
1. [=map/For each=] |key| → |value| of <a>registration map</a>:
33593359
1. Let |activeWorker| be |value|'s [=service worker registration/active worker=],
33603360
1. If |activeWorker| is null, then [=continue=].
33613361
1. [=map/Set=] |scopeMap|[|active worker|'s [=service worker/scope url] to |value|.
@@ -3381,7 +3381,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
33813381
:: A [=/service worker registration=]
33823382

33833383
1. Run the following steps atomically.
3384-
1. [=map/Get=] (|origin|,|id|) from [=id to registration map=] and return the result.
3384+
1. [=map/Get=] (|origin|,|id|) from [=registration map=] and return the result.
33853385
</section>
33863386

33873387
<section algorithm>

0 commit comments

Comments
 (0)