Skip to content

Commit

Permalink
Add ServiceWorkerRegistration.id and supporting algorithm changes. (F…
Browse files Browse the repository at this point in the history
…ixes w3c#1512)

This commit adds support for a registration `id` value.  This will be used to uniquely identify registrations
instead of `scope`.  This will make it easier for a developer to migrate a registration from one `scope` to
another.

The commit consists of the following changes:

* Add a DOMString `id` and associated getter to the registration.
* Add an `origin` to the internal registration type.
* Move the `scope` internal representation to `ServiceWorker` and add a new getter.
* Make the `ServiceWorkerRegistration.scope` return the oldest associated worker's `scope`.
* Migrate the registration map to be keyed by the tuple `(origin,id)`.
* Migrate the job queue map to be keyed by the tuple `(origin,id)`.
* Adjust job equality checks to treat register jobs to account for new id and scope semantics.
* Support changing the scope during register operations.
* Reject register operations that change the scope to a value that is already in use by another registration.
* Properly un-control clients whose URL no longer matches a new active worker's scope.
  • Loading branch information
wanderview committed Aug 14, 2020
1 parent 10dabd0 commit 9bef311
Showing 1 changed file with 165 additions and 56 deletions.
Loading

0 comments on commit 9bef311

Please sign in to comment.