| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_MEMORY_PRESSURE_MEMORY_PRESSURE_CALCULATOR_H_ | |
| 6 #define COMPONENTS_MEMORY_PRESSURE_MEMORY_PRESSURE_CALCULATOR_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "components/memory_pressure/memory_pressure_listener.h" | |
| 10 | |
| 11 namespace memory_pressure { | |
| 12 | |
| 13 #if defined(MEMORY_PRESSURE_IS_POLLING) | |
| 14 | |
| 15 // Interface for a utility class that calculates memory pressure. Only used on | |
| 16 // platforms without native memory pressure signals. | |
| 17 class MemoryPressureCalculator { | |
| 18 public: | |
| 19 using MemoryPressureLevel = MemoryPressureListener::MemoryPressureLevel; | |
| 20 | |
| 21 MemoryPressureCalculator() {} | |
| 22 virtual ~MemoryPressureCalculator() {} | |
| 23 virtual MemoryPressureLevel CalculateCurrentPressureLevel() = 0; | |
| 24 | |
| 25 private: | |
| 26 DISALLOW_COPY_AND_ASSIGN(MemoryPressureCalculator); | |
| 27 }; | |
| 28 | |
| 29 #endif // defined(MEMORY_PRESSURE_IS_POLLING) | |
| 30 | |
| 31 } // namespace memory_pressure | |
| 32 | |
| 33 #endif // COMPONENTS_MEMORY_PRESSURE_MEMORY_PRESSURE_CALCULATOR_H_ | |
| OLD | NEW |