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

Unified Diff: base/trace_event/winheap_dump_provider_win.cc

Issue 1128733002: Update from https://crrev.com/328418 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 3a4fd8704d3c18fd7c1cb551c67afec742181359..e1e9bcf4a7c454bbdfb1daf72b1c266c0eea7132 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.
+// contains the information about this heap, and |dump_absolute_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);
+ const std::string& dump_absolute_name) {
+ MemoryAllocatorDump* dump = pmd->CreateAllocatorDump(dump_absolute_name);
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;
}
@@ -38,7 +38,7 @@ WinHeapDumpProvider* WinHeapDumpProvider::GetInstance() {
LeakySingletonTraits<WinHeapDumpProvider>>::get();
}
-bool WinHeapDumpProvider::DumpInto(ProcessMemoryDump* pmd) {
+bool WinHeapDumpProvider::OnMemoryDump(ProcessMemoryDump* pmd) {
// Retrieves the number of heaps in the current process.
DWORD number_of_heaps = ::GetProcessHeaps(0, NULL);
WinHeapInfo all_heap_info = {0};
@@ -68,16 +68,12 @@ bool WinHeapDumpProvider::DumpInto(ProcessMemoryDump* pmd) {
all_heap_info.block_count += heap_info.block_count;
}
// Report the heap dump.
- if (!ReportHeapDump(pmd, all_heap_info, MemoryAllocatorDump::kRootHeap))
+ if (!ReportHeapDump(pmd, all_heap_info, "winheap"))
return false;
return true;
}
-const char* WinHeapDumpProvider::GetFriendlyName() const {
- return kDumperFriendlyName;
-}
-
bool WinHeapDumpProvider::GetHeapInformation(
WinHeapInfo* heap_info,
const std::set<void*>& block_to_skip) {
« no previous file with comments | « base/trace_event/winheap_dump_provider_win.h ('k') | base/trace_event/winheap_dump_provider_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698