OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_MEMORY_PRESSURE_OBSERVER_CHROMEOS_H_ | 5 #ifndef BASE_CHROMEOS_MEMORY_PRESSURE_OBSERVER_CHROMEOS_H_ |
6 #define BASE_CHROMEOS_MEMORY_PRESSURE_OBSERVER_CHROMEOS_H_ | 6 #define BASE_CHROMEOS_MEMORY_PRESSURE_OBSERVER_CHROMEOS_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/macros.h" | 10 #include "base/macros.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 base::RepeatingTimer<MemoryPressureObserverChromeOS> timer_; | 88 base::RepeatingTimer<MemoryPressureObserverChromeOS> timer_; |
89 | 89 |
90 // To slow down the amount of moderate pressure event calls, this counter | 90 // To slow down the amount of moderate pressure event calls, this counter |
91 // gets used to count the number of events since the last event occured. | 91 // gets used to count the number of events since the last event occured. |
92 int moderate_pressure_repeat_count_; | 92 int moderate_pressure_repeat_count_; |
93 | 93 |
94 // The thresholds for moderate and critical pressure. | 94 // The thresholds for moderate and critical pressure. |
95 const int moderate_pressure_threshold_percent_; | 95 const int moderate_pressure_threshold_percent_; |
96 const int critical_pressure_threshold_percent_; | 96 const int critical_pressure_threshold_percent_; |
97 | 97 |
| 98 // Wall-clock time when the system entered non-critical or critical memory |
| 99 // pressure state. |
| 100 base::TimeTicks non_critical_start_time_; |
| 101 base::TimeTicks critical_start_time_; |
| 102 |
98 base::WeakPtrFactory<MemoryPressureObserverChromeOS> weak_ptr_factory_; | 103 base::WeakPtrFactory<MemoryPressureObserverChromeOS> weak_ptr_factory_; |
99 | 104 |
100 DISALLOW_COPY_AND_ASSIGN(MemoryPressureObserverChromeOS); | 105 DISALLOW_COPY_AND_ASSIGN(MemoryPressureObserverChromeOS); |
101 }; | 106 }; |
102 | 107 |
103 } // namespace base | 108 } // namespace base |
104 | 109 |
105 #endif // BASE_CHROMEOS_MEMORY_PRESSURE_OBSERVER_CHROMEOS_H_ | 110 #endif // BASE_CHROMEOS_MEMORY_PRESSURE_OBSERVER_CHROMEOS_H_ |
OLD | NEW |