OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 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 |
| 5 #include "base/android/memory_pressure_listener_android.h" |
| 6 |
| 7 #include "base/memory/memory_pressure_listener.h" |
| 8 #include "jni/MemoryPressureListener_jni.h" |
| 9 |
| 10 // Defined and called by JNI. |
| 11 static void OnMemoryPressure( |
| 12 JNIEnv* env, jclass clazz, jint memory_pressure_level) { |
| 13 base::MemoryPressureListener::NotifyMemoryPressure( |
| 14 static_cast<base::MemoryPressureListener::MemoryPressureLevel>( |
| 15 memory_pressure_level)); |
| 16 } |
| 17 |
| 18 namespace base { |
| 19 namespace android { |
| 20 |
| 21 bool MemoryPressureListenerAndroid::Register(JNIEnv* env) { |
| 22 return RegisterNativesImpl(env); |
| 23 } |
| 24 |
| 25 void MemoryPressureListenerAndroid::RegisterSystemCallback(JNIEnv* env) { |
| 26 Java_MemoryPressureListener_registerSystemCallback( |
| 27 env, GetApplicationContext()); |
| 28 } |
| 29 |
| 30 } // namespace android |
| 31 } // namespace base |
OLD | NEW |