Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Unified Diff: content/browser/service_worker/service_worker_version.h

Issue 377153003: Service Worker: set active worker to REDUNDANT when unregistered (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make setting redundant clearly the responsibility of SWStorage Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/service_worker_version.h
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h
index 43297ee1fb80913e57469ad5a5c451934d21c1ee..cc9edcba6c9d1ae12f771b3e26c9642499ff0371 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -63,7 +63,7 @@ class CONTENT_EXPORT ServiceWorkerVersion
INSTALLING, // Install event is dispatched and being handled.
INSTALLED, // Install event is finished and is ready to be activated.
ACTIVATING, // Activate event is dispatched and being handled.
- ACTIVATED, // Activation is finished and can run as activated.
+ ACTIVATED, // Activation is finished and can run as activated.
REDUNDANT, // The version is no longer running as activated, due to
// unregistration or replace.
};
@@ -84,6 +84,8 @@ class CONTENT_EXPORT ServiceWorkerVersion
const base::string16& message,
int line_number,
const GURL& source_url) {};
+ // Fired when a version that was the controller of a page no longer controls
+ // any pages.
virtual void OnNoControllees(ServiceWorkerVersion* version) {};
};
@@ -124,7 +126,7 @@ class CONTENT_EXPORT ServiceWorkerVersion
bool pause_after_download,
const StatusCallback& callback);
- // Stops an embedded worker for this version.
+ // Stops the embedded worker for this version.
// This returns OK (success) if the worker is already stopped.
void StopWorker(const StatusCallback& callback);
@@ -208,7 +210,7 @@ class CONTENT_EXPORT ServiceWorkerVersion
void AddPotentialControllee(ServiceWorkerProviderHost* provider_host);
void RemovePotentialControllee(ServiceWorkerProviderHost* provider_host);
- // Returns if it has controllee.
+ // Returns true if it has a controllee, excluding potential ones.
bool HasControllee() const { return !controllee_map_.empty(); }
// Adds and removes Listeners.

Powered by Google App Engine
This is Rietveld 408576698