Index: content/browser/service_worker/service_worker_registration.h |
diff --git a/content/browser/service_worker/service_worker_registration.h b/content/browser/service_worker/service_worker_registration.h |
index 41092889e74c4396711d5d829d02a63bbfbf0645..bbd69fbb37736e76c3264a5b703bb085b300c579 100644 |
--- a/content/browser/service_worker/service_worker_registration.h |
+++ b/content/browser/service_worker/service_worker_registration.h |
@@ -60,6 +60,8 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
return installing_version_.get(); |
} |
+ bool is_uninstalling() const { return is_uninstalling_; } |
+ |
void AddListener(Listener* listener); |
void RemoveListener(Listener* listener); |
@@ -83,7 +85,17 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
void ActivateWaitingVersionWhenReady(); |
bool is_deleted() const { return is_deleted_; } |
- void set_is_deleted() { is_deleted_ = true; } |
+ void set_is_deleted(bool deleted) { is_deleted_ = deleted; } |
+ |
+ // Triggers the [[ClearRegistration]] algorithm when the currently |
+ // active version has no controllees. Deletes this registration |
+ // from storage immediately. |
+ void ClearWhenReady(); |
+ |
+ // Restores this registration in storage and cancels the pending |
+ // [[ClearRegistration]] algorithm. If the algorithm was already triggered, |
+ // does nothing. |
+ void AbortPendingClear(); |
private: |
friend class base::RefCounted<ServiceWorkerRegistration>; |
@@ -98,9 +110,16 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
ServiceWorkerVersion* version, |
ChangedVersionAttributesMask* mask); |
+ bool IsListeningForNoControllees(); |
+ void SetShouldActivateWhenReady(bool should_activate); |
+ void SetUninstalling(bool is_uninstalling); |
+ |
// ServiceWorkerVersion::Listener override. |
virtual void OnNoControllees(ServiceWorkerVersion* version) OVERRIDE; |
+ // This method corresponds to the [[ClearRegistration]] algorithm. |
+ void Clear(); |
+ |
// This method corresponds to the [[Activate]] algorithm. |
void ActivateWaitingVersion(); |
void OnActivateEventFinished( |
@@ -113,6 +132,7 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
const GURL script_url_; |
const int64 registration_id_; |
bool is_deleted_; |
+ bool is_uninstalling_; |
bool should_activate_when_ready_; |
scoped_refptr<ServiceWorkerVersion> active_version_; |
scoped_refptr<ServiceWorkerVersion> waiting_version_; |
@@ -122,5 +142,7 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
}; |
+ |
} // namespace content |
+ |
#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |