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

Unified Diff: content/browser/cache_storage/cache_storage_cache.h

Issue 1774153003: Match all Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/cache_storage/cache_storage_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/cache_storage/cache_storage_cache.h
diff --git a/content/browser/cache_storage/cache_storage_cache.h b/content/browser/cache_storage/cache_storage_cache.h
index 72e1c9a4f0efce5ab116acbf39eab3d18d5d83b4..69ef938aeb3ebe3460aaca2a4da9bcca063ada79 100644
--- a/content/browser/cache_storage/cache_storage_cache.h
+++ b/content/browser/cache_storage/cache_storage_cache.h
@@ -45,17 +45,37 @@ class TestCacheStorageCache;
class CONTENT_EXPORT CacheStorageCache
: public base::RefCounted<CacheStorageCache> {
public:
+ using Requests = std::vector<ServiceWorkerFetchRequest>;
+ using Responses = std::vector<ServiceWorkerResponse>;
+ using BlobDataHandles = std::vector<storage::BlobDataHandle>;
+
+ struct QueryCacheResults;
+ using QueryCacheResultsCallback =
+ base::Callback<void(CacheStorageError, scoped_ptr<QueryCacheResults>)>;
+
+ struct QueryCacheResults {
+ QueryCacheResults(scoped_ptr<ServiceWorkerFetchRequest> request,
+ const CacheStorageCacheQueryParams& match_params,
+ const QueryCacheResultsCallback& callback);
+ ~QueryCacheResults();
+
+ scoped_ptr<ServiceWorkerFetchRequest> request;
+ CacheStorageCacheQueryParams match_params;
+ QueryCacheResultsCallback callback;
+
+ scoped_ptr<Requests> requests;
+ scoped_ptr<Responses> responses;
+ scoped_ptr<BlobDataHandles> blob_data_handles;
+ };
+
using ErrorCallback = base::Callback<void(CacheStorageError)>;
using ResponseCallback =
base::Callback<void(CacheStorageError,
scoped_ptr<ServiceWorkerResponse>,
scoped_ptr<storage::BlobDataHandle>)>;
- using Responses = std::vector<ServiceWorkerResponse>;
- using BlobDataHandles = std::vector<storage::BlobDataHandle>;
using ResponsesCallback = base::Callback<void(CacheStorageError,
scoped_ptr<Responses>,
scoped_ptr<BlobDataHandles>)>;
- using Requests = std::vector<ServiceWorkerFetchRequest>;
using RequestsCallback =
base::Callback<void(CacheStorageError, scoped_ptr<Requests>)>;
using SizeCallback = base::Callback<void(int64_t)>;
@@ -80,7 +100,7 @@ class CONTENT_EXPORT CacheStorageCache
// no responses, returns CACHE_STORAGE_OK and an empty vector.
void MatchAll(scoped_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCacheQueryParams& match_params,
- const ResponsesCallback& callback);
+ const QueryCacheResultsCallback& callback);
// Runs given batch operations. This corresponds to the Batch Cache Operations
// algorithm in the spec.
@@ -127,7 +147,6 @@ class CONTENT_EXPORT CacheStorageCache
friend class TestCacheStorageCache;
struct OpenAllEntriesContext;
- struct MatchAllContext;
struct KeysContext;
struct PutContext;
@@ -178,17 +197,23 @@ class CONTENT_EXPORT CacheStorageCache
disk_cache::ScopedEntryPtr entry,
scoped_ptr<CacheMetadata> headers);
- // MatchAll callbacks
- void MatchAllImpl(scoped_ptr<MatchAllContext> context);
- void MatchAllDidOpenAllEntries(
- scoped_ptr<MatchAllContext> context,
+ // QueryCache callbacks
+ void QueryCache(scoped_ptr<ServiceWorkerFetchRequest> request,
+ const CacheStorageCacheQueryParams& match_params,
+ const QueryCacheResultsCallback& callback);
+ void QueryCacheDidOpenAllEntries(
+ scoped_ptr<QueryCacheResults> results,
scoped_ptr<OpenAllEntriesContext> entries_context,
CacheStorageError error);
- void MatchAllProcessNextEntry(scoped_ptr<MatchAllContext> context,
- const Entries::iterator& iter);
- void MatchAllDidReadMetadata(scoped_ptr<MatchAllContext> context,
- const Entries::iterator& iter,
- scoped_ptr<CacheMetadata> metadata);
+ void QueryCacheProcessNextEntry(
+ scoped_ptr<QueryCacheResults> results,
+ scoped_ptr<OpenAllEntriesContext> entries_context,
+ const Entries::iterator& iter);
+ void QueryCacheDidReadMetadata(
+ scoped_ptr<QueryCacheResults> results,
+ scoped_ptr<OpenAllEntriesContext> entries_context,
+ const Entries::iterator& iter,
+ scoped_ptr<CacheMetadata> metadata);
// Puts the request and response object in the cache. The response body (if
// present) is stored in the cache, but not the request body. Returns OK on
@@ -273,10 +298,9 @@ class CONTENT_EXPORT CacheStorageCache
CacheStorageError error,
scoped_ptr<ServiceWorkerResponse> response,
scoped_ptr<storage::BlobDataHandle> blob_data_handle);
- void PendingResponsesCallback(const ResponsesCallback& callback,
+ void PendingQueryCacheResultsCallback(const QueryCacheResultsCallback& callback,
CacheStorageError error,
- scoped_ptr<Responses> responses,
- scoped_ptr<BlobDataHandles> blob_data_handles);
+ scoped_ptr<QueryCacheResults> results);
void PendingRequestsCallback(const RequestsCallback& callback,
CacheStorageError error,
scoped_ptr<Requests> requests);
« 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