| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_TRACE_EVENT_MEMORY_DUMP_SCHEDULER_H | 5 #ifndef BASE_TRACE_EVENT_MEMORY_DUMP_SCHEDULER_H |
| 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_SCHEDULER_H | 6 #define BASE_TRACE_EVENT_MEMORY_DUMP_SCHEDULER_H |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Resets time for triggering dump to account for minimum time between the | 44 // Resets time for triggering dump to account for minimum time between the |
| 45 // dumps. | 45 // dumps. |
| 46 void NotifyDumpTriggered(); | 46 void NotifyDumpTriggered(); |
| 47 | 47 |
| 48 // Disables all triggers. | 48 // Disables all triggers. |
| 49 void DisableAllTriggers(); | 49 void DisableAllTriggers(); |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 friend class MemoryDumpManagerTest; | 52 friend class MemoryDumpManagerTest; |
| 53 friend class MemoryDumpSchedulerPollingTest; |
| 53 FRIEND_TEST_ALL_PREFIXES(MemoryDumpManagerTest, TestPollingOnDumpThread); | 54 FRIEND_TEST_ALL_PREFIXES(MemoryDumpManagerTest, TestPollingOnDumpThread); |
| 54 | 55 |
| 55 // Helper class to schdule periodic memory dumps. | 56 // Helper class to schdule periodic memory dumps. |
| 56 struct PeriodicTriggerState { | 57 struct PeriodicTriggerState { |
| 57 PeriodicTriggerState(); | 58 PeriodicTriggerState(); |
| 58 ~PeriodicTriggerState(); | 59 ~PeriodicTriggerState(); |
| 59 | 60 |
| 60 bool is_configured; | 61 bool is_configured; |
| 61 | 62 |
| 62 RepeatingTimer timer; | 63 RepeatingTimer timer; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 PeriodicTriggerState periodic_state_; | 133 PeriodicTriggerState periodic_state_; |
| 133 PollingTriggerState polling_state_; | 134 PollingTriggerState polling_state_; |
| 134 | 135 |
| 135 DISALLOW_COPY_AND_ASSIGN(MemoryDumpScheduler); | 136 DISALLOW_COPY_AND_ASSIGN(MemoryDumpScheduler); |
| 136 }; | 137 }; |
| 137 | 138 |
| 138 } // namespace trace_event | 139 } // namespace trace_event |
| 139 } // namespace base | 140 } // namespace base |
| 140 | 141 |
| 141 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_SCHEDULER_H | 142 #endif // BASE_TRACE_EVENT_MEMORY_DUMP_SCHEDULER_H |
| OLD | NEW |