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 | |
144 private: | 140 private: |
145 friend class base::RefCounted<ServiceWorkerRegistration>; | 141 friend class base::RefCounted<ServiceWorkerRegistration>; |
146 | 142 |
147 ~ServiceWorkerRegistration() override; | 143 ~ServiceWorkerRegistration() override; |
148 | 144 |
149 void UnsetVersionInternal( | 145 void UnsetVersionInternal( |
150 ServiceWorkerVersion* version, | 146 ServiceWorkerVersion* version, |
151 ChangedVersionAttributesMask* mask); | 147 ChangedVersionAttributesMask* mask); |
152 | 148 |
153 // ServiceWorkerVersion::Listener override. | 149 // ServiceWorkerVersion::Listener override. |
(...skipping 26 matching lines...) Expand all Loading... |
180 scoped_refptr<ServiceWorkerVersion> installing_version_; | 176 scoped_refptr<ServiceWorkerVersion> installing_version_; |
181 ObserverList<Listener> listeners_; | 177 ObserverList<Listener> listeners_; |
182 base::WeakPtr<ServiceWorkerContextCore> context_; | 178 base::WeakPtr<ServiceWorkerContextCore> context_; |
183 | 179 |
184 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); | 180 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegistration); |
185 }; | 181 }; |
186 | 182 |
187 } // namespace content | 183 } // namespace content |
188 | 184 |
189 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ | 185 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REGISTRATION_H_ |
OLD | NEW |