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

Unified Diff: base/trace_event/winheap_dump_provider_win.cc

Issue 1105143003: [tracing] Simplify the MemoryAllocatorDump API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplif_2
Patch Set: Created 5 years, 8 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/trace_event/winheap_dump_provider_win.cc
diff --git a/base/trace_event/winheap_dump_provider_win.cc b/base/trace_event/winheap_dump_provider_win.cc
index d8a3bd2804c431fba8c835141d879b1f10a1f1c3..b9e44534f188453ed86d58fa7edbc4e7686c1697 100644
--- a/base/trace_event/winheap_dump_provider_win.cc
+++ b/base/trace_event/winheap_dump_provider_win.cc
@@ -13,21 +13,21 @@ namespace trace_event {
namespace {
-const char kDumperFriendlyName[] = "winheap";
-
// Report a heap dump to a process memory dump. The |heap_info| structure
// contains the information about this heap, and |heap_name| will be used to
// represent it in the report.
bool ReportHeapDump(ProcessMemoryDump* pmd,
const WinHeapInfo& heap_info,
const std::string& heap_name) {
- MemoryAllocatorDump* dump =
- pmd->CreateAllocatorDump(kDumperFriendlyName, heap_name);
+ MemoryAllocatorDump* dump = pmd->CreateAllocatorDump("winheap");
if (!dump)
return false;
- dump->set_physical_size_in_bytes(heap_info.committed_size);
- dump->set_allocated_objects_count(heap_info.block_count);
- dump->set_allocated_objects_size_in_bytes(heap_info.allocated_size);
+ dump->AddScalar(MemoryAllocatorDump::kNameOuterSize,
+ MemoryAllocatorDump::kUnitsBytes, heap_info.committed_size);
+ dump->AddScalar(MemoryAllocatorDump::kNameInnerSize,
+ MemoryAllocatorDump::kUnitsBytes, heap_info.allocated_size);
+ dump->AddScalar(MemoryAllocatorDump::kNameObjectsCount,
+ MemoryAllocatorDump::kUnitsObjects, heap_info.block_count);
return true;
}
« base/trace_event/process_memory_dump.h ('K') | « base/trace_event/process_memory_dump.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698