| Index: net/disk_cache/simple/simple_backend_impl.cc
|
| diff --git a/net/disk_cache/simple/simple_backend_impl.cc b/net/disk_cache/simple/simple_backend_impl.cc
|
| index e5645e357ebd44aecac4b580e3fb88444f7dc7b9..9a284d338ce36907797bad2e334bddba23276635 100644
|
| --- a/net/disk_cache/simple/simple_backend_impl.cc
|
| +++ b/net/disk_cache/simple/simple_backend_impl.cc
|
| @@ -30,6 +30,7 @@
|
| #include "base/threading/sequenced_worker_pool.h"
|
| #include "base/threading/thread_task_runner_handle.h"
|
| #include "base/time/time.h"
|
| +#include "base/trace_event/memory_usage_estimator.h"
|
| #include "net/base/net_errors.h"
|
| #include "net/disk_cache/cache_util.h"
|
| #include "net/disk_cache/simple/simple_entry_format.h"
|
| @@ -552,6 +553,14 @@ void SimpleBackendImpl::OnExternalCacheHit(const std::string& key) {
|
| index_->UseIfExists(simple_util::GetEntryHashKey(key));
|
| }
|
|
|
| +size_t SimpleBackendImpl::EstimateMemoryUsage() const {
|
| + size_t memory_estimate = 0;
|
| + if (index_)
|
| + memory_estimate += base::trace_event::EstimateMemoryUsage(index_);
|
| + memory_estimate += base::trace_event::EstimateMemoryUsage(active_entries_);
|
| + return memory_estimate;
|
| +}
|
| +
|
| void SimpleBackendImpl::InitializeIndex(const CompletionCallback& callback,
|
| const DiskStatResult& result) {
|
| if (result.net_error == net::OK) {
|
|
|