Chromium Code Reviews| Index: base/trace_event/memory_dump_manager.cc |
| diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc |
| index 246a5aadcafddcd92ca15c4e96e871fc5763905c..24db511b50280259bc64b1cce287fe407119a8cd 100644 |
| --- a/base/trace_event/memory_dump_manager.cc |
| +++ b/base/trace_event/memory_dump_manager.cc |
| @@ -14,6 +14,7 @@ |
| #include "base/compiler_specific.h" |
| #include "base/debug/debugging_flags.h" |
| #include "base/debug/stack_trace.h" |
| +#include "base/debug/thread_heap_usage_tracker.h" |
| #include "base/memory/ptr_util.h" |
| #include "base/threading/thread.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| @@ -199,6 +200,17 @@ void MemoryDumpManager::EnableHeapProfilingIfNeeded() { |
| << switches::kEnableHeapProfiling << " flag is not supported " |
| << "for this platform / build type."; |
| #endif |
| + } else if (profiling_mode == switches::kEnableHeapProfilingTaskProfiler) { |
| +#if BUILDFLAG(ENABLE_MEMORY_TASK_PROFILER) |
|
Primiano Tucci (use gerrit)
2017/02/15 14:18:03
I'd probably put the #if around the "else if", so
Sigurður Ásgeirsson
2017/02/15 15:35:45
Done.
|
| + // Enable heap tracking, which in turn enables capture of heap usage |
| + // tracking in tracked_objects.cc. |
| + if (!base::debug::ThreadHeapUsageTracker::IsHeapTrackingEnabled()) |
| + base::debug::ThreadHeapUsageTracker::EnableHeapTracking(); |
| +#else |
| + CHECK(false) << "'" << profiling_mode << "' mode for " |
| + << switches::kEnableHeapProfiling << " flag is not supported " |
| + << "for this platform / build type."; |
| +#endif |
| } else { |
| CHECK(false) << "Invalid mode '" << profiling_mode << "' for " |
| << switches::kEnableHeapProfiling << " flag."; |