Chromium Code Reviews| Index: content/child/child_discardable_shared_memory_manager.cc |
| diff --git a/content/child/child_discardable_shared_memory_manager.cc b/content/child/child_discardable_shared_memory_manager.cc |
| index 5bdcef7337279443eb335df5bdde37cdbd926d88..180fb191e0a64a734fa0838c879f6f7dc3a82b70 100644 |
| --- a/content/child/child_discardable_shared_memory_manager.cc |
| +++ b/content/child/child_discardable_shared_memory_manager.cc |
| @@ -192,6 +192,22 @@ ChildDiscardableSharedMemoryManager::AllocateLockedDiscardableMemory( |
| bool ChildDiscardableSharedMemoryManager::OnMemoryDump( |
| base::trace_event::ProcessMemoryDump* pmd) { |
| + // Creates a common dump for all the sub-allocated objects from discardable |
| + // memory. To expess any suballocation, the dump providers need to create a |
| + // sub-allocation edge from this node. |
| + // Eg. : pmd->AddSuballocation(skia_dump_guid, |
| + // "discardable/allocated_objects"); |
| + base::trace_event::MemoryAllocatorDump* objects_dump = |
| + pmd->CreateAllocatorDump("discardable/allocated_objects"); |
|
petrcermak
2015/07/29 11:53:34
Any chance this name could be a constant like http
ssid
2015/07/29 16:20:51
Done.
|
| + base::trace_event::MemoryAllocatorDump* discardable_segments_dump = |
| + pmd->CreateAllocatorDump("discardable/segments"); |
|
petrcermak
2015/07/29 11:53:34
Could this be a constant?
ssid
2015/07/29 16:20:51
Done.
|
| + |
| + // The discardable memory segments will go under the dump |
| + // "discardable/segments" and any sub-allocations under |
| + // "discardable/allocated_objects" will be owned by it. |
|
petrcermak
2015/07/29 11:53:34
The relationship is reversed (in the comment).
ssid
2015/07/29 16:20:51
Done.
|
| + pmd->AddOwnershipEdge(objects_dump->guid(), |
| + discardable_segments_dump->guid()); |
| + |
| base::AutoLock lock(lock_); |
| return heap_.OnMemoryDump(pmd); |
| } |