| 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_MEMORY_MEMORY_PRESSURE_MONITOR_CHROMEOS_H_ | 5 #ifndef BASE_MEMORY_MEMORY_PRESSURE_MONITOR_CHROMEOS_H_ |
| 6 #define BASE_MEMORY_MEMORY_PRESSURE_MONITOR_CHROMEOS_H_ | 6 #define BASE_MEMORY_MEMORY_PRESSURE_MONITOR_CHROMEOS_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/files/scoped_file.h" | 9 #include "base/files/scoped_file.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 explicit MemoryPressureMonitor(MemoryPressureThresholds thresholds); | 52 explicit MemoryPressureMonitor(MemoryPressureThresholds thresholds); |
| 53 ~MemoryPressureMonitor() override; | 53 ~MemoryPressureMonitor() override; |
| 54 | 54 |
| 55 // Redo the memory pressure calculation soon and call again if a critical | 55 // Redo the memory pressure calculation soon and call again if a critical |
| 56 // memory pressure prevails. Note that this call will trigger an asynchronous | 56 // memory pressure prevails. Note that this call will trigger an asynchronous |
| 57 // action which gives the system time to release memory back into the pool. | 57 // action which gives the system time to release memory back into the pool. |
| 58 void ScheduleEarlyCheck(); | 58 void ScheduleEarlyCheck(); |
| 59 | 59 |
| 60 // Get the current memory pressure level. | 60 // Get the current memory pressure level. |
| 61 MemoryPressureListener::MemoryPressureLevel GetCurrentPressureLevel() const | 61 MemoryPressureListener::MemoryPressureLevel GetCurrentPressureLevel() |
| 62 override; | 62 override; |
| 63 void SetDispatchCallback(const DispatchCallback& callback) override; | 63 void SetDispatchCallback(const DispatchCallback& callback) override; |
| 64 | 64 |
| 65 // Returns a type-casted version of the current memory pressure monitor. A | 65 // Returns a type-casted version of the current memory pressure monitor. A |
| 66 // simple wrapper to base::MemoryPressureMonitor::Get. | 66 // simple wrapper to base::MemoryPressureMonitor::Get. |
| 67 static MemoryPressureMonitor* Get(); | 67 static MemoryPressureMonitor* Get(); |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 friend TestMemoryPressureMonitor; | 70 friend TestMemoryPressureMonitor; |
| 71 // Starts observing the memory fill level. | 71 // Starts observing the memory fill level. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 base::WeakPtrFactory<MemoryPressureMonitor> weak_ptr_factory_; | 120 base::WeakPtrFactory<MemoryPressureMonitor> weak_ptr_factory_; |
| 121 | 121 |
| 122 DISALLOW_COPY_AND_ASSIGN(MemoryPressureMonitor); | 122 DISALLOW_COPY_AND_ASSIGN(MemoryPressureMonitor); |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace chromeos | 125 } // namespace chromeos |
| 126 } // namespace base | 126 } // namespace base |
| 127 | 127 |
| 128 #endif // BASE_MEMORY_MEMORY_PRESSURE_MONITOR_CHROMEOS_H_ | 128 #endif // BASE_MEMORY_MEMORY_PRESSURE_MONITOR_CHROMEOS_H_ |
| OLD | NEW |