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

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: nits. 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
Index: base/memory/shared_memory_tracker.cc
diff --git a/base/memory/shared_memory_tracker.cc b/base/memory/shared_memory_tracker.cc
index 8613f595336ada19357c900cf0ab9bf4d243b7f4..0628a7717137bee78d3162cac8ba73d2eaf5e662 100644
--- a/base/memory/shared_memory_tracker.cc
+++ b/base/memory/shared_memory_tracker.cc
@@ -73,11 +73,9 @@ bool SharedMemoryTracker::OnMemoryDump(const trace_event::MemoryDumpArgs& args,
global_dump->AddScalar(trace_event::MemoryAllocatorDump::kNameSize,
trace_event::MemoryAllocatorDump::kUnitsBytes,
size.second);
- // 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') | base/trace_event/process_memory_dump.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698