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

Side by Side Diff: content/child/web_memory_dump_provider_adapter.cc

Issue 1467453003: [Tracing] Make heap profiler type info a string (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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 unified diff | Download patch
« no previous file with comments | « base/trace_event/winheap_dump_provider_win_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/child/web_memory_dump_provider_adapter.h" 5 #include "content/child/web_memory_dump_provider_adapter.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/synchronization/lock.h" 8 #include "base/synchronization/lock.h"
9 #include "base/trace_event/heap_profiler_allocation_context.h" 9 #include "base/trace_event/heap_profiler_allocation_context.h"
10 #include "base/trace_event/heap_profiler_allocation_context_tracker.h" 10 #include "base/trace_event/heap_profiler_allocation_context_tracker.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 break; 69 break;
70 default: 70 default:
71 NOTREACHED(); 71 NOTREACHED();
72 return false; 72 return false;
73 } 73 }
74 WebProcessMemoryDumpImpl web_pmd_impl(args.level_of_detail, pmd); 74 WebProcessMemoryDumpImpl web_pmd_impl(args.level_of_detail, pmd);
75 75
76 if (args.level_of_detail == MemoryDumpLevelOfDetail::DETAILED && 76 if (args.level_of_detail == MemoryDumpLevelOfDetail::DETAILED &&
77 web_memory_dump_provider_->supportsHeapProfiling() && 77 web_memory_dump_provider_->supportsHeapProfiling() &&
78 g_heap_profiling_enabled) { 78 g_heap_profiling_enabled) {
79 HeapDumpWriter writer(pmd->session_state()->stack_frame_deduplicator()); 79 HeapDumpWriter writer(pmd->session_state()->stack_frame_deduplicator(),
80 pmd->session_state()->type_name_deduplicator());
80 TraceEventMemoryOverhead overhead; 81 TraceEventMemoryOverhead overhead;
81 82
82 { 83 {
83 AutoLock lock(g_allocation_register_lock.Get()); 84 AutoLock lock(g_allocation_register_lock.Get());
84 for (const auto& alloc_size : *g_allocation_register) 85 for (const auto& alloc_size : *g_allocation_register)
85 writer.InsertAllocation(alloc_size.context, alloc_size.size); 86 writer.InsertAllocation(alloc_size.context, alloc_size.size);
86 87
87 g_allocation_register->EstimateTraceMemoryOverhead(&overhead); 88 g_allocation_register->EstimateTraceMemoryOverhead(&overhead);
88 } 89 }
89 90
(...skipping 26 matching lines...) Expand all
116 web_memory_dump_provider_->onHeapProfilingEnabled(ReportAllocation, 117 web_memory_dump_provider_->onHeapProfilingEnabled(ReportAllocation,
117 ReportFree); 118 ReportFree);
118 } else { 119 } else {
119 web_memory_dump_provider_->onHeapProfilingEnabled(nullptr, nullptr); 120 web_memory_dump_provider_->onHeapProfilingEnabled(nullptr, nullptr);
120 } 121 }
121 122
122 g_heap_profiling_enabled = enabled; 123 g_heap_profiling_enabled = enabled;
123 } 124 }
124 125
125 } // namespace content 126 } // namespace content
OLDNEW
« no previous file with comments | « base/trace_event/winheap_dump_provider_win_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698