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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // Unsets the version and deletes its resources. Also deletes this | 143 // Unsets the version and deletes its resources. Also deletes this |
144 // registration from storage if there is no longer a stored version. | 144 // registration from storage if there is no longer a stored version. |
145 void DeleteVersion(const scoped_refptr<ServiceWorkerVersion>& version); | 145 void DeleteVersion(const scoped_refptr<ServiceWorkerVersion>& version); |
146 | 146 |
147 void RegisterRegistrationFinishedCallback(const base::Closure& callback); | 147 void RegisterRegistrationFinishedCallback(const base::Closure& callback); |
148 void NotifyRegistrationFinished(); | 148 void NotifyRegistrationFinished(); |
149 | 149 |
150 void SetTaskRunnerForTest( | 150 void SetTaskRunnerForTest( |
151 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 151 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
152 | 152 |
| 153 void EnableNavigationPreload(bool enable); |
| 154 |
153 private: | 155 private: |
154 friend class base::RefCounted<ServiceWorkerRegistration>; | 156 friend class base::RefCounted<ServiceWorkerRegistration>; |
155 | 157 |
156 ~ServiceWorkerRegistration() override; | 158 ~ServiceWorkerRegistration() override; |
157 | 159 |
158 void UnsetVersionInternal( | 160 void UnsetVersionInternal( |
159 ServiceWorkerVersion* version, | 161 ServiceWorkerVersion* version, |
160 ChangedVersionAttributesMask* mask); | 162 ChangedVersionAttributesMask* mask); |
161 | 163 |
162 // ServiceWorkerVersion::Listener override. | 164 // ServiceWorkerVersion::Listener override. |
(...skipping 22 matching lines...) Expand all Loading... |
185 void OnRestoreFinished(const StatusCallback& callback, | 187 void OnRestoreFinished(const StatusCallback& callback, |
186 scoped_refptr<ServiceWorkerVersion> version, | 188 scoped_refptr<ServiceWorkerVersion> version, |
187 ServiceWorkerStatusCode status); | 189 ServiceWorkerStatusCode status); |
188 | 190 |
189 const GURL pattern_; | 191 const GURL pattern_; |
190 const int64_t registration_id_; | 192 const int64_t registration_id_; |
191 bool is_deleted_; | 193 bool is_deleted_; |
192 bool is_uninstalling_; | 194 bool is_uninstalling_; |
193 bool is_uninstalled_; | 195 bool is_uninstalled_; |
194 bool should_activate_when_ready_; | 196 bool should_activate_when_ready_; |
| 197 bool is_navigation_preload_enabled_; |
195 base::Time last_update_check_; | 198 base::Time last_update_check_; |
196 int64_t resources_total_size_bytes_; | 199 int64_t resources_total_size_bytes_; |
197 | 200 |
198 // This registration is the primary owner of these versions. | 201 // This registration is the primary owner of these versions. |
199 scoped_refptr<ServiceWorkerVersion> active_version_; | 202 scoped_refptr<ServiceWorkerVersion> active_version_; |
200 scoped_refptr<ServiceWorkerVersion> waiting_version_; | 203 scoped_refptr<ServiceWorkerVersion> waiting_version_; |
201 scoped_refptr<ServiceWorkerVersion> installing_version_; | 204 scoped_refptr<ServiceWorkerVersion> installing_version_; |
202 | 205 |
203 base::ObserverList<Listener> listeners_; | 206 base::ObserverList<Listener> listeners_; |
204 std::vector<base::Closure> registration_finished_callbacks_; | 207 std::vector<base::Closure> registration_finished_callbacks_; |
205 base::WeakPtr<ServiceWorkerContextCore> context_; | 208 base::WeakPtr<ServiceWorkerContextCore> context_; |
206 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 209 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
207 | 210 |
208 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 211 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
209 }; | 212 }; |
210 | 213 |
211 } // namespace content | 214 } // namespace content |
212 | 215 |
213 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 216 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
OLD | NEW |