Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(816)

Side by Side Diff: content/browser/cache_storage/cache_storage_cache.h

Issue 1719103002: CacheStorage: Expand cache.keys() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/cache_storage/cache_storage_cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 const ErrorCallback& callback, 126 const ErrorCallback& callback,
127 int64_t space_required, 127 int64_t space_required,
128 storage::QuotaStatusCode status_code, 128 storage::QuotaStatusCode status_code,
129 int64_t usage, 129 int64_t usage,
130 int64_t quota); 130 int64_t quota);
131 void BatchDidOneOperation(const base::Closure& barrier_closure, 131 void BatchDidOneOperation(const base::Closure& barrier_closure,
132 ErrorCallback* callback, 132 ErrorCallback* callback,
133 CacheStorageError error); 133 CacheStorageError error);
134 void BatchDidAllOperations(std::unique_ptr<ErrorCallback> callback); 134 void BatchDidAllOperations(std::unique_ptr<ErrorCallback> callback);
135 135
136 // TODO(jkarlin): Have keys take an optional ServiceWorkerFetchRequest.
137 // Returns CACHE_STORAGE_OK and a vector of requests if there are no errors. 136 // Returns CACHE_STORAGE_OK and a vector of requests if there are no errors.
138 void Keys(const RequestsCallback& callback); 137 void Keys(std::unique_ptr<ServiceWorkerFetchRequest> request,
138 const CacheStorageCacheQueryParams& options,
139 const RequestsCallback& callback);
139 140
140 // Closes the backend. Future operations that require the backend 141 // Closes the backend. Future operations that require the backend
141 // will exit early. Close should only be called once per CacheStorageCache. 142 // will exit early. Close should only be called once per CacheStorageCache.
142 void Close(const base::Closure& callback); 143 void Close(const base::Closure& callback);
143 144
144 // The size of the cache's contents. 145 // The size of the cache's contents.
145 void Size(const SizeCallback& callback); 146 void Size(const SizeCallback& callback);
146 147
147 // Gets the cache's size, closes the backend, and then runs |callback| with 148 // Gets the cache's size, closes the backend, and then runs |callback| with
148 // the cache's size. 149 // the cache's size.
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 const ErrorCallback& callback, 313 const ErrorCallback& callback,
313 std::unique_ptr<OpenAllEntriesContext> entries_context, 314 std::unique_ptr<OpenAllEntriesContext> entries_context,
314 CacheStorageError error); 315 CacheStorageError error);
315 void DeleteDidOpenEntry(const GURL& origin, 316 void DeleteDidOpenEntry(const GURL& origin,
316 std::unique_ptr<ServiceWorkerFetchRequest> request, 317 std::unique_ptr<ServiceWorkerFetchRequest> request,
317 const CacheStorageCache::ErrorCallback& callback, 318 const CacheStorageCache::ErrorCallback& callback,
318 std::unique_ptr<disk_cache::Entry*> entryptr, 319 std::unique_ptr<disk_cache::Entry*> entryptr,
319 int rv); 320 int rv);
320 321
321 // Keys callbacks. 322 // Keys callbacks.
322 void KeysImpl(const RequestsCallback& callback); 323 void KeysImpl(std::unique_ptr<ServiceWorkerFetchRequest> request,
324 const CacheStorageCacheQueryParams& options,
325 const RequestsCallback& callback);
323 void KeysDidQueryCache( 326 void KeysDidQueryCache(
324 const RequestsCallback& callback, 327 const RequestsCallback& callback,
325 CacheStorageError error, 328 CacheStorageError error,
326 std::unique_ptr<QueryCacheResults> query_cache_results); 329 std::unique_ptr<QueryCacheResults> query_cache_results);
327 330
328 void CloseImpl(const base::Closure& callback); 331 void CloseImpl(const base::Closure& callback);
329 332
330 void SizeImpl(const SizeCallback& callback); 333 void SizeImpl(const SizeCallback& callback);
331 334
332 void GetSizeThenCloseDidGetSize(const SizeCallback& callback, 335 void GetSizeThenCloseDidGetSize(const SizeCallback& callback,
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 bool memory_only_; 386 bool memory_only_;
384 387
385 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_; 388 base::WeakPtrFactory<CacheStorageCache> weak_ptr_factory_;
386 389
387 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache); 390 DISALLOW_COPY_AND_ASSIGN(CacheStorageCache);
388 }; 391 };
389 392
390 } // namespace content 393 } // namespace content
391 394
392 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_ 395 #endif // CONTENT_BROWSER_CACHE_STORAGE_CACHE_STORAGE_CACHE_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/cache_storage/cache_storage_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698