Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(221)

Side by Side Diff: base/android/memory_pressure_listener_android.cc

Issue 15995014: Adds MemoryPressureListener. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/android/memory_pressure_listener_android.h ('k') | base/base.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « base/android/memory_pressure_listener_android.h ('k') | base/base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698