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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 void UnsetVersion(ServiceWorkerVersion* version); | 104 void UnsetVersion(ServiceWorkerVersion* version); |
105 | 105 |
106 // Triggers the [[Activate]] algorithm when the currently active version | 106 // Triggers the [[Activate]] algorithm when the currently active version |
107 // 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 |
108 // is called or when version's skip waiting flag is set, activation is | 108 // is called or when version's skip waiting flag is set, activation is |
109 // initiated immediately. | 109 // initiated immediately. |
110 void ActivateWaitingVersionWhenReady(); | 110 void ActivateWaitingVersionWhenReady(); |
111 | 111 |
112 // Takes over control of provider hosts which are currently not controlled or | 112 // Takes over control of provider hosts which are currently not controlled or |
113 // controlled by other registrations. | 113 // controlled by other registrations. |
114 void ClaimClients(const StatusCallback& callback); | 114 void ClaimClients(); |
115 | 115 |
116 // Triggers the [[ClearRegistration]] algorithm when the currently | 116 // Triggers the [[ClearRegistration]] algorithm when the currently |
117 // active version has no controllees. Deletes this registration | 117 // active version has no controllees. Deletes this registration |
118 // from storage immediately. | 118 // from storage immediately. |
119 void ClearWhenReady(); | 119 void ClearWhenReady(); |
120 | 120 |
121 // Restores this registration in storage and cancels the pending | 121 // Restores this registration in storage and cancels the pending |
122 // [[ClearRegistration]] algorithm. | 122 // [[ClearRegistration]] algorithm. |
123 void AbortPendingClear(const StatusCallback& callback); | 123 void AbortPendingClear(const StatusCallback& callback); |
124 | 124 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 ServiceWorkerStatusCode status); | 160 ServiceWorkerStatusCode status); |
161 void OnDeleteFinished(ServiceWorkerStatusCode status); | 161 void OnDeleteFinished(ServiceWorkerStatusCode status); |
162 | 162 |
163 // This method corresponds to the [[ClearRegistration]] algorithm. | 163 // This method corresponds to the [[ClearRegistration]] algorithm. |
164 void Clear(); | 164 void Clear(); |
165 | 165 |
166 void OnRestoreFinished(const StatusCallback& callback, | 166 void OnRestoreFinished(const StatusCallback& callback, |
167 scoped_refptr<ServiceWorkerVersion> version, | 167 scoped_refptr<ServiceWorkerVersion> version, |
168 ServiceWorkerStatusCode status); | 168 ServiceWorkerStatusCode status); |
169 | 169 |
170 void DidGetRegistrationsForClaimClients( | |
171 const StatusCallback& callback, | |
172 scoped_refptr<ServiceWorkerVersion> version, | |
173 const std::vector<ServiceWorkerRegistrationInfo>& registrations); | |
174 bool ShouldClaim( | |
175 ServiceWorkerProviderHost* provider_host, | |
176 const std::vector<ServiceWorkerRegistrationInfo>& registration_infos); | |
177 | |
178 const GURL pattern_; | 170 const GURL pattern_; |
179 const int64 registration_id_; | 171 const int64 registration_id_; |
180 bool is_deleted_; | 172 bool is_deleted_; |
181 bool is_uninstalling_; | 173 bool is_uninstalling_; |
182 bool is_uninstalled_; | 174 bool is_uninstalled_; |
183 bool should_activate_when_ready_; | 175 bool should_activate_when_ready_; |
184 base::Time last_update_check_; | 176 base::Time last_update_check_; |
185 int64_t resources_total_size_bytes_; | 177 int64_t resources_total_size_bytes_; |
186 scoped_refptr<ServiceWorkerVersion> active_version_; | 178 scoped_refptr<ServiceWorkerVersion> active_version_; |
187 scoped_refptr<ServiceWorkerVersion> waiting_version_; | 179 scoped_refptr<ServiceWorkerVersion> waiting_version_; |
188 scoped_refptr<ServiceWorkerVersion> installing_version_; | 180 scoped_refptr<ServiceWorkerVersion> installing_version_; |
189 ObserverList<Listener> listeners_; | 181 ObserverList<Listener> listeners_; |
190 base::WeakPtr<ServiceWorkerContextCore> context_; | 182 base::WeakPtr<ServiceWorkerContextCore> context_; |
191 | 183 |
192 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 184 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
193 }; | 185 }; |
194 | 186 |
195 } // namespace content | 187 } // namespace content |
196 | 188 |
197 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 189 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
OLD | NEW |