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

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

Issue 2723553002: Keep track of byte usage of the memory cache backend (Closed)
Patch Set: Created 3 years, 10 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
Index: net/disk_cache/memory/mem_entry_impl.cc
diff --git a/net/disk_cache/memory/mem_entry_impl.cc b/net/disk_cache/memory/mem_entry_impl.cc
index cfe23e75cf70066caf36a89ec77b05ded1f5af03..9153fea32ccddcc9dec1e94bfd5c59a0564a1e2e 100644
--- a/net/disk_cache/memory/mem_entry_impl.cc
+++ b/net/disk_cache/memory/mem_entry_impl.cc
@@ -253,6 +253,12 @@ int MemEntryImpl::ReadyForSparseIO(const CompletionCallback& callback) {
return net::OK;
}
+size_t MemEntryImpl::EstimateMemoryUsage() const {
+ return base::trace_event::EstimateMemoryUsage(data_) +
+ base::trace_event::EstimateMemoryUsage(key_) +
+ base::trace_event::EstimateMemoryUsage(children_);
xunjieli 2017/02/27 18:51:31 I suppose the |children_| entries are accounted fo
jkarlin 2017/02/28 13:10:50 Ah, you're right. Switched to using GetStorageSize
xunjieli 2017/02/28 14:51:23 Ah, sorry for the confusion, the previous patchset
jkarlin 2017/02/28 15:50:54 Done.
+}
+
// ------------------------------------------------------------------------
MemEntryImpl::MemEntryImpl(MemBackendImpl* backend,
« net/disk_cache/memory/mem_backend_impl.cc ('K') | « net/disk_cache/memory/mem_entry_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698