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

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

Issue 2116783002: [CacheStorage] Don't call GetUsageAndQuota from a scheduled operation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: 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_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 4cb77ddb70afcfe7ae4338d3a056c503a4d83d60..70cf7b095077fae908ef987d9e2e87abe8f96d81 100644
--- a/content/browser/cache_storage/cache_storage_cache.h
+++ b/content/browser/cache_storage/cache_storage_cache.h
@@ -40,8 +40,8 @@ class TestCacheStorageCache;
// Represents a ServiceWorker Cache as seen in
// https://slightlyoff.github.io/ServiceWorker/spec/service_worker/ The
-// asynchronous methods are executed serially (except for Size). Callbacks to
-// the public functions will be called so long as the cache object lives.
+// asynchronous methods are executed serially. Callbacks to the public functions
+// will be called so long as the cache object lives.
class CONTENT_EXPORT CacheStorageCache
: public base::RefCounted<CacheStorageCache> {
public:
@@ -99,6 +99,13 @@ class CONTENT_EXPORT CacheStorageCache
// http://crbug.com/486637
void BatchOperation(const std::vector<CacheStorageBatchOperation>& operations,
const ErrorCallback& callback);
+ void BatchDidGetUsageAndQuota(
+ const std::vector<CacheStorageBatchOperation>& operations,
+ const ErrorCallback& callback,
+ int64_t space_required,
+ storage::QuotaStatusCode status_code,
+ int64_t usage,
+ int64_t quota);
void BatchDidOneOperation(const base::Closure& barrier_closure,
ErrorCallback* callback,
CacheStorageError error);
@@ -112,11 +119,7 @@ class CONTENT_EXPORT CacheStorageCache
// will exit early. Close should only be called once per CacheStorageCache.
void Close(const base::Closure& callback);
- // The size of the cache's contents. This runs in parallel with other Cache
- // 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.
+ // The size of the cache's contents.
void Size(const SizeCallback& callback);
// Gets the cache's size, closes the backend, and then runs |callback| with
@@ -305,7 +308,6 @@ 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