| Index: base/trace_event/memory_dump_scheduler.h
|
| diff --git a/base/trace_event/memory_dump_scheduler.h b/base/trace_event/memory_dump_scheduler.h
|
| index ab8441bc20031242e5ac5df07f37eac12f66dc23..18721011f099ca42fd82ecf50d73f8e98f1306f2 100644
|
| --- a/base/trace_event/memory_dump_scheduler.h
|
| +++ b/base/trace_event/memory_dump_scheduler.h
|
| @@ -78,6 +78,8 @@ class BASE_EXPORT MemoryDumpScheduler {
|
| uint32_t light_dump_period_ms;
|
| uint32_t heavy_dump_period_ms;
|
|
|
| + bool is_enabled_for_testing;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(PeriodicTriggerState);
|
| };
|
|
|
| @@ -117,8 +119,11 @@ class BASE_EXPORT MemoryDumpScheduler {
|
| MemoryDumpScheduler();
|
| ~MemoryDumpScheduler();
|
|
|
| + // Helper to enable timer on polling thread.
|
| + void EnablePeriodicTimerOnPollingThread();
|
| +
|
| // Helper to set polling disabled.
|
| - void DisablePollingOnPollingThread();
|
| + void DisableTriggersOnPollingThread();
|
|
|
| // Periodically called by the timer.
|
| void RequestPeriodicGlobalDump();
|
| @@ -138,14 +143,14 @@ class BASE_EXPORT MemoryDumpScheduler {
|
| // True if periodic dumping is enabled.
|
| bool IsPeriodicTimerRunningForTesting();
|
|
|
| + // Timer.Start is not called if disabled, for tests without message loop.
|
| + void DisablePeriodicTimerForTesting(bool disable);
|
| +
|
| MemoryDumpManager* mdm_;
|
|
|
| // Accessed on the thread of the client before enabling and only accessed on
|
| - // the thread that called "EnablePeriodicTriggersIfNeeded()" after enabling.
|
| + // the polling thread after enabling:
|
| std::unique_ptr<PeriodicTriggerState> periodic_state_;
|
| -
|
| - // Accessed on the thread of the client before enabling and only accessed on
|
| - // the polling thread after enabling.
|
| std::unique_ptr<PollingTriggerState> polling_state_;
|
|
|
| // Accessed on the thread of the client only.
|
| @@ -154,6 +159,9 @@ class BASE_EXPORT MemoryDumpScheduler {
|
| // True when the scheduler is setup. Accessed on the thread of client only.
|
| bool is_setup_;
|
|
|
| + // Disables the Timer.Start for periodic triggers.
|
| + static bool periodic_timer_disabled_for_testing_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(MemoryDumpScheduler);
|
| };
|
|
|
|
|