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

Unified Diff: chromeos/chromeos_switches.cc

Issue 897413002: Add a finch experiment for different memory pressure management strategies in ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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.cc
diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc
index 6ac7d2e345844d6598483c3b419c99e3294e5d26..d297ec54877936d759f0f54bc74acea949026656 100644
--- a/chromeos/chromeos_switches.cc
+++ b/chromeos/chromeos_switches.cc
@@ -224,6 +224,12 @@ const char kLoginUser[] = "login-user";
// The memory pressure thresholds selection which is used to decide when a
// memory pressure event needs to get fired.
const char kMemoryPressureThresholds[] = "memory-pressure-thresholds";
+const char kConservativeThreshold[] = "conservative-threshold";
+const char kAggressiveCacheDiscardThreshold[] =
+ "aggressive-cache-discard-threshold";
+const char kAggressiveTabDiscardThreshold[] =
+ "aggressive-tab-discard-threshold";
+const char kAggressiveThreshold[] = "aggressive-threshold";
// Enables natural scroll by default.
const char kNaturalScrollDefault[] = "enable-natural-scroll-default";
@@ -311,28 +317,5 @@ bool WakeOnWifiEnabled() {
return !base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableWakeOnWifi);
}
-base::MemoryPressureObserverChromeOS::MemoryPressureThresholds
-GetMemoryPressureThresholds() {
- if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
- kMemoryPressureThresholds)) {
- return base::MemoryPressureObserverChromeOS::THRESHOLD_DEFAULT;
- }
- const std::string option =
- base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- kMemoryPressureThresholds);
- if (option == "1") {
- return base::MemoryPressureObserverChromeOS::THRESHOLD_CONSERVATIVE;
- }
- if (option == "2") {
- return base::MemoryPressureObserverChromeOS::
- THRESHOLD_AGGRESSIVE_CACHE_DISCARD;
- }
- if (option == "3") {
- return base::MemoryPressureObserverChromeOS::
- THRESHOLD_AGGRESSIVE_TAB_DISCARD;
- }
- return base::MemoryPressureObserverChromeOS::THRESHOLD_AGGRESSIVE;
-}
-
} // namespace switches
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698