| 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 // The time that the system stays in non-critical memory pressure state in a |
| 99 // session (in Millisecond). |
| 100 unsigned int time_non_critical_pressure_; |
| 101 // The time that the system stays in critical memory pressure state in a |
| 102 // session (in Millisecond). |
| 103 unsigned int time_critical_pressure_; |
| 104 |
| 98 base::WeakPtrFactory<MemoryPressureObserverChromeOS> weak_ptr_factory_; | 105 base::WeakPtrFactory<MemoryPressureObserverChromeOS> weak_ptr_factory_; |
| 99 | 106 |
| 100 DISALLOW_COPY_AND_ASSIGN(MemoryPressureObserverChromeOS); | 107 DISALLOW_COPY_AND_ASSIGN(MemoryPressureObserverChromeOS); |
| 101 }; | 108 }; |
| 102 | 109 |
| 103 } // namespace base | 110 } // namespace base |
| 104 | 111 |
| 105 #endif // BASE_CHROMEOS_MEMORY_PRESSURE_OBSERVER_CHROMEOS_H_ | 112 #endif // BASE_CHROMEOS_MEMORY_PRESSURE_OBSERVER_CHROMEOS_H_ |
| OLD | NEW |