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..c58e4e9f1238545ca9ecbc6bb51e616162ee3b37 100644 |
--- a/content/common/host_discardable_shared_memory_manager.cc |
+++ b/content/common/host_discardable_shared_memory_manager.cc |
@@ -64,8 +64,22 @@ class DiscardableMemoryImpl : public base::DiscardableMemory { |
return shared_memory_->memory(); |
} |
+ base::trace_event::MemoryAllocatorDump* CreateMemoryAllocatorDump( |
+ const char* name, |
+ base::trace_event::ProcessMemoryDump* pmd) 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_; |
+ size_t size_; |
reveman
2015/08/24 16:50:06
is this needed?
|
const base::Closure deleted_callback_; |
bool is_locked_; |