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. | 6 // platforms that have such signals, such as Android. |
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 // Refer to memory_pressure_level_list.h for information about what sorts of | 10 // Refer to memory_pressure_level_list.h for information about what sorts of |
11 // signals can be sent under what conditions. | 11 // signals can be sent under what conditions. |
12 | 12 |
13 #ifndef BASE_MEMORY_PRESSURE_LISTENER_H_ | 13 #ifndef BASE_MEMORY_PRESSURE_LISTENER_H_ |
14 #define BASE_MEMORY_PRESSURE_H_ | 14 #define BASE_MEMORY_PRESSURE_LISTENER_H_ |
15 | 15 |
16 #include "base/base_export.h" | 16 #include "base/base_export.h" |
17 #include "base/basictypes.h" | 17 #include "base/basictypes.h" |
18 #include "base/callback.h" | 18 #include "base/callback.h" |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 | 21 |
22 // To start listening, create a new instance, passing a callback to a | 22 // To start listening, create a new instance, passing a callback to a |
23 // function that takes a MemoryPressureLevel parameter. To stop listening, | 23 // function that takes a MemoryPressureLevel parameter. To stop listening, |
24 // simply delete the listener object. The implementation guarantees | 24 // simply delete the listener object. The implementation guarantees |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 void Notify(MemoryPressureLevel memory_pressure_level); | 71 void Notify(MemoryPressureLevel memory_pressure_level); |
72 | 72 |
73 MemoryPressureCallback callback_; | 73 MemoryPressureCallback callback_; |
74 | 74 |
75 DISALLOW_COPY_AND_ASSIGN(MemoryPressureListener); | 75 DISALLOW_COPY_AND_ASSIGN(MemoryPressureListener); |
76 }; | 76 }; |
77 | 77 |
78 } // namespace base | 78 } // namespace base |
79 | 79 |
80 #endif // BASE_MEMORY_PRESSURE_LISTENER_H_ | 80 #endif // BASE_MEMORY_PRESSURE_LISTENER_H_ |
OLD | NEW |