Chromium Code Reviews| 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 a8b0fa735a1db61b0e19935dc2d0557737199c6b..60120d1f2b56d403ab7625e19f7664933c6db753 100644 |
| --- a/content/browser/service_worker/service_worker_registration.h |
| +++ b/content/browser/service_worker/service_worker_registration.h |
| @@ -26,7 +26,8 @@ class ServiceWorkerVersion; |
| // being associated with the same registration. The class roughly |
| // corresponds to navigator.serviceWorker.registgration. |
| class CONTENT_EXPORT ServiceWorkerRegistration |
| - : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerRegistration>) { |
| + : NON_EXPORTED_BASE(public base::RefCounted<ServiceWorkerRegistration>), |
| + public ServiceWorkerVersion::Listener { |
| public: |
| typedef base::Callback<void(ServiceWorkerStatusCode status)> StatusCallback; |
| @@ -59,6 +60,12 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
| return installing_version_.get(); |
| } |
| + bool is_uninstalling() const { return is_uninstalling_; } |
|
michaeln
2014/07/25 00:02:04
i think the addition of this is very good since it
|
| + |
| + void set_uninstalling(bool is_uninstalling) { |
| + is_uninstalling_ = is_uninstalling; |
| + } |
| + |
| void AddListener(Listener* listener); |
| void RemoveListener(Listener* listener); |
| @@ -76,13 +83,18 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
| // listeners via OnVersionAttributesChanged. |
| void UnsetVersion(ServiceWorkerVersion* version); |
| + virtual void OnNoControllees(ServiceWorkerVersion* version) OVERRIDE; |
| + |
| // This method corresponds to the [[Activate]] algorithm described in |
| // the service worker specification. It's only valid to call this method |
| // when the registration's active version has no controllees. |
| void ActivateWaitingVersion(const StatusCallback& completion_callback); |
| + void StartUninstall(); |
| + void Uninstall(); |
| + |
| private: |
| - ~ServiceWorkerRegistration(); |
| + virtual ~ServiceWorkerRegistration(); |
| friend class base::RefCounted<ServiceWorkerRegistration>; |
| void SetVersionInternal( |
| @@ -100,6 +112,7 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
| const GURL pattern_; |
| const GURL script_url_; |
| const int64 registration_id_; |
| + bool is_uninstalling_; |
| scoped_refptr<ServiceWorkerVersion> active_version_; |
| scoped_refptr<ServiceWorkerVersion> waiting_version_; |
| scoped_refptr<ServiceWorkerVersion> installing_version_; |
| @@ -108,5 +121,7 @@ class CONTENT_EXPORT ServiceWorkerRegistration |
| DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
| }; |
| + |
| } // namespace content |
| + |
| #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |