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

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: review comments 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..5c24b2af1db97bf899cde8e20a95a66f340ab168 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -84,7 +84,6 @@ class CONTENT_EXPORT ServiceWorkerVersion
const base::string16& message,
int line_number,
const GURL& source_url) {};
- virtual void OnNoControllees(ServiceWorkerVersion* version) {};
};
ServiceWorkerVersion(
@@ -218,6 +217,11 @@ class CONTENT_EXPORT ServiceWorkerVersion
ServiceWorkerScriptCacheMap* script_cache_map() { return &script_cache_map_; }
EmbeddedWorkerInstance* embedded_worker() { return embedded_worker_.get(); }
+ // Dooms this version to have REDUNDANT status and its resources deleted. If
+ // the version is controlling a page, these changes will happen when the
+ // version no longer controls any pages.
+ void Doom();
+
private:
typedef ServiceWorkerVersion self;
typedef std::map<ServiceWorkerProviderHost*, int> ControlleeMap;
@@ -262,6 +266,7 @@ class CONTENT_EXPORT ServiceWorkerVersion
const std::vector<int>& sent_message_port_ids);
void ScheduleStopWorker();
+ void DoomInternal();
const int64 version_id_;
int64 registration_id_;
@@ -287,6 +292,7 @@ class CONTENT_EXPORT ServiceWorkerVersion
ServiceWorkerScriptCacheMap script_cache_map_;
base::OneShotTimer<ServiceWorkerVersion> stop_worker_timer_;
base::OneShotTimer<ServiceWorkerVersion> update_timer_;
+ bool is_doomed_;
base::WeakPtrFactory<ServiceWorkerVersion> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698