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

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

Issue 2040173002: [CacheStorage] Clean up CacheStorageCache lifetimes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify and caught one more reference Created 4 years, 6 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 2cea28b2cd7a281dc0f9b782e9945d1360055375..97492ea29dde964b68cc3f4200a17c256c4a2f2b 100644
--- a/content/browser/cache_storage/cache_storage.h
+++ b/content/browser/cache_storage/cache_storage.h
@@ -138,7 +138,6 @@ class CONTENT_EXPORT CacheStorage {
const CacheAndErrorCallback& callback,
scoped_refptr<CacheStorageCache> cache);
void CreateCacheDidWriteIndex(const CacheAndErrorCallback& callback,
- scoped_refptr<CacheStorageCache> cache,
bool success);
// The HasCache callbacks are below.
@@ -152,7 +151,6 @@ class CONTENT_EXPORT CacheStorage {
void DeleteCacheDidClose(const std::string& cache_name,
const BoolAndErrorCallback& callback,
const StringVector& ordered_cache_names,
- scoped_refptr<CacheStorageCache> cache,
int64_t cache_size);
void DeleteCacheDidWriteIndex(const std::string& cache_name,
const BoolAndErrorCallback& callback,
@@ -168,8 +166,7 @@ class CONTENT_EXPORT CacheStorage {
void MatchCacheImpl(const std::string& cache_name,
std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCache::ResponseCallback& callback);
- void MatchCacheDidMatch(scoped_refptr<CacheStorageCache> cache,
- const CacheStorageCache::ResponseCallback& callback,
+ void MatchCacheDidMatch(const CacheStorageCache::ResponseCallback& callback,
CacheStorageError error,
std::unique_ptr<ServiceWorkerResponse> response,
std::unique_ptr<storage::BlobDataHandle> handle);
@@ -178,7 +175,6 @@ class CONTENT_EXPORT CacheStorage {
void MatchAllCachesImpl(std::unique_ptr<ServiceWorkerFetchRequest> request,
const CacheStorageCache::ResponseCallback& callback);
void MatchAllCachesDidMatch(
- scoped_refptr<CacheStorageCache> cache,
CacheMatchResponse* out_match_response,
const base::Closure& barrier_closure,
CacheStorageError error,
@@ -191,6 +187,8 @@ class CONTENT_EXPORT CacheStorage {
void GetSizeThenCloseAllCachesImpl(const SizeCallback& callback);
void SizeImpl(const SizeCallback& callback);
+ void SizeRetrievedFromAllCaches(std::unique_ptr<int64_t> accumulator,
+ const CacheStorage::SizeCallback& callback);
void PendingClosure(const base::Closure& callback);
void PendingBoolAndErrorCallback(const BoolAndErrorCallback& callback,
@@ -243,6 +241,10 @@ class CONTENT_EXPORT CacheStorage {
// The origin that this CacheStorage is associated with.
GURL origin_;
+ // Used to keep caches alive during async operations.
+ scoped_refptr<CacheStorageCache> callback_cache_;
+ std::vector<scoped_refptr<CacheStorageCache>> callback_caches_;
+
base::WeakPtrFactory<CacheStorage> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(CacheStorage);
« 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