OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ | 5 #ifndef CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ | 6 #define CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
95 // | 95 // |
96 // TODO(nhiroki): This function should run all operations atomically. | 96 // TODO(nhiroki): This function should run all operations atomically. |
97 // http://crbug.com/486637 | 97 // http://crbug.com/486637 |
98 void BatchOperation(const std::vector<CacheStorageBatchOperation>& operations, | 98 void BatchOperation(const std::vector<CacheStorageBatchOperation>& operations, |
99 const ErrorCallback& callback); | 99 const ErrorCallback& callback); |
100 void BatchDidOneOperation(const base::Closure& barrier_closure, | 100 void BatchDidOneOperation(const base::Closure& barrier_closure, |
101 ErrorCallback* callback, | 101 ErrorCallback* callback, |
102 CacheStorageError error); | 102 CacheStorageError error); |
103 void BatchDidAllOperations(scoped_ptr<ErrorCallback> callback); | 103 void BatchDidAllOperations(scoped_ptr<ErrorCallback> callback); |
104 | 104 |
105 // TODO(jkarlin): Have keys take an optional ServiceWorkerFetchRequest. | 105 // TODO(jkarlin): Have keys take an optional ServiceWorkerFetchRequest. |
zino
2016/02/24 18:26:57
jkarlin@,
Are you working on this TODO?
If you ar
| |
106 // Returns CACHE_STORAGE_OK and a vector of requests if there are no errors. | 106 // Returns CACHE_STORAGE_OK and a vector of requests if there are no errors. |
107 void Keys(const RequestsCallback& callback); | 107 void Keys(scoped_ptr<ServiceWorkerFetchRequest> request, |
108 const CacheStorageCacheQueryParams& match_params, | |
109 const RequestsCallback& callback); | |
108 | 110 |
109 // Closes the backend. Future operations that require the backend | 111 // Closes the backend. Future operations that require the backend |
110 // will exit early. Close should only be called once per CacheStorageCache. | 112 // will exit early. Close should only be called once per CacheStorageCache. |
111 void Close(const base::Closure& callback); | 113 void Close(const base::Closure& callback); |
112 | 114 |
113 // The size of the cache's contents. This runs in parallel with other Cache | 115 // The size of the cache's contents. This runs in parallel with other Cache |
114 // operations. | 116 // operations. |
115 void Size(const SizeCallback& callback); | 117 void Size(const SizeCallback& callback); |
116 | 118 |
117 // Gets the cache's size, closes the backend, and then runs |callback| with | 119 // Gets the cache's size, closes the backend, and then runs |callback| with |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 const ErrorCallback& callback, | 232 const ErrorCallback& callback, |
231 scoped_ptr<OpenAllEntriesContext> entries_context, | 233 scoped_ptr<OpenAllEntriesContext> entries_context, |
232 CacheStorageError error); | 234 CacheStorageError error); |
233 void DeleteDidOpenEntry(const GURL& origin, | 235 void DeleteDidOpenEntry(const GURL& origin, |
234 scoped_ptr<ServiceWorkerFetchRequest> request, | 236 scoped_ptr<ServiceWorkerFetchRequest> request, |
235 const CacheStorageCache::ErrorCallback& callback, | 237 const CacheStorageCache::ErrorCallback& callback, |
236 scoped_ptr<disk_cache::Entry*> entryptr, | 238 scoped_ptr<disk_cache::Entry*> entryptr, |
237 int rv); | 239 int rv); |
238 | 240 |
239 // Keys callbacks. | 241 // Keys callbacks. |
240 void KeysImpl(const RequestsCallback& callback); | 242 void KeysImpl(scoped_ptr<KeysContext> keys_context); |
241 void KeysDidOpenAllEntries(const RequestsCallback& callback, | 243 void KeysDidOpenAllEntries(scoped_ptr<KeysContext> keys_context, |
242 scoped_ptr<OpenAllEntriesContext> entries_context, | 244 scoped_ptr<OpenAllEntriesContext> entries_context, |
243 CacheStorageError error); | 245 CacheStorageError error); |
244 void KeysProcessNextEntry(scoped_ptr<KeysContext> keys_context, | 246 void KeysProcessNextEntry(scoped_ptr<KeysContext> keys_context, |
245 const Entries::iterator& iter); | 247 const Entries::iterator& iter); |
246 void KeysDidReadMetadata(scoped_ptr<KeysContext> keys_context, | 248 void KeysDidReadMetadata(scoped_ptr<KeysContext> keys_context, |
247 const Entries::iterator& iter, | 249 const Entries::iterator& iter, |
248 scoped_ptr<CacheMetadata> metadata); | 250 scoped_ptr<CacheMetadata> metadata); |
249 | 251 |
250 void CloseImpl(const base::Closure& callback); | 252 void CloseImpl(const base::Closure& callback); |
251 | 253 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
308 bool memory_only_; | 310 bool memory_only_; |
309 | 311 |
310 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; | 312 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; |
311 | 313 |
312 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); | 314 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); |
313 }; | 315 }; |
314 | 316 |
315 } // namespace content | 317 } // namespace content |
316 | 318 |
317 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ | 319 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ |
OLD | NEW |