| 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 e81877c9017bef6324ef7883b2daa1357ca74456..88d2741e9797f8452efeea09fa1bbd376ed9354b 100644
|
| --- a/net/disk_cache/simple/simple_backend_impl.cc
|
| +++ b/net/disk_cache/simple/simple_backend_impl.cc
|
| @@ -31,6 +31,7 @@
|
| #include "base/threading/thread_task_runner_handle.h"
|
| #include "base/time/time.h"
|
| #include "base/trace_event/memory_usage_estimator.h"
|
| +#include "base/trace_event/process_memory_dump.h"
|
| #include "net/base/net_errors.h"
|
| #include "net/disk_cache/cache_util.h"
|
| #include "net/disk_cache/simple/simple_entry_format.h"
|
| @@ -560,11 +561,19 @@ void SimpleBackendImpl::OnExternalCacheHit(const std::string& key) {
|
| index_->UseIfExists(simple_util::GetEntryHashKey(key));
|
| }
|
|
|
| -size_t SimpleBackendImpl::EstimateMemoryUsage() const {
|
| +size_t SimpleBackendImpl::DumpMemoryStats(
|
| + base::trace_event::ProcessMemoryDump* pmd,
|
| + const std::string& parent_absolute_name) const {
|
| + base::trace_event::MemoryAllocatorDump* dump =
|
| + pmd->CreateAllocatorDump(parent_absolute_name + "/simple_backend");
|
| +
|
| + size_t size = base::trace_event::EstimateMemoryUsage(index_) +
|
| + base::trace_event::EstimateMemoryUsage(active_entries_);
|
| // TODO(xunjieli): crbug.com/669108. Track |entries_pending_doom_| once
|
| // base::Closure is suppported in memory_usage_estimator.h.
|
| - return base::trace_event::EstimateMemoryUsage(index_) +
|
| - base::trace_event::EstimateMemoryUsage(active_entries_);
|
| + dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
|
| + base::trace_event::MemoryAllocatorDump::kUnitsBytes, size);
|
| + return size;
|
| }
|
|
|
| void SimpleBackendImpl::InitializeIndex(const CompletionCallback& callback,
|
|
|