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() { ...@@ -172,10 +172,8 @@ HeapProfilingMode MemoryDumpManager::GetHeapProfilingModeFromCommandLine() {
return kHeapProfilingModePseudo; return kHeapProfilingModePseudo;
if (profiling_mode == switches::kEnableHeapProfilingModeNative) if (profiling_mode == switches::kEnableHeapProfilingModeNative)
return kHeapProfilingModeNative; return kHeapProfilingModeNative;
if (profiling_mode == switches::kEnableHeapProfilingTaskProfiler && if (profiling_mode == switches::kEnableHeapProfilingTaskProfiler)
base::debug::ThreadHeapUsageTracker::IsHeapTrackingEnabled()) {
return kHeapProfilingModeTaskProfiler; return kHeapProfilingModeTaskProfiler;
}
#endif // BUILDFLAG(USE_ALLOCATOR_SHIM) && !defined(OS_NACL) #endif // BUILDFLAG(USE_ALLOCATOR_SHIM) && !defined(OS_NACL)
return kHeapProfilingModeInvalid; return kHeapProfilingModeInvalid;
} }
...@@ -200,7 +198,8 @@ void MemoryDumpManager::EnableHeapProfilingIfNeeded() { ...@@ -200,7 +198,8 @@ void MemoryDumpManager::EnableHeapProfilingIfNeeded() {
AllocationContextTracker::CaptureMode::NATIVE_STACK); AllocationContextTracker::CaptureMode::NATIVE_STACK);
break; break;
case kHeapProfilingModeTaskProfiler: case kHeapProfilingModeTaskProfiler:
base::debug::ThreadHeapUsageTracker::EnableHeapTracking(); if (!base::debug::ThreadHeapUsageTracker::IsHeapTrackingEnabled())
base::debug::ThreadHeapUsageTracker::EnableHeapTracking();
break; 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