diff --git a/service_worker.js b/service_worker.js index a738a235..bd2b04b6 100644 --- a/service_worker.js +++ b/service_worker.js @@ -52,15 +52,6 @@ var InstallEvent = (function (_super) { _super.apply(this, arguments); this.activeWorker = null; } - // Ensures that the worker is used in place of existing workers for - // the currently controlled set of window instances. - // NOTE(TOSPEC): this interacts with waitUntil in the following way: - // - replacement only happens upon successful installation - // - successful installation can be delayed by waitUntil, perhaps - // by subsequent event handlers. - // - therefore, replace doesn't happen immediately. - InstallEvent.prototype.replace = function () { - }; return InstallEvent; })(ExtendableEvent); @@ -337,9 +328,6 @@ var FetchEvent = (function (_super) { // Design notes: // - Caches are atomic: they are not complete until all of their resources are // fetched -// - Updates are also atomic: the old contents are visible until all new -// contents are fetched/installed. -// - Caches should have version numbers and "update" should set/replace it // This largely describes the current Application Cache API. It's only available // inside worker instances (not in regular documents), meaning that caching is a // feature of the event worker. This is likely to change! diff --git a/service_worker.ts b/service_worker.ts index 01099ed0..ef98d0ae 100644 --- a/service_worker.ts +++ b/service_worker.ts @@ -113,15 +113,6 @@ class ExtendableEvent extends _Event { class InstallEvent extends ExtendableEvent { activeWorker: ServiceWorker = null; - - // Ensures that the worker is used in place of existing workers for - // the currently controlled set of window instances. - // NOTE(TOSPEC): this interacts with waitUntil in the following way: - // - replacement only happens upon successful installation - // - successful installation can be delayed by waitUntil, perhaps - // by subsequent event handlers. - // - therefore, replace doesn't happen immediately. - replace(): void {} } interface InstallEventHandler { (e:InstallEvent); } @@ -496,9 +487,6 @@ class FetchEvent extends _Event { // Design notes: // - Caches are atomic: they are not complete until all of their resources are // fetched -// - Updates are also atomic: the old contents are visible until all new -// contents are fetched/installed. -// - Caches should have version numbers and "update" should set/replace it // This largely describes the current Application Cache API. It's only available // inside worker instances (not in regular documents), meaning that caching is a diff --git a/spec/service_worker/index.html b/spec/service_worker/index.html index b64b3577..7b55b145 100644 --- a/spec/service_worker/index.html +++ b/spec/service_worker/index.html @@ -126,6 +126,7 @@
A service worker has an associated script url (a URL).
A service worker has an associated containing service worker registration (a service worker registration), which contains itself.
A service worker is dispatched a set of lifecycle events, install and activate, and functional events including fetch.
+A service worker has an associated skip waiting flag. Unless stated otherwise it is unset.
controllerchange
Event
navigator.serviceWorker.controller
immediately reflects the active worker as the service worker that controls the document.)navigator.serviceWorker.controller
immediately reflects the active worker as the service worker that controls the document.)error
InstallEvent
Each event using InstallEvent
interface has the following associated flag that is initially unset:
-
event.replace()
event.replace()
method interacts with event.waitUntil(f)
method. Successful installation can be delayed by event.waitUntil(f)
. Replacement only happens upon successful installation. That is, replacement of the active worker (if any) by invoking event.replace()
method is not immediate, but it may occur as soon as the event's event handler completes its execution which is extended by event.waitUntil(f)
.
replace()
method must set the activate immediate flag.