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..0991b9566fdae4c5ae3c06b9efe7527f51a7438e 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; |
| +} |
| + |
| SimpleIndex::SimpleIndex( |
| const scoped_refptr<base::SingleThreadTaskRunner>& io_thread, |
| SimpleIndexDelegate* delegate, |
| @@ -268,6 +273,10 @@ uint64_t SimpleIndex::GetCacheSizeBetween(base::Time initial_time, |
| return size; |
| } |
| +size_t SimpleIndex::EstimateMemoryUsage() const { |
| + return base::trace_event::EstimateMemoryUsage(entries_set_); |
|
ssid
2017/01/31 22:24:19
Do we need a todo here for other objects here, lik
xunjieli
2017/02/01 01:15:52
I added |removed_entries_|. SimpleIndexFile doesn'
|
| +} |
| + |
| void SimpleIndex::Insert(uint64_t entry_hash) { |
| DCHECK(io_thread_checker_.CalledOnValidThread()); |
| // Upon insert we don't know yet the size of the entry. |