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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 ServiceWorkerVersion* waiting_version() const { | 81 ServiceWorkerVersion* waiting_version() const { |
82 return waiting_version_.get(); | 82 return waiting_version_.get(); |
83 } | 83 } |
84 | 84 |
85 ServiceWorkerVersion* installing_version() const { | 85 ServiceWorkerVersion* installing_version() const { |
86 return installing_version_.get(); | 86 return installing_version_.get(); |
87 } | 87 } |
88 | 88 |
89 bool has_installed_version() const { | |
90 return active_version() || waiting_version(); | |
91 } | |
92 | |
93 ServiceWorkerVersion* GetNewestVersion() const; | 89 ServiceWorkerVersion* GetNewestVersion() const; |
94 | 90 |
95 void AddListener(Listener* listener); | 91 void AddListener(Listener* listener); |
96 void RemoveListener(Listener* listener); | 92 void RemoveListener(Listener* listener); |
97 void NotifyRegistrationFailed(); | 93 void NotifyRegistrationFailed(); |
98 void NotifyUpdateFound(); | 94 void NotifyUpdateFound(); |
99 void NotifyVersionAttributesChanged(ChangedVersionAttributesMask mask); | 95 void NotifyVersionAttributesChanged(ChangedVersionAttributesMask mask); |
100 | 96 |
101 ServiceWorkerRegistrationInfo GetInfo(); | 97 ServiceWorkerRegistrationInfo GetInfo(); |
102 | 98 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 base::ObserverList<Listener> listeners_; | 189 base::ObserverList<Listener> listeners_; |
194 std::vector<base::Closure> registration_finished_callbacks_; | 190 std::vector<base::Closure> registration_finished_callbacks_; |
195 base::WeakPtr<ServiceWorkerContextCore> context_; | 191 base::WeakPtr<ServiceWorkerContextCore> context_; |
196 | 192 |
197 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 193 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
198 }; | 194 }; |
199 | 195 |
200 } // namespace content | 196 } // namespace content |
201 | 197 |
202 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 198 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
OLD | NEW |