Index: content/common/host_discardable_shared_memory_manager.cc |
diff --git a/content/common/host_discardable_shared_memory_manager.cc b/content/common/host_discardable_shared_memory_manager.cc |
index 7590c1f9bb4c6848f950a21da491494ab04ea0d8..f436037471223dc30b2253d5361a5f2f6d4b8e24 100644 |
--- a/content/common/host_discardable_shared_memory_manager.cc |
+++ b/content/common/host_discardable_shared_memory_manager.cc |
@@ -64,6 +64,19 @@ class DiscardableMemoryImpl : public base::DiscardableMemory { |
return shared_memory_->memory(); |
} |
+ base::trace_event::MemoryAllocatorDump* CreateMemoryAllocatorDump( |
+ const char* name, |
+ base::trace_event::ProcessMemoryDump* pmd) const override { |
+ // The memory could have been purged, but we still create a dump with |
+ // mapped_size. So, the size can be inaccurate. |
+ base::trace_event::MemoryAllocatorDump* dump = |
+ pmd->CreateAllocatorDump(name); |
+ dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize, |
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
+ shared_memory_->mapped_size()); |
+ return dump; |
+ } |
+ |
private: |
scoped_ptr<base::DiscardableSharedMemory> shared_memory_; |
const base::Closure deleted_callback_; |