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 21 matching lines...) Expand all Loading... |
32 class QuotaManagerProxy; | 32 class QuotaManagerProxy; |
33 class SpecialStoragePolicy; | 33 class SpecialStoragePolicy; |
34 } | 34 } |
35 | 35 |
36 namespace content { | 36 namespace content { |
37 | 37 |
38 class ServiceWorkerContextCore; | 38 class ServiceWorkerContextCore; |
39 class ServiceWorkerDiskCache; | 39 class ServiceWorkerDiskCache; |
40 class ServiceWorkerRegistration; | 40 class ServiceWorkerRegistration; |
41 class ServiceWorkerRegistrationInfo; | 41 class ServiceWorkerRegistrationInfo; |
| 42 class ServiceWorkerResponseMetadataWriter; |
42 class ServiceWorkerResponseReader; | 43 class ServiceWorkerResponseReader; |
43 class ServiceWorkerResponseWriter; | 44 class ServiceWorkerResponseWriter; |
44 | 45 |
45 // This class provides an interface to store and retrieve ServiceWorker | 46 // This class provides an interface to store and retrieve ServiceWorker |
46 // registration data. | 47 // registration data. |
47 class CONTENT_EXPORT ServiceWorkerStorage | 48 class CONTENT_EXPORT ServiceWorkerStorage |
48 : NON_EXPORTED_BASE(public ServiceWorkerVersion::Listener) { | 49 : NON_EXPORTED_BASE(public ServiceWorkerVersion::Listener) { |
49 public: | 50 public: |
50 typedef std::vector<ServiceWorkerDatabase::ResourceRecord> ResourceList; | 51 typedef std::vector<ServiceWorkerDatabase::ResourceRecord> ResourceList; |
51 typedef base::Callback<void(ServiceWorkerStatusCode status)> StatusCallback; | 52 typedef base::Callback<void(ServiceWorkerStatusCode status)> StatusCallback; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // version is live, its script resources will remain available. | 138 // version is live, its script resources will remain available. |
138 // PurgeResources should be called when it's OK to delete them. | 139 // PurgeResources should be called when it's OK to delete them. |
139 void DeleteRegistration(int64 registration_id, | 140 void DeleteRegistration(int64 registration_id, |
140 const GURL& origin, | 141 const GURL& origin, |
141 const StatusCallback& callback); | 142 const StatusCallback& callback); |
142 | 143 |
143 scoped_ptr<ServiceWorkerResponseReader> CreateResponseReader( | 144 scoped_ptr<ServiceWorkerResponseReader> CreateResponseReader( |
144 int64 response_id); | 145 int64 response_id); |
145 scoped_ptr<ServiceWorkerResponseWriter> CreateResponseWriter( | 146 scoped_ptr<ServiceWorkerResponseWriter> CreateResponseWriter( |
146 int64 response_id); | 147 int64 response_id); |
| 148 scoped_ptr<ServiceWorkerResponseMetadataWriter> CreateResponseMetadataWriter( |
| 149 int64 response_id); |
147 | 150 |
148 // Adds |id| to the set of resources ids that are in the disk | 151 // Adds |id| to the set of resources ids that are in the disk |
149 // cache but not yet stored with a registration. | 152 // cache but not yet stored with a registration. |
150 void StoreUncommittedResponseId(int64 id); | 153 void StoreUncommittedResponseId(int64 id); |
151 | 154 |
152 // Removes |id| from uncommitted list, adds it to the | 155 // Removes |id| from uncommitted list, adds it to the |
153 // purgeable list and purges it. | 156 // purgeable list and purges it. |
154 void DoomUncommittedResponse(int64 id); | 157 void DoomUncommittedResponse(int64 id); |
155 | 158 |
156 // Compares only the response bodies. | 159 // Compares only the response bodies. |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 std::set<int64> pending_deletions_; | 484 std::set<int64> pending_deletions_; |
482 | 485 |
483 base::WeakPtrFactory<ServiceWorkerStorage> weak_factory_; | 486 base::WeakPtrFactory<ServiceWorkerStorage> weak_factory_; |
484 | 487 |
485 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerStorage); | 488 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerStorage); |
486 }; | 489 }; |
487 | 490 |
488 } // namespace content | 491 } // namespace content |
489 | 492 |
490 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_ | 493 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_STORAGE_H_ |
OLD | NEW |