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

Unified Diff: chromeos/chromeos_switches.h

Issue 1045433002: Migrate ChromeOS to base::MemoryPressureMonitor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanup/fixes Created 5 years, 9 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
Index: chromeos/chromeos_switches.h
diff --git a/chromeos/chromeos_switches.h b/chromeos/chromeos_switches.h
index 1c21f0cb13bbe1f1d0b0e45357dcf6ce67707794..86b08c81fc2e585a2f393858511798461ca2f6ba 100644
--- a/chromeos/chromeos_switches.h
+++ b/chromeos/chromeos_switches.h
@@ -5,7 +5,6 @@
#ifndef CHROMEOS_CHROMEOS_SWITCHES_H_
#define CHROMEOS_CHROMEOS_SWITCHES_H_
-#include "base/chromeos/memory_pressure_observer_chromeos.h"
#include "chromeos/chromeos_export.h"
namespace chromeos {
@@ -114,8 +113,27 @@ CHROMEOS_EXPORT extern const char kDisableWebviewSigninFlow[];
CHROMEOS_EXPORT bool WakeOnWifiEnabled();
CHROMEOS_EXPORT bool MemoryPressureHandlingEnabled();
-CHROMEOS_EXPORT base::MemoryPressureObserverChromeOS::MemoryPressureThresholds
-GetMemoryPressureThresholds();
+
+// There are two memory pressure events:
+// MODERATE - which will mainly release caches.
+// CRITICAL - which will discard tabs.
+// The |MemoryPressureThresholds| enum selects the strategy of firing these
+// events: A conservative strategy will keep as much content in memory as
+// possible (causing the system to swap to zram) and an aggressive strategy
+// will release memory earlier to avoid swapping.
+enum MemoryPressureThresholds {
+ // Use the system default.
+ THRESHOLD_DEFAULT = 0,
+ // Try to keep as much content in memory as possible.
+ THRESHOLD_CONSERVATIVE = 1,
+ // Discard caches earlier, allowing to keep more tabs in memory.
+ THRESHOLD_AGGRESSIVE_CACHE_DISCARD = 2,
+ // Discard tabs earlier, allowing the system to get faster.
+ THRESHOLD_AGGRESSIVE_TAB_DISCARD = 3,
+ // Discard caches and tabs earlier to allow the system to be faster.
+ THRESHOLD_AGGRESSIVE = 4
+};
+CHROMEOS_EXPORT MemoryPressureThresholds GetMemoryPressureThresholds();
} // namespace switches
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698