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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // this registration in the storage. Stored data is deleted when this | 130 // this registration in the storage. Stored data is deleted when this |
131 // registration is deleted from the storage. | 131 // registration is deleted from the storage. |
132 void GetUserData(const std::string& key, | 132 void GetUserData(const std::string& key, |
133 const GetUserDataCallback& callback); | 133 const GetUserDataCallback& callback); |
134 void StoreUserData(const std::string& key, | 134 void StoreUserData(const std::string& key, |
135 const std::string& data, | 135 const std::string& data, |
136 const StatusCallback& callback); | 136 const StatusCallback& callback); |
137 void ClearUserData(const std::string& key, | 137 void ClearUserData(const std::string& key, |
138 const StatusCallback& callback); | 138 const StatusCallback& callback); |
139 | 139 |
| 140 // Unsets the version and deletes its resources. Also deletes this |
| 141 // registration from storage if there is no longer a stored version. |
| 142 void DeleteVersion(const scoped_refptr<ServiceWorkerVersion>& version); |
| 143 |
140 private: | 144 private: |
141 friend class base::RefCounted<ServiceWorkerRegistration>; | 145 friend class base::RefCounted<ServiceWorkerRegistration>; |
142 | 146 |
143 ~ServiceWorkerRegistration() override; | 147 ~ServiceWorkerRegistration() override; |
144 | 148 |
145 void UnsetVersionInternal( | 149 void UnsetVersionInternal( |
146 ServiceWorkerVersion* version, | 150 ServiceWorkerVersion* version, |
147 ChangedVersionAttributesMask* mask); | 151 ChangedVersionAttributesMask* mask); |
148 | 152 |
149 // ServiceWorkerVersion::Listener override. | 153 // ServiceWorkerVersion::Listener override. |
(...skipping 26 matching lines...) Expand all Loading... |
176 scoped_refptr<ServiceWorkerVersion> installing_version_; | 180 scoped_refptr<ServiceWorkerVersion> installing_version_; |
177 ObserverList<Listener> listeners_; | 181 ObserverList<Listener> listeners_; |
178 base::WeakPtr<ServiceWorkerContextCore> context_; | 182 base::WeakPtr<ServiceWorkerContextCore> context_; |
179 | 183 |
180 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 184 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
181 }; | 185 }; |
182 | 186 |
183 } // namespace content | 187 } // namespace content |
184 | 188 |
185 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 189 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
OLD | NEW |