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

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

Issue 1957663004: [CacheStorage] Prioritize Size operations over other scheduled operations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Merge conflict fix Created 4 years, 7 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..158e24e5009750544402dbd3ec00a39f4924881e 100644
--- a/content/browser/cache_storage/cache_storage_cache.h
+++ b/content/browser/cache_storage/cache_storage_cache.h
@@ -111,7 +111,10 @@ class CONTENT_EXPORT CacheStorageCache
void Close(const base::Closure& callback);
// The size of the cache's contents. This runs in parallel with other Cache
- // operations.
+ // operations. This is because QuotaManager is a dependency of the Put
+ // operation and QuotaManager calls Size. If the cache isn't yet initialized,
+ // runs immediately after initialization, before any pending operations in the
+ // scheduler are run.
void Size(const SizeCallback& callback);
// Gets the cache's size, closes the backend, and then runs |callback| with
@@ -298,6 +301,7 @@ class CONTENT_EXPORT CacheStorageCache
base::WeakPtr<storage::BlobStorageContext> blob_storage_context_;
BackendState backend_state_ = BACKEND_UNINITIALIZED;
scoped_ptr<CacheStorageScheduler> scheduler_;
+ std::vector<SizeCallback> pending_size_callbacks_;
bool initializing_ = false;
int64_t cache_size_ = 0;
« 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