Index: net/disk_cache/simple/simple_index.cc |
diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc |
index a654faf37182e5287f715c87cce96efc9bc37045..57f9603a391e44c99c99192b7e28a54f5878ba8c 100644 |
--- a/net/disk_cache/simple/simple_index.cc |
+++ b/net/disk_cache/simple/simple_index.cc |
@@ -23,6 +23,7 @@ |
#include "base/task_runner.h" |
#include "base/threading/worker_pool.h" |
#include "base/time/time.h" |
+#include "base/trace_event/memory_usage_estimator.h" |
#include "net/base/net_errors.h" |
#include "net/disk_cache/simple/simple_entry_format.h" |
#include "net/disk_cache/simple/simple_histogram_macros.h" |
@@ -268,6 +269,11 @@ uint64_t SimpleIndex::GetCacheSizeBetween(base::Time initial_time, |
return size; |
} |
+size_t SimpleIndex::EstimateMemoryUsage() const { |
+ return base::trace_event::EstimateMemoryUsage(entries_set_) + |
+ base::trace_event::EstimateMemoryUsage(removed_entries_); |
+} |
+ |
void SimpleIndex::Insert(uint64_t entry_hash) { |
DCHECK(io_thread_checker_.CalledOnValidThread()); |
// Upon insert we don't know yet the size of the entry. |