| 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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 virtual void OnVersionAttributesChanged( | 34 virtual void OnVersionAttributesChanged( |
| 35 ServiceWorkerRegistration* registration, | 35 ServiceWorkerRegistration* registration, |
| 36 ChangedVersionAttributesMask changed_mask, | 36 ChangedVersionAttributesMask changed_mask, |
| 37 const ServiceWorkerRegistrationInfo& info) {} | 37 const ServiceWorkerRegistrationInfo& info) {} |
| 38 virtual void OnRegistrationFailed( | 38 virtual void OnRegistrationFailed( |
| 39 ServiceWorkerRegistration* registration) {} | 39 ServiceWorkerRegistration* registration) {} |
| 40 virtual void OnRegistrationFinishedUninstalling( | 40 virtual void OnRegistrationFinishedUninstalling( |
| 41 ServiceWorkerRegistration* registration) {} | 41 ServiceWorkerRegistration* registration) {} |
| 42 virtual void OnUpdateFound( | 42 virtual void OnUpdateFound( |
| 43 ServiceWorkerRegistration* registration) {} | 43 ServiceWorkerRegistration* registration) {} |
| 44 virtual void OnSkippedWaiting( |
| 45 ServiceWorkerRegistration* registation) {} |
| 44 }; | 46 }; |
| 45 | 47 |
| 46 ServiceWorkerRegistration(const GURL& pattern, | 48 ServiceWorkerRegistration(const GURL& pattern, |
| 47 int64 registration_id, | 49 int64 registration_id, |
| 48 base::WeakPtr<ServiceWorkerContextCore> context); | 50 base::WeakPtr<ServiceWorkerContextCore> context); |
| 49 | 51 |
| 50 int64 id() const { return registration_id_; } | 52 int64 id() const { return registration_id_; } |
| 51 const GURL& pattern() const { return pattern_; } | 53 const GURL& pattern() const { return pattern_; } |
| 52 | 54 |
| 53 bool is_deleted() const { return is_deleted_; } | 55 bool is_deleted() const { return is_deleted_; } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void SetWaitingVersion(ServiceWorkerVersion* version); | 94 void SetWaitingVersion(ServiceWorkerVersion* version); |
| 93 void SetInstallingVersion(ServiceWorkerVersion* version); | 95 void SetInstallingVersion(ServiceWorkerVersion* version); |
| 94 | 96 |
| 95 // If version is the installing, waiting, active version of this | 97 // If version is the installing, waiting, active version of this |
| 96 // registation, the method will reset that field to NULL, and notify | 98 // registation, the method will reset that field to NULL, and notify |
| 97 // listeners via OnVersionAttributesChanged. | 99 // listeners via OnVersionAttributesChanged. |
| 98 void UnsetVersion(ServiceWorkerVersion* version); | 100 void UnsetVersion(ServiceWorkerVersion* version); |
| 99 | 101 |
| 100 // Triggers the [[Activate]] algorithm when the currently active version | 102 // Triggers the [[Activate]] algorithm when the currently active version |
| 101 // has no controllees. If there are no controllees at the time the method | 103 // has no controllees. If there are no controllees at the time the method |
| 102 // is called, activation is initiated immediately. | 104 // is called or when version's skip waiting flag is set, activation is |
| 105 // initiated immediately. |
| 103 void ActivateWaitingVersionWhenReady(); | 106 void ActivateWaitingVersionWhenReady(); |
| 104 | 107 |
| 105 // Triggers the [[ClearRegistration]] algorithm when the currently | 108 // Triggers the [[ClearRegistration]] algorithm when the currently |
| 106 // active version has no controllees. Deletes this registration | 109 // active version has no controllees. Deletes this registration |
| 107 // from storage immediately. | 110 // from storage immediately. |
| 108 void ClearWhenReady(); | 111 void ClearWhenReady(); |
| 109 | 112 |
| 110 // Restores this registration in storage and cancels the pending | 113 // Restores this registration in storage and cancels the pending |
| 111 // [[ClearRegistration]] algorithm. | 114 // [[ClearRegistration]] algorithm. |
| 112 void AbortPendingClear(const StatusCallback& callback); | 115 void AbortPendingClear(const StatusCallback& callback); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 scoped_refptr<ServiceWorkerVersion> installing_version_; | 161 scoped_refptr<ServiceWorkerVersion> installing_version_; |
| 159 ObserverList<Listener> listeners_; | 162 ObserverList<Listener> listeners_; |
| 160 base::WeakPtr<ServiceWorkerContextCore> context_; | 163 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 161 | 164 |
| 162 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 165 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
| 163 }; | 166 }; |
| 164 | 167 |
| 165 } // namespace content | 168 } // namespace content |
| 166 | 169 |
| 167 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 170 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
| OLD | NEW |