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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Triggers the [[ClearRegistration]] algorithm when the currently | 93 // Triggers the [[ClearRegistration]] algorithm when the currently |
94 // active version has no controllees. Deletes this registration | 94 // active version has no controllees. Deletes this registration |
95 // from storage immediately. | 95 // from storage immediately. |
96 void ClearWhenReady(); | 96 void ClearWhenReady(); |
97 | 97 |
98 // Restores this registration in storage and cancels the pending | 98 // Restores this registration in storage and cancels the pending |
99 // [[ClearRegistration]] algorithm. If the algorithm was already triggered, | 99 // [[ClearRegistration]] algorithm. If the algorithm was already triggered, |
100 // does nothing. | 100 // does nothing. |
101 void AbortPendingClear(); | 101 void AbortPendingClear(); |
102 | 102 |
| 103 // The time of the most recent update check. |
| 104 base::Time last_update_check() const { return last_update_check_; } |
| 105 void set_last_update_check(base::Time last) { last_update_check_ = last; } |
| 106 |
103 private: | 107 private: |
104 friend class base::RefCounted<ServiceWorkerRegistration>; | 108 friend class base::RefCounted<ServiceWorkerRegistration>; |
105 | 109 |
106 virtual ~ServiceWorkerRegistration(); | 110 virtual ~ServiceWorkerRegistration(); |
107 | 111 |
108 void SetVersionInternal( | 112 void SetVersionInternal( |
109 ServiceWorkerVersion* version, | 113 ServiceWorkerVersion* version, |
110 scoped_refptr<ServiceWorkerVersion>* data_member, | 114 scoped_refptr<ServiceWorkerVersion>* data_member, |
111 int change_flag); | 115 int change_flag); |
112 void UnsetVersionInternal( | 116 void UnsetVersionInternal( |
(...skipping 14 matching lines...) Expand all Loading... |
127 void Clear(); | 131 void Clear(); |
128 void OnStoreFinished(scoped_refptr<ServiceWorkerVersion> version, | 132 void OnStoreFinished(scoped_refptr<ServiceWorkerVersion> version, |
129 ServiceWorkerStatusCode status); | 133 ServiceWorkerStatusCode status); |
130 | 134 |
131 const GURL pattern_; | 135 const GURL pattern_; |
132 const GURL script_url_; | 136 const GURL script_url_; |
133 const int64 registration_id_; | 137 const int64 registration_id_; |
134 bool is_deleted_; | 138 bool is_deleted_; |
135 bool is_uninstalling_; | 139 bool is_uninstalling_; |
136 bool should_activate_when_ready_; | 140 bool should_activate_when_ready_; |
| 141 base::Time last_update_check_; |
137 scoped_refptr<ServiceWorkerVersion> active_version_; | 142 scoped_refptr<ServiceWorkerVersion> active_version_; |
138 scoped_refptr<ServiceWorkerVersion> waiting_version_; | 143 scoped_refptr<ServiceWorkerVersion> waiting_version_; |
139 scoped_refptr<ServiceWorkerVersion> installing_version_; | 144 scoped_refptr<ServiceWorkerVersion> installing_version_; |
140 ObserverList<Listener> listeners_; | 145 ObserverList<Listener> listeners_; |
141 base::WeakPtr<ServiceWorkerContextCore> context_; | 146 base::WeakPtr<ServiceWorkerContextCore> context_; |
142 | 147 |
143 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 148 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
144 }; | 149 }; |
145 | 150 |
146 } // namespace content | 151 } // namespace content |
147 | 152 |
148 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 153 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
OLD | NEW |