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

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

Issue 1832863002: [CacheStorage] Make CacheStorage::MatchAllCaches return in order (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix layout test 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.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.h
diff --git a/content/browser/cache_storage/cache_storage.h b/content/browser/cache_storage/cache_storage.h
index aed53b643ab41bb65e1f53b739c191fcc2eddd25..e81dd2f144100e132c5fdfdf5a56270d1d15dea1 100644
--- a/content/browser/cache_storage/cache_storage.h
+++ b/content/browser/cache_storage/cache_storage.h
@@ -86,9 +86,8 @@ class CONTENT_EXPORT CacheStorage {
const CacheStorageCache::ResponseCallback& callback);
// Calls match on all of the caches in parallel, calling |callback| with the
- // first response found. Note that if multiple caches have the same
- // request/response then it is not defined which cache's response will be
- // returned. If no response is found then |callback| is called with
+ // response from the first cache (in order of cache creation) to have the
+ // entry. If no response is found then |callback| is called with
// CACHE_STORAGE_ERROR_NOT_FOUND.
void MatchAllCaches(scoped_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCache::ResponseCallback& callback);
@@ -108,10 +107,10 @@ class CONTENT_EXPORT CacheStorage {
private:
friend class TestCacheStorage;
-
+ class CacheLoader;
class MemoryLoader;
class SimpleCacheLoader;
- class CacheLoader;
+ struct CacheMatchResponse;
typedef std::map<std::string, base::WeakPtr<CacheStorageCache>> CacheMap;
@@ -178,14 +177,16 @@ class CONTENT_EXPORT CacheStorage {
// The MatchAllCaches callbacks are below.
void MatchAllCachesImpl(scoped_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCache::ResponseCallback& callback);
- void MatchAllCachesDidMatch(scoped_refptr<CacheStorageCache> cache,
- const base::Closure& barrier_closure,
- CacheStorageCache::ResponseCallback* callback,
- CacheStorageError error,
- scoped_ptr<ServiceWorkerResponse> response,
- scoped_ptr<storage::BlobDataHandle> handle);
+ void MatchAllCachesDidMatch(
+ scoped_refptr<CacheStorageCache> cache,
+ CacheMatchResponse* out_match_response,
+ const base::Closure& barrier_closure,
+ CacheStorageError error,
+ scoped_ptr<ServiceWorkerResponse> service_worker_response,
+ scoped_ptr<storage::BlobDataHandle> handle);
void MatchAllCachesDidMatchAll(
- scoped_ptr<CacheStorageCache::ResponseCallback> callback);
+ scoped_ptr<std::vector<CacheMatchResponse>> match_responses,
+ const CacheStorageCache::ResponseCallback& callback);
void GetSizeThenCloseAllCachesImpl(const SizeCallback& callback);
« no previous file with comments | « no previous file | content/browser/cache_storage/cache_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698