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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 ServiceWorkerRegistration* registration) {} | 49 ServiceWorkerRegistration* registration) {} |
50 virtual void OnSkippedWaiting(ServiceWorkerRegistration* registation) {} | 50 virtual void OnSkippedWaiting(ServiceWorkerRegistration* registation) {} |
51 }; | 51 }; |
52 | 52 |
53 ServiceWorkerRegistration(const ServiceWorkerRegistrationOptions& options, | 53 ServiceWorkerRegistration(const ServiceWorkerRegistrationOptions& options, |
54 int64_t registration_id, | 54 int64_t registration_id, |
55 base::WeakPtr<ServiceWorkerContextCore> context); | 55 base::WeakPtr<ServiceWorkerContextCore> context); |
56 | 56 |
57 int64_t id() const { return registration_id_; } | 57 int64_t id() const { return registration_id_; } |
58 const GURL& pattern() const { return pattern_; } | 58 const GURL& pattern() const { return pattern_; } |
| 59 blink::WebServiceWorkerUpdateViaCache update_via_cache() const { |
| 60 return update_via_cache_; |
| 61 } |
| 62 void set_update_via_cache( |
| 63 blink::WebServiceWorkerUpdateViaCache update_via_cache) { |
| 64 update_via_cache_ = update_via_cache; |
| 65 } |
59 | 66 |
60 bool is_deleted() const { return is_deleted_; } | 67 bool is_deleted() const { return is_deleted_; } |
61 void set_is_deleted(bool deleted) { is_deleted_ = deleted; } | 68 void set_is_deleted(bool deleted) { is_deleted_ = deleted; } |
62 | 69 |
63 bool is_uninstalling() const { return is_uninstalling_; } | 70 bool is_uninstalling() const { return is_uninstalling_; } |
64 | 71 |
65 void set_is_uninstalled(bool uninstalled) { is_uninstalled_ = uninstalled; } | 72 void set_is_uninstalled(bool uninstalled) { is_uninstalled_ = uninstalled; } |
66 bool is_uninstalled() const { return is_uninstalled_; } | 73 bool is_uninstalled() const { return is_uninstalled_; } |
67 | 74 |
68 int64_t resources_total_size_bytes() const { | 75 int64_t resources_total_size_bytes() const { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 void OnDeleteFinished(ServiceWorkerStatusCode status); | 198 void OnDeleteFinished(ServiceWorkerStatusCode status); |
192 | 199 |
193 // This method corresponds to the [[ClearRegistration]] algorithm. | 200 // This method corresponds to the [[ClearRegistration]] algorithm. |
194 void Clear(); | 201 void Clear(); |
195 | 202 |
196 void OnRestoreFinished(const StatusCallback& callback, | 203 void OnRestoreFinished(const StatusCallback& callback, |
197 scoped_refptr<ServiceWorkerVersion> version, | 204 scoped_refptr<ServiceWorkerVersion> version, |
198 ServiceWorkerStatusCode status); | 205 ServiceWorkerStatusCode status); |
199 | 206 |
200 const GURL pattern_; | 207 const GURL pattern_; |
| 208 blink::WebServiceWorkerUpdateViaCache update_via_cache_; |
201 const int64_t registration_id_; | 209 const int64_t registration_id_; |
202 bool is_deleted_; | 210 bool is_deleted_; |
203 bool is_uninstalling_; | 211 bool is_uninstalling_; |
204 bool is_uninstalled_; | 212 bool is_uninstalled_; |
205 bool should_activate_when_ready_; | 213 bool should_activate_when_ready_; |
206 NavigationPreloadState navigation_preload_state_; | 214 NavigationPreloadState navigation_preload_state_; |
207 base::Time last_update_check_; | 215 base::Time last_update_check_; |
208 int64_t resources_total_size_bytes_; | 216 int64_t resources_total_size_bytes_; |
209 | 217 |
210 // This registration is the primary owner of these versions. | 218 // This registration is the primary owner of these versions. |
(...skipping 13 matching lines...) Expand all Loading... |
224 // It is stopped when activation completes or the active version is no | 232 // It is stopped when activation completes or the active version is no |
225 // longer considered a lame duck. | 233 // longer considered a lame duck. |
226 base::RepeatingTimer lame_duck_timer_; | 234 base::RepeatingTimer lame_duck_timer_; |
227 | 235 |
228 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 236 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
229 }; | 237 }; |
230 | 238 |
231 } // namespace content | 239 } // namespace content |
232 | 240 |
233 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 241 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
OLD | NEW |