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

Unified Diff: net/disk_cache/memory/mem_backend_impl.cc

Issue 2784803004: [HTTP Cache] Prevent memory backend from exceeding its max size (Closed)
Patch Set: Address comments from PS4 Created 3 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 | « net/disk_cache/memory/mem_backend_impl.h ('k') | net/disk_cache/memory/mem_entry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/memory/mem_backend_impl.cc
diff --git a/net/disk_cache/memory/mem_backend_impl.cc b/net/disk_cache/memory/mem_backend_impl.cc
index a7ad28b8d8d1e163aae095faa569e119e91bb864..e6de26f05de0a818c429ec1c68bc41115a8e8667 100644
--- a/net/disk_cache/memory/mem_backend_impl.cc
+++ b/net/disk_cache/memory/mem_backend_impl.cc
@@ -48,7 +48,7 @@ MemBackendImpl::~MemBackendImpl() {
DCHECK(CheckLRUListOrder(lru_list_));
while (!entries_.empty())
entries_.begin()->second->Doom();
- DCHECK(!current_size_);
+ DCHECK_EQ(0, current_size_);
}
// static
@@ -128,6 +128,10 @@ void MemBackendImpl::ModifyStorageSize(int32_t delta) {
EvictIfNeeded();
}
+bool MemBackendImpl::HasExceededStorageSize() const {
+ return current_size_ > max_size_;
+}
+
net::CacheType MemBackendImpl::GetCacheType() const {
return net::MEMORY_CACHE;
}
« no previous file with comments | « net/disk_cache/memory/mem_backend_impl.h ('k') | net/disk_cache/memory/mem_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698