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

Issue 18908002: [Android] Make MemoryPressureListener respond to only background or critical Trim Memory signals. (Closed)

Created:
7 years, 5 months ago by rmcilroy
Modified:
7 years, 4 months ago
Reviewers:
bulach, joth
CC:
chromium-reviews, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

[Android] Make MemoryPressureListener respond to only background or critical Trim Memory signals. BUG= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=210807

Patch Set 1 #

Patch Set 2 : Minor Rebase #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -7 lines) Patch
M base/android/java/src/org/chromium/base/MemoryPressureListener.java View 3 chunks +7 lines, -7 lines 1 comment Download

Messages

Total messages: 6 (0 generated)
rmcilroy
7 years, 5 months ago (2013-07-09 14:10:53 UTC) #1
bulach
lgtm, thanks!
7 years, 5 months ago (2013-07-09 15:08:34 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rmcilroy@chromium.org/18908002/4001
7 years, 5 months ago (2013-07-09 15:50:57 UTC) #3
commit-bot: I haz the power
Change committed as 210807
7 years, 5 months ago (2013-07-10 09:57:10 UTC) #4
joth
https://chromiumcodereview.appspot.com/18908002/diff/4001/base/android/java/src/org/chromium/base/MemoryPressureListener.java File base/android/java/src/org/chromium/base/MemoryPressureListener.java (right): https://chromiumcodereview.appspot.com/18908002/diff/4001/base/android/java/src/org/chromium/base/MemoryPressureListener.java#newcode49 base/android/java/src/org/chromium/base/MemoryPressureListener.java:49: level == ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL) { I just re-read the docs... ...
7 years, 4 months ago (2013-08-18 01:55:21 UTC) #5
rmcilroy
7 years, 4 months ago (2013-08-19 11:31:49 UTC) #6
Message was sent while issue was closed.
On 2013/08/18 01:55:21, joth wrote:
>
https://chromiumcodereview.appspot.com/18908002/diff/4001/base/android/java/s...
> File base/android/java/src/org/chromium/base/MemoryPressureListener.java
> (right):
> 
>
https://chromiumcodereview.appspot.com/18908002/diff/4001/base/android/java/s...
> base/android/java/src/org/chromium/base/MemoryPressureListener.java:49: level
==
> ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL) {
> I just re-read the docs...
>
http://developer.android.com/reference/android/content/ComponentCallbacks2.html
> "You should never compare to exact values of the level, since new intermediate
> values may be added -- you will typically want to compare if the value is
> greater or equal to a level you are interested in."
> 
> 
> so the expression here should, presumably, be
> 
> if (level >= ComponentCallbacks2.TRIM_MEMORY_COMPLETE) {
>   nativeOnMemoryPressure(MemoryPressureLevelList.MEMORY_PRESSURE_CRITICAL);
> } else if (level >= ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL) {
>   nativeOnMemoryPressure(MemoryPressureLevelList.MEMORY_PRESSURE_MODERATE);
> }

Yes, you are right I think.  The docs state that "new intermediate values may be
added" and TRIM_MEMORY_COMPLETE is the highest value, so new intermediate values
wouldn't have affected that check, but making the change won't harm so I've done
it in http://crev.com/22911017

Powered by Google App Engine
This is Rietveld 408576698