OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // MemoryPressure provides static APIs for handling memory pressure on | 5 // MemoryPressure provides static APIs for handling memory pressure on |
6 // platforms that have such signals, such as Android and ChromeOS. | 6 // platforms that have such signals, such as Android and ChromeOS. |
7 // The app will try to discard buffers that aren't deemed essential (individual | 7 // The app will try to discard buffers that aren't deemed essential (individual |
8 // modules will implement their own policy). | 8 // modules will implement their own policy). |
9 | 9 |
10 #ifndef BASE_MEMORY_PRESSURE_LISTENER_H_ | 10 #ifndef BASE_MEMORY_MEMORY_PRESSURE_LISTENER_H_ |
11 #define BASE_MEMORY_PRESSURE_LISTENER_H_ | 11 #define BASE_MEMORY_MEMORY_PRESSURE_LISTENER_H_ |
12 | 12 |
13 #include "base/base_export.h" | 13 #include "base/base_export.h" |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/callback.h" | 15 #include "base/callback.h" |
16 | 16 |
17 namespace base { | 17 namespace base { |
18 | 18 |
19 // To start listening, create a new instance, passing a callback to a | 19 // To start listening, create a new instance, passing a callback to a |
20 // function that takes a MemoryPressureLevel parameter. To stop listening, | 20 // function that takes a MemoryPressureLevel parameter. To stop listening, |
21 // simply delete the listener object. The implementation guarantees | 21 // simply delete the listener object. The implementation guarantees |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 private: | 75 private: |
76 void Notify(MemoryPressureLevel memory_pressure_level); | 76 void Notify(MemoryPressureLevel memory_pressure_level); |
77 | 77 |
78 MemoryPressureCallback callback_; | 78 MemoryPressureCallback callback_; |
79 | 79 |
80 DISALLOW_COPY_AND_ASSIGN(MemoryPressureListener); | 80 DISALLOW_COPY_AND_ASSIGN(MemoryPressureListener); |
81 }; | 81 }; |
82 | 82 |
83 } // namespace base | 83 } // namespace base |
84 | 84 |
85 #endif // BASE_MEMORY_PRESSURE_LISTENER_H_ | 85 #endif // BASE_MEMORY_MEMORY_PRESSURE_LISTENER_H_ |
OLD | NEW |