Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1344)

Unified Diff: content/child/child_discardable_shared_memory_manager.cc

Issue 1259333003: [tracing] Add SkResourceCache as suballocation to avoid double counting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@skia_v1
Patch Set: Clean up. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
« no previous file with comments | « no previous file | content/common/discardable_shared_memory_heap.cc » ('j') | skia/ext/skia_memory_dump_provider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698