OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/memory_pressure/filtered_memory_pressure_calculator.h" | 5 #include "components/memory_pressure/filtered_memory_pressure_calculator.h" |
6 | 6 |
| 7 #include <algorithm> |
7 #include "base/time/tick_clock.h" | 8 #include "base/time/tick_clock.h" |
8 | 9 |
9 namespace memory_pressure { | 10 namespace memory_pressure { |
10 | 11 |
11 #if defined(MEMORY_PRESSURE_IS_POLLING) | 12 #if defined(MEMORY_PRESSURE_IS_POLLING) |
12 | 13 |
13 // 100ms (10Hz) allows a relatively fast respsonse time for rapidly increasing | 14 // 100ms (10Hz) allows a relatively fast respsonse time for rapidly increasing |
14 // memory usage, but limits the amount of work done in the calculator. | 15 // memory usage, but limits the amount of work done in the calculator. |
15 const int FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs = 100; | 16 const int FilteredMemoryPressureCalculator::kMinimumTimeBetweenSamplesMs = 100; |
16 | 17 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 cooldown_start_time_ = now; | 90 cooldown_start_time_ = now; |
90 cooldown_high_tide_ = level; | 91 cooldown_high_tide_ = level; |
91 } | 92 } |
92 | 93 |
93 return current_pressure_level_; | 94 return current_pressure_level_; |
94 } | 95 } |
95 | 96 |
96 #endif // defined(MEMORY_PRESSURE_IS_POLLING) | 97 #endif // defined(MEMORY_PRESSURE_IS_POLLING) |
97 | 98 |
98 } // namespace memory_pressure | 99 } // namespace memory_pressure |
OLD | NEW |