| Index: net/disk_cache/memory/mem_backend_impl.cc
|
| diff --git a/net/disk_cache/memory/mem_backend_impl.cc b/net/disk_cache/memory/mem_backend_impl.cc
|
| index 65e14d71686da03b3c1fd36b58a91024837f4cb1..a7ad28b8d8d1e163aae095faa569e119e91bb864 100644
|
| --- a/net/disk_cache/memory/mem_backend_impl.cc
|
| +++ b/net/disk_cache/memory/mem_backend_impl.cc
|
| @@ -12,6 +12,7 @@
|
| #include "base/memory/ptr_util.h"
|
| #include "base/sys_info.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/memory/mem_entry_impl.h"
|
| @@ -284,11 +285,25 @@ void MemBackendImpl::OnExternalCacheHit(const std::string& key) {
|
| it->second->UpdateStateOnUse(MemEntryImpl::ENTRY_WAS_NOT_MODIFIED);
|
| }
|
|
|
| -size_t MemBackendImpl::EstimateMemoryUsage() const {
|
| +size_t MemBackendImpl::DumpMemoryStats(
|
| + base::trace_event::ProcessMemoryDump* pmd,
|
| + const std::string& parent_absolute_name) const {
|
| + base::trace_event::MemoryAllocatorDump* dump =
|
| + pmd->CreateAllocatorDump(parent_absolute_name + "/memory_backend");
|
| +
|
| // Entries in lru_list_ will be counted by EMU but not in entries_ since
|
| // they're pointers.
|
| - return base::trace_event::EstimateMemoryUsage(lru_list_) +
|
| - base::trace_event::EstimateMemoryUsage(entries_);
|
| + size_t size = base::trace_event::EstimateMemoryUsage(lru_list_) +
|
| + base::trace_event::EstimateMemoryUsage(entries_);
|
| + dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
|
| + base::trace_event::MemoryAllocatorDump::kUnitsBytes, size);
|
| + dump->AddScalar("mem_backend_size",
|
| + base::trace_event::MemoryAllocatorDump::kUnitsBytes,
|
| + current_size_);
|
| + dump->AddScalar("mem_backend_max_size",
|
| + base::trace_event::MemoryAllocatorDump::kUnitsBytes,
|
| + max_size_);
|
| + return size;
|
| }
|
|
|
| void MemBackendImpl::EvictIfNeeded() {
|
|
|