memory_pressure_listener_android.h 890 B

1234567891011121314151617181920212223242526272829
  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
  3. // found in the LICENSE file.
  4. #ifndef BASE_ANDROID_MEMORY_PRESSURE_LISTENER_ANDROID_H_
  5. #define BASE_ANDROID_MEMORY_PRESSURE_LISTENER_ANDROID_H_
  6. #include "base/android/jni_android.h"
  7. namespace base {
  8. namespace android {
  9. // Implements the C++ counter part of MemoryPressureListener.java
  10. class BASE_EXPORT MemoryPressureListenerAndroid {
  11. public:
  12. static void Initialize(JNIEnv* env);
  13. MemoryPressureListenerAndroid(const MemoryPressureListenerAndroid&) = delete;
  14. MemoryPressureListenerAndroid& operator=(
  15. const MemoryPressureListenerAndroid&) = delete;
  16. // Called by JNI.
  17. static void OnMemoryPressure(int memory_pressure_type);
  18. };
  19. } // namespace android
  20. } // namespace base
  21. #endif // BASE_ANDROID_MEMORY_PRESSURE_LISTENER_ANDROID_H_