| 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 <string> | 10 #include <string> |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 base::Time last_update_check() const { return last_update_check_; } | 135 base::Time last_update_check() const { return last_update_check_; } |
| 136 void set_last_update_check(base::Time last) { last_update_check_ = last; } | 136 void set_last_update_check(base::Time last) { last_update_check_ = last; } |
| 137 | 137 |
| 138 // Unsets the version and deletes its resources. Also deletes this | 138 // Unsets the version and deletes its resources. Also deletes this |
| 139 // registration from storage if there is no longer a stored version. | 139 // registration from storage if there is no longer a stored version. |
| 140 void DeleteVersion(const scoped_refptr<ServiceWorkerVersion>& version); | 140 void DeleteVersion(const scoped_refptr<ServiceWorkerVersion>& version); |
| 141 | 141 |
| 142 void RegisterRegistrationFinishedCallback(const base::Closure& callback); | 142 void RegisterRegistrationFinishedCallback(const base::Closure& callback); |
| 143 void NotifyRegistrationFinished(); | 143 void NotifyRegistrationFinished(); |
| 144 | 144 |
| 145 bool force_update_on_page_load() const { return force_update_on_page_load_; } | |
| 146 void set_force_update_on_page_load(bool force_update_on_page_load) { | |
| 147 force_update_on_page_load_ = force_update_on_page_load; | |
| 148 } | |
| 149 | |
| 150 private: | 145 private: |
| 151 friend class base::RefCounted<ServiceWorkerRegistration>; | 146 friend class base::RefCounted<ServiceWorkerRegistration>; |
| 152 | 147 |
| 153 ~ServiceWorkerRegistration() override; | 148 ~ServiceWorkerRegistration() override; |
| 154 | 149 |
| 155 void UnsetVersionInternal( | 150 void UnsetVersionInternal( |
| 156 ServiceWorkerVersion* version, | 151 ServiceWorkerVersion* version, |
| 157 ChangedVersionAttributesMask* mask); | 152 ChangedVersionAttributesMask* mask); |
| 158 | 153 |
| 159 // ServiceWorkerVersion::Listener override. | 154 // ServiceWorkerVersion::Listener override. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 174 void OnRestoreFinished(const StatusCallback& callback, | 169 void OnRestoreFinished(const StatusCallback& callback, |
| 175 scoped_refptr<ServiceWorkerVersion> version, | 170 scoped_refptr<ServiceWorkerVersion> version, |
| 176 ServiceWorkerStatusCode status); | 171 ServiceWorkerStatusCode status); |
| 177 | 172 |
| 178 const GURL pattern_; | 173 const GURL pattern_; |
| 179 const int64_t registration_id_; | 174 const int64_t registration_id_; |
| 180 bool is_deleted_; | 175 bool is_deleted_; |
| 181 bool is_uninstalling_; | 176 bool is_uninstalling_; |
| 182 bool is_uninstalled_; | 177 bool is_uninstalled_; |
| 183 bool should_activate_when_ready_; | 178 bool should_activate_when_ready_; |
| 184 bool force_update_on_page_load_; | |
| 185 base::Time last_update_check_; | 179 base::Time last_update_check_; |
| 186 int64_t resources_total_size_bytes_; | 180 int64_t resources_total_size_bytes_; |
| 187 | 181 |
| 188 // This registration is the primary owner of these versions. | 182 // This registration is the primary owner of these versions. |
| 189 scoped_refptr<ServiceWorkerVersion> active_version_; | 183 scoped_refptr<ServiceWorkerVersion> active_version_; |
| 190 scoped_refptr<ServiceWorkerVersion> waiting_version_; | 184 scoped_refptr<ServiceWorkerVersion> waiting_version_; |
| 191 scoped_refptr<ServiceWorkerVersion> installing_version_; | 185 scoped_refptr<ServiceWorkerVersion> installing_version_; |
| 192 | 186 |
| 193 base::ObserverList<Listener> listeners_; | 187 base::ObserverList<Listener> listeners_; |
| 194 std::vector<base::Closure> registration_finished_callbacks_; | 188 std::vector<base::Closure> registration_finished_callbacks_; |
| 195 base::WeakPtr<ServiceWorkerContextCore> context_; | 189 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 196 | 190 |
| 197 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 191 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
| 198 }; | 192 }; |
| 199 | 193 |
| 200 } // namespace content | 194 } // namespace content |
| 201 | 195 |
| 202 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 196 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
| OLD | NEW |