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

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

Issue 1833673003: [CacheStorage] Notify QuotaManager when a cache is in use (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/cache_storage/cache_storage_cache.cc
diff --git a/content/browser/cache_storage/cache_storage_cache.cc b/content/browser/cache_storage/cache_storage_cache.cc
index 1e83b43c664c994c7fb37f480d314ae649147e5e..0615d6d69c8d386f086624d43e07bf05ea03706a 100644
--- a/content/browser/cache_storage/cache_storage_cache.cc
+++ b/content/browser/cache_storage/cache_storage_cache.cc
@@ -305,6 +305,7 @@ scoped_refptr<CacheStorageCache> CacheStorageCache::CreatePersistentCache(
}
CacheStorageCache::~CacheStorageCache() {
+ quota_manager_proxy_->NotifyOriginNoLongerInUse(origin_);
}
base::WeakPtr<CacheStorageCache> CacheStorageCache::AsWeakPtr() {
@@ -489,7 +490,12 @@ CacheStorageCache::CacheStorageCache(
blob_storage_context_(blob_context),
scheduler_(new CacheStorageScheduler()),
memory_only_(path.empty()),
- weak_ptr_factory_(this) {}
+ weak_ptr_factory_(this) {
+ DCHECK(!origin_.is_empty());
+ DCHECK(quota_manager_proxy_.get());
+
+ quota_manager_proxy_->NotifyOriginInUse(origin_);
+}
bool CacheStorageCache::LazyInitialize() {
switch (backend_state_) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698