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..b7e71fa711c0751c4dfa3726e038f02d17f6f391 100644 |
--- a/content/browser/service_worker/service_worker_version.h |
+++ b/content/browser/service_worker/service_worker_version.h |
@@ -218,6 +218,14 @@ 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. Since this function can trigger |
+ // resource deletion, it should only be called after the |
+ // registration storing this version has been deleted from |
+ // ServiceWorkerDatabase (or is queued to be). |
michaeln
2014/07/11 01:16:05
I don't think the part about 'should only be calle
falken
2014/07/11 12:08:12
I meant more that the resource ids should already
|
+ void Doom(); |
+ |
private: |
typedef ServiceWorkerVersion self; |
typedef std::map<ServiceWorkerProviderHost*, int> ControlleeMap; |
@@ -262,6 +270,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 +296,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_; |