Chromium Code Reviews| 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..d285c22f23afc88da3916b68b1a620e93c4aaffb 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" |
| @@ -139,6 +140,10 @@ bool EntryMetadata::Deserialize(base::PickleIterator* it) { |
| return true; |
| } |
| +size_t EntryMetadata::EstimateMemoryUsage() const { |
| + return 0; |
|
jkarlin
2017/02/21 16:23:29
At least index_file_ should be counted here right?
|
| +} |
| + |
| SimpleIndex::SimpleIndex( |
| const scoped_refptr<base::SingleThreadTaskRunner>& io_thread, |
| SimpleIndexDelegate* delegate, |
| @@ -268,6 +273,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. |