| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 virtual void OnVersionAttributesChanged( | 39 virtual void OnVersionAttributesChanged( |
| 40 ServiceWorkerRegistration* registration, | 40 ServiceWorkerRegistration* registration, |
| 41 ChangedVersionAttributesMask changed_mask, | 41 ChangedVersionAttributesMask changed_mask, |
| 42 const ServiceWorkerRegistrationInfo& info) {} | 42 const ServiceWorkerRegistrationInfo& info) {} |
| 43 virtual void OnRegistrationFailed( | 43 virtual void OnRegistrationFailed( |
| 44 ServiceWorkerRegistration* registration) {} | 44 ServiceWorkerRegistration* registration) {} |
| 45 virtual void OnRegistrationFinishedUninstalling( | 45 virtual void OnRegistrationFinishedUninstalling( |
| 46 ServiceWorkerRegistration* registration) {} | 46 ServiceWorkerRegistration* registration) {} |
| 47 virtual void OnUpdateFound( | 47 virtual void OnUpdateFound( |
| 48 ServiceWorkerRegistration* registration) {} | 48 ServiceWorkerRegistration* registration) {} |
| 49 virtual void OnSkippedWaiting(ServiceWorkerRegistration* registation) {} |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 ServiceWorkerRegistration(const GURL& pattern, | 52 ServiceWorkerRegistration(const GURL& pattern, |
| 52 int64 registration_id, | 53 int64 registration_id, |
| 53 base::WeakPtr<ServiceWorkerContextCore> context); | 54 base::WeakPtr<ServiceWorkerContextCore> context); |
| 54 | 55 |
| 55 int64 id() const { return registration_id_; } | 56 int64 id() const { return registration_id_; } |
| 56 const GURL& pattern() const { return pattern_; } | 57 const GURL& pattern() const { return pattern_; } |
| 57 | 58 |
| 58 bool is_deleted() const { return is_deleted_; } | 59 bool is_deleted() const { return is_deleted_; } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 void SetWaitingVersion(ServiceWorkerVersion* version); | 98 void SetWaitingVersion(ServiceWorkerVersion* version); |
| 98 void SetInstallingVersion(ServiceWorkerVersion* version); | 99 void SetInstallingVersion(ServiceWorkerVersion* version); |
| 99 | 100 |
| 100 // If version is the installing, waiting, active version of this | 101 // If version is the installing, waiting, active version of this |
| 101 // registation, the method will reset that field to NULL, and notify | 102 // registation, the method will reset that field to NULL, and notify |
| 102 // listeners via OnVersionAttributesChanged. | 103 // listeners via OnVersionAttributesChanged. |
| 103 void UnsetVersion(ServiceWorkerVersion* version); | 104 void UnsetVersion(ServiceWorkerVersion* version); |
| 104 | 105 |
| 105 // Triggers the [[Activate]] algorithm when the currently active version | 106 // Triggers the [[Activate]] algorithm when the currently active version |
| 106 // has no controllees. If there are no controllees at the time the method | 107 // has no controllees. If there are no controllees at the time the method |
| 107 // is called, activation is initiated immediately. | 108 // is called or when version's skip waiting flag is set, activation is |
| 109 // initiated immediately. |
| 108 void ActivateWaitingVersionWhenReady(); | 110 void ActivateWaitingVersionWhenReady(); |
| 109 | 111 |
| 110 // Triggers the [[ClearRegistration]] algorithm when the currently | 112 // Triggers the [[ClearRegistration]] algorithm when the currently |
| 111 // active version has no controllees. Deletes this registration | 113 // active version has no controllees. Deletes this registration |
| 112 // from storage immediately. | 114 // from storage immediately. |
| 113 void ClearWhenReady(); | 115 void ClearWhenReady(); |
| 114 | 116 |
| 115 // Restores this registration in storage and cancels the pending | 117 // Restores this registration in storage and cancels the pending |
| 116 // [[ClearRegistration]] algorithm. | 118 // [[ClearRegistration]] algorithm. |
| 117 void AbortPendingClear(const StatusCallback& callback); | 119 void AbortPendingClear(const StatusCallback& callback); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 scoped_refptr<ServiceWorkerVersion> installing_version_; | 176 scoped_refptr<ServiceWorkerVersion> installing_version_; |
| 175 ObserverList<Listener> listeners_; | 177 ObserverList<Listener> listeners_; |
| 176 base::WeakPtr<ServiceWorkerContextCore> context_; | 178 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 177 | 179 |
| 178 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 180 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
| 179 }; | 181 }; |
| 180 | 182 |
| 181 } // namespace content | 183 } // namespace content |
| 182 | 184 |
| 183 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 185 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
| OLD | NEW |