| Index: content/browser/memory/memory_monitor_android.cc
|
| diff --git a/content/browser/memory/memory_monitor_android.cc b/content/browser/memory/memory_monitor_android.cc
|
| index a86d6cd7c9b0240502c86f1080e3efa6c588b417..d351c9a9e85dd10875649f572ef8950f335a0509 100644
|
| --- a/content/browser/memory/memory_monitor_android.cc
|
| +++ b/content/browser/memory/memory_monitor_android.cc
|
| @@ -65,7 +65,6 @@ static void GetMemoryInfoCallback(
|
|
|
| // The maximum level of onTrimMemory (TRIM_MEMORY_COMPLETE).
|
| const int kTrimMemoryLevelMax = 80;
|
| -const int kTrimMemoryRunningLow = 10;
|
| const int kTrimMemoryRunningCritical = 15;
|
|
|
| // Called by JNI.
|
| @@ -74,14 +73,14 @@ static void OnTrimMemory(JNIEnv* env,
|
| jint level) {
|
| DCHECK(level >= 0 && level <= kTrimMemoryLevelMax);
|
| auto* coordinator = MemoryCoordinatorImpl::GetInstance();
|
| -
|
| - if (level >= kTrimMemoryRunningCritical) {
|
| - coordinator->ForceSetMemoryCondition(MemoryCondition::CRITICAL,
|
| - base::TimeDelta::FromMinutes(1));
|
| - } else if (level >= kTrimMemoryRunningLow) {
|
| - coordinator->ForceSetMemoryCondition(MemoryCondition::WARNING,
|
| - base::TimeDelta::FromMinutes(1));
|
| - }
|
| + DCHECK(coordinator);
|
| +
|
| + MemoryCondition condition = MemoryCondition::WARNING;
|
| + if (level >= kTrimMemoryRunningCritical ||
|
| + coordinator->GetMemoryCondition() == MemoryCondition::CRITICAL)
|
| + condition = MemoryCondition::CRITICAL;
|
| + coordinator->ForceSetMemoryCondition(condition,
|
| + base::TimeDelta::FromMinutes(1));
|
| }
|
|
|
| // static
|
|
|