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 #ifndef BASE_MEMORY_MEMORY_PRESSURE_MONITOR_MAC_H_ | 5 #ifndef BASE_MEMORY_MEMORY_PRESSURE_MONITOR_MAC_H_ |
6 #define BASE_MEMORY_MEMORY_PRESSURE_MONITOR_MAC_H_ | 6 #define BASE_MEMORY_MEMORY_PRESSURE_MONITOR_MAC_H_ |
7 | 7 |
8 #include <dispatch/dispatch.h> | 8 #include <dispatch/dispatch.h> |
9 | 9 |
10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 // Returns the currently-observed memory pressure. | 45 // Returns the currently-observed memory pressure. |
46 MemoryPressureLevel GetCurrentPressureLevel() const override; | 46 MemoryPressureLevel GetCurrentPressureLevel() const override; |
47 | 47 |
48 private: | 48 private: |
49 friend TestMemoryPressureMonitor; | 49 friend TestMemoryPressureMonitor; |
50 | 50 |
51 static MemoryPressureLevel | 51 static MemoryPressureLevel |
52 MemoryPressureLevelForMacMemoryPressure(int mac_memory_pressure); | 52 MemoryPressureLevelForMacMemoryPressure(int mac_memory_pressure); |
53 static void NotifyMemoryPressureChanged(dispatch_source_s* event_source); | 53 static void NotifyMemoryPressureChanged(dispatch_source_s* event_source); |
54 | 54 |
55 scoped_ptr<dispatch_source_s, DispatchSourceSDeleter> | 55 std::unique_ptr<dispatch_source_s, DispatchSourceSDeleter> |
56 memory_level_event_source_; | 56 memory_level_event_source_; |
57 | 57 |
58 DISALLOW_COPY_AND_ASSIGN(MemoryPressureMonitor); | 58 DISALLOW_COPY_AND_ASSIGN(MemoryPressureMonitor); |
59 }; | 59 }; |
60 | 60 |
61 } // namespace mac | 61 } // namespace mac |
62 } // namespace base | 62 } // namespace base |
63 | 63 |
64 #endif // BASE_MEMORY_MEMORY_PRESSURE_MONITOR_MAC_H_ | 64 #endif // BASE_MEMORY_MEMORY_PRESSURE_MONITOR_MAC_H_ |
OLD | NEW |