Commit 9b8f6e49 authored by Wez's avatar Wez Committed by Commit Bot

Fix handling of heap-profiling=task-profiler mode.

The patch which added the butter-bar for unimplemented modes
broke the task-profiler case for the heap-profiling flag.

Bug: 705461
Change-Id: Ib293ce8aa8d4c2f763c7b9ba414923381f2d9870
Reviewed-on: https://chromium-review.googlesource.com/540983Reviewed-by: default avatarSigurður Ásgeirsson <siggi@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#481023}
parent ae028b46
......@@ -172,10 +172,8 @@ HeapProfilingMode MemoryDumpManager::GetHeapProfilingModeFromCommandLine() {
return kHeapProfilingModePseudo;
if (profiling_mode == switches::kEnableHeapProfilingModeNative)
return kHeapProfilingModeNative;
if (profiling_mode == switches::kEnableHeapProfilingTaskProfiler &&
base::debug::ThreadHeapUsageTracker::IsHeapTrackingEnabled()) {
if (profiling_mode == switches::kEnableHeapProfilingTaskProfiler)
return kHeapProfilingModeTaskProfiler;
}
#endif // BUILDFLAG(USE_ALLOCATOR_SHIM) && !defined(OS_NACL)
return kHeapProfilingModeInvalid;
}
......@@ -200,7 +198,8 @@ void MemoryDumpManager::EnableHeapProfilingIfNeeded() {
AllocationContextTracker::CaptureMode::NATIVE_STACK);
break;
case kHeapProfilingModeTaskProfiler:
base::debug::ThreadHeapUsageTracker::EnableHeapTracking();
if (!base::debug::ThreadHeapUsageTracker::IsHeapTrackingEnabled())
base::debug::ThreadHeapUsageTracker::EnableHeapTracking();
break;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment