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 8af1d4dcc09912c2a6569fec88df88a33e54a0d7..3deda9f5472d7be701b73a95e4540f1a29a98246 100644 |
--- a/content/common/host_discardable_shared_memory_manager.cc |
+++ b/content/common/host_discardable_shared_memory_manager.cc |
@@ -201,8 +201,25 @@ bool HostDiscardableSharedMemoryManager::OnMemoryDump( |
base::trace_event::MemoryAllocatorDumpGuid shared_segment_guid = |
DiscardableSharedMemoryHeap::GetSegmentGUIDForTracing( |
child_tracing_process_id, segment_id); |
- pmd->CreateSharedGlobalAllocatorDump(shared_segment_guid); |
+ base::trace_event::MemoryAllocatorDump* global_dump = |
+ pmd->CreateSharedGlobalAllocatorDump(shared_segment_guid); |
pmd->AddOwnershipEdge(dump->guid(), shared_segment_guid); |
+ |
+#if defined(COUNT_RESIDENT_BYTES_SUPPORTED) |
+ if (args.level_of_detail == |
+ base::trace_event::MemoryDumpLevelOfDetail::DETAILED) { |
+ size_t resident_size = |
+ base::trace_event::ProcessMemoryDump::CountResidentBytes( |
+ segment->memory()->memory(), segment->memory()->mapped_size()); |
+ |
+ // This is added to the global dump since it has to be attributed to |
+ // both the allocator dumps involved. |
+ global_dump->AddScalar( |
+ "resident_size", |
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes, |
+ static_cast<uint64>(resident_size)); |
+ } |
+#endif // defined(COUNT_RESIDENT_BYTES_SUPPORTED) |
} |
} |
return true; |