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_STORAGE_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 const GURL& origin, | 141 const GURL& origin, |
142 const StatusCallback& callback); | 142 const StatusCallback& callback); |
143 | 143 |
144 scoped_ptr<ServiceWorkerResponseReader> CreateResponseReader( | 144 scoped_ptr<ServiceWorkerResponseReader> CreateResponseReader( |
145 int64 response_id); | 145 int64 response_id); |
146 scoped_ptr<ServiceWorkerResponseWriter> CreateResponseWriter( | 146 scoped_ptr<ServiceWorkerResponseWriter> CreateResponseWriter( |
147 int64 response_id); | 147 int64 response_id); |
148 scoped_ptr<ServiceWorkerResponseMetadataWriter> CreateResponseMetadataWriter( | 148 scoped_ptr<ServiceWorkerResponseMetadataWriter> CreateResponseMetadataWriter( |
149 int64 response_id); | 149 int64 response_id); |
150 | 150 |
151 // Adds |id| to the set of resources ids that are in the disk | 151 // Adds |resource_id| to the set of resources ids that are in the disk cache |
152 // cache but not yet stored with a registration. | 152 // but not yet stored with a registration. |
153 void StoreUncommittedResponseId(int64 id); | 153 void StoreUncommittedResourceId(int64 resource_id); |
154 | 154 |
155 // Removes |id| from uncommitted list, adds it to the | 155 // Removes |resource_id| from uncommitted list. |
156 // purgeable list and purges it. | 156 void ClearUncommittedResourceId(int64 resource_id); |
157 void DoomUncommittedResponse(int64 id); | |
158 | 157 |
159 // Provide a storage mechanism to read/write arbitrary data associated with | 158 // Provide a storage mechanism to read/write arbitrary data associated with |
160 // a registration. Each registration has its own key namespace. Stored data | 159 // a registration. Each registration has its own key namespace. Stored data |
161 // is deleted when the associated registraton is deleted. | 160 // is deleted when the associated registraton is deleted. |
162 void GetUserData(int64 registration_id, | 161 void GetUserData(int64 registration_id, |
163 const std::string& key, | 162 const std::string& key, |
164 const GetUserDataCallback& callback); | 163 const GetUserDataCallback& callback); |
165 void StoreUserData(int64 registration_id, | 164 void StoreUserData(int64 registration_id, |
166 const GURL& origin, | 165 const GURL& origin, |
167 const std::string& key, | 166 const std::string& key, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 ServiceWorkerDatabase::Status status); | 352 ServiceWorkerDatabase::Status status); |
354 void DidUpdateToActiveState( | 353 void DidUpdateToActiveState( |
355 const StatusCallback& callback, | 354 const StatusCallback& callback, |
356 ServiceWorkerDatabase::Status status); | 355 ServiceWorkerDatabase::Status status); |
357 void DidDeleteRegistration( | 356 void DidDeleteRegistration( |
358 const DidDeleteRegistrationParams& params, | 357 const DidDeleteRegistrationParams& params, |
359 bool origin_is_deletable, | 358 bool origin_is_deletable, |
360 const ServiceWorkerDatabase::RegistrationData& deleted_version, | 359 const ServiceWorkerDatabase::RegistrationData& deleted_version, |
361 const std::vector<int64>& newly_purgeable_resources, | 360 const std::vector<int64>& newly_purgeable_resources, |
362 ServiceWorkerDatabase::Status status); | 361 ServiceWorkerDatabase::Status status); |
| 362 void DidAccessDatabase(ServiceWorkerDatabase::Status status); |
363 void DidStoreUserData( | 363 void DidStoreUserData( |
364 const StatusCallback& callback, | 364 const StatusCallback& callback, |
365 ServiceWorkerDatabase::Status status); | 365 ServiceWorkerDatabase::Status status); |
366 void DidGetUserData( | 366 void DidGetUserData( |
367 const GetUserDataCallback& callback, | 367 const GetUserDataCallback& callback, |
368 const std::string& data, | 368 const std::string& data, |
369 ServiceWorkerDatabase::Status status); | 369 ServiceWorkerDatabase::Status status); |
370 void DidDeleteUserData( | 370 void DidDeleteUserData( |
371 const StatusCallback& callback, | 371 const StatusCallback& callback, |
372 ServiceWorkerDatabase::Status status); | 372 ServiceWorkerDatabase::Status status); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 std::set<int64> pending_deletions_; | 529 std::set<int64> pending_deletions_; |
530 | 530 |
531 base::WeakPtrFactory<ServiceWorkerStorage> weak_factory_; | 531 base::WeakPtrFactory<ServiceWorkerStorage> weak_factory_; |
532 | 532 |
533 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerStorage); | 533 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerStorage); |
534 }; | 534 }; |
535 | 535 |
536 } // namespace content | 536 } // namespace content |
537 | 537 |
538 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_ | 538 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_ |
OLD | NEW |