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

Unified Diff: base/memory/shared_memory_tracker.cc

Issue 2923123004: [memory-infra] Add API to ProcessMemoryDump to create ownership edges for base::SharedMemory (Closed)
Patch Set: fix typo. Created 3 years, 6 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
« no previous file with comments | « no previous file | base/trace_event/memory_allocator_dump_guid.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/shared_memory_tracker.cc
diff --git a/base/memory/shared_memory_tracker.cc b/base/memory/shared_memory_tracker.cc
index 7f16a6895c1110b5e63d79bd2242199a5cf50ad3..10a5745f01f63e6797a5cfbc88c97e6ae7e176ed 100644
--- a/base/memory/shared_memory_tracker.cc
+++ b/base/memory/shared_memory_tracker.cc
@@ -89,11 +89,10 @@ bool SharedMemoryTracker::OnMemoryDump(const trace_event::MemoryDumpArgs& args,
pmd->CreateSharedGlobalAllocatorDump(dump_guid);
global_dump->AddScalar(trace_event::MemoryAllocatorDump::kNameSize,
trace_event::MemoryAllocatorDump::kUnitsBytes, size);
- // TOOD(hajimehoshi): Detect which the shared memory comes from browser,
- // renderer or GPU process.
- // TODO(hajimehoshi): Shared memory reported by GPU and discardable is
- // currently double-counted. Add ownership edges to avoid this.
- pmd->AddOwnershipEdge(local_dump->guid(), global_dump->guid());
+
+ // The edges will be overriden by the clients with correct importance.
+ pmd->AddOverridableOwnershipEdge(local_dump->guid(), global_dump->guid(),
+ 0 /* importance */);
}
return true;
}
« no previous file with comments | « no previous file | base/trace_event/memory_allocator_dump_guid.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698