| Index: base/trace_event/memory_dump_manager.h
|
| diff --git a/base/trace_event/memory_dump_manager.h b/base/trace_event/memory_dump_manager.h
|
| index ebee048691628d5c29201eadd9efe17fe5032349..73efcc37528c86f9847d7b7763de58c7da46c495 100644
|
| --- a/base/trace_event/memory_dump_manager.h
|
| +++ b/base/trace_event/memory_dump_manager.h
|
| @@ -126,6 +126,10 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
|
| // Enable heap profiling if kEnableHeapProfiling is specified.
|
| void EnableHeapProfilingIfNeeded();
|
|
|
| + // Enable heap profiling with specified |capture_mode|. Disabling heap
|
| + // profiler will disable it permanently and cannot be enabled again.
|
| + void EnableHeapProfiling(AllocationContextTracker::CaptureMode capture_mode);
|
| +
|
| // Returns true if the dump mode is allowed for current tracing session.
|
| bool IsDumpModeAllowed(MemoryDumpLevelOfDetail dump_mode);
|
|
|
| @@ -346,6 +350,10 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
|
| void UnregisterPollingMDPOnDumpThread(
|
| scoped_refptr<MemoryDumpProviderInfo> mdpinfo);
|
|
|
| + // Helper to enable heap profiling.
|
| + void EnableHeapProfilingLocked(
|
| + AllocationContextTracker::CaptureMode capture_mode);
|
| +
|
| // An ordererd set of registered MemoryDumpProviderInfo(s), sorted by task
|
| // runner affinity (MDPs belonging to the same task runners are adjacent).
|
| MemoryDumpProviderInfo::OrderedSet dump_providers_;
|
| @@ -383,8 +391,11 @@ class BASE_EXPORT MemoryDumpManager : public TraceLog::EnabledStateObserver {
|
| // When true, calling |RegisterMemoryDumpProvider| is a no-op.
|
| bool dumper_registrations_ignored_for_testing_;
|
|
|
| - // Whether new memory dump providers should be told to enable heap profiling.
|
| - bool heap_profiling_enabled_;
|
| + // Heap profiling can be enabled and disabled only once in the process.
|
| + // New memory dump providers should be told to enable heap profiling if state
|
| + // is ENABLED.
|
| + enum class HeapProfilingState { DISABLED, ENABLED, DISABLED_PERMANENTLY };
|
| + HeapProfilingState heap_profiling_state_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(MemoryDumpManager);
|
| };
|
|
|