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

Unified Diff: base/trace_event/process_memory_dump.cc

Issue 2845633002: memory-infra: Remove is_enabled_ from MDM (Closed)
Patch Set: add not reached Created 3 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
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/process_memory_dump.cc
diff --git a/base/trace_event/process_memory_dump.cc b/base/trace_event/process_memory_dump.cc
index 0a2bf66620f4a173dd6e34269db614cf85e1d02e..d8a51ef4fe1e193415b3933a6c1e947b62303998 100644
--- a/base/trace_event/process_memory_dump.cc
+++ b/base/trace_event/process_memory_dump.cc
@@ -253,6 +253,13 @@ void ProcessMemoryDump::DumpHeapUsage(
base::trace_event::TraceEventMemoryOverhead& overhead,
const char* allocator_name) {
if (!metrics_by_context.empty()) {
+ // We shouldn't end up here unless we're doing a detailed dump with
+ // heap profiling enabled and if that is the case tracing should be
+ // enabled which sets up the heap profiler serialization state.
+ if (!heap_profiler_serialization_state()) {
+ NOTREACHED();
+ return;
+ }
DCHECK_EQ(0ul, heap_dumps_.count(allocator_name));
std::unique_ptr<TracedValue> heap_dump = ExportHeapDump(
metrics_by_context, *heap_profiler_serialization_state());
« no previous file with comments | « base/trace_event/memory_dump_manager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698