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

Unified Diff: base/android/java/src/org/chromium/base/MemoryPressureListener.java

Issue 22911017: [Android] Make TRIM_MEMORY_COMPLETE check >= rather than == (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/java/src/org/chromium/base/MemoryPressureListener.java
diff --git a/base/android/java/src/org/chromium/base/MemoryPressureListener.java b/base/android/java/src/org/chromium/base/MemoryPressureListener.java
index 311b0f6ff49a68102dec6ae273ae3cd929267a81..5d2598a7f2abe8d8b185066625721ceccbdd4a1f 100644
--- a/base/android/java/src/org/chromium/base/MemoryPressureListener.java
+++ b/base/android/java/src/org/chromium/base/MemoryPressureListener.java
@@ -12,7 +12,7 @@ import android.content.res.Configuration;
/**
* This is an internal implementation of the C++ counterpart.
* It registers a ComponentCallbacks2 with the system, and dispatches into
- * native.
+ * native for levels that are considered actionable.
*/
public class MemoryPressureListener {
@CalledByNative
@@ -43,10 +43,12 @@ public class MemoryPressureListener {
}
private static void maybeNotifyMemoryPresure(int level) {
- if (level == ComponentCallbacks2.TRIM_MEMORY_COMPLETE) {
+ if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE) {
nativeOnMemoryPressure(MemoryPressureLevelList.MEMORY_PRESSURE_CRITICAL);
} else if (level >= ComponentCallbacks2.TRIM_MEMORY_BACKGROUND ||
level == ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL) {
+ // Don't notifiy on TRIM_MEMORY_UI_HIDDEN, since this class only
+ // dispatches actionable memory pressure signals to native.
nativeOnMemoryPressure(MemoryPressureLevelList.MEMORY_PRESSURE_MODERATE);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698