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 e8e65b37b8860a09cbb34e55168e7ffca12361d6..b5b678550534eabbd403739070d7e747cf87157e 100644 |
--- a/content/browser/service_worker/service_worker_registration.h |
+++ b/content/browser/service_worker/service_worker_registration.h |
@@ -50,6 +50,11 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
const GURL& script_url() const { return script_url_; } |
const GURL& pattern() const { return pattern_; } |
+ bool is_deleted() const { return is_deleted_; } |
+ void set_is_deleted(bool deleted) { is_deleted_ = deleted; } |
+ |
+ bool is_uninstalling() const { return is_uninstalling_; } |
+ |
ServiceWorkerVersion* active_version() const { |
return active_version_.get(); |
} |
@@ -85,8 +90,15 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
// is called, activation is initiated immediately. |
void ActivateWaitingVersionWhenReady(); |
- bool is_deleted() const { return is_deleted_; } |
- void set_is_deleted() { is_deleted_ = true; } |
+ // 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>; |
@@ -109,13 +121,18 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
void OnActivateEventFinished( |
ServiceWorkerVersion* activating_version, |
ServiceWorkerStatusCode status); |
- void ResetShouldActivateWhenReady(); |
void OnDeleteFinished(ServiceWorkerStatusCode status); |
+ // This method corresponds to the [[ClearRegistration]] algorithm. |
+ void Clear(); |
+ void OnStoreFinished(scoped_refptr<ServiceWorkerVersion> version, |
+ ServiceWorkerStatusCode status); |
+ |
const GURL pattern_; |
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_; |
@@ -125,5 +142,7 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
}; |
+ |
} // namespace content |
+ |
#endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |