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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/chromeos_switches.h" 5 #include "chromeos/chromeos_switches.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 8
9 // TODO(rsorokin): alphabetize all of these switches so they 9 // TODO(rsorokin): alphabetize all of these switches so they
10 // match the order from the .h file 10 // match the order from the .h file
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // In case of browser restart within active session this parameter is used 217 // In case of browser restart within active session this parameter is used
218 // to pass user_id hash for primary user. 218 // to pass user_id hash for primary user.
219 const char kLoginProfile[] = "login-profile"; 219 const char kLoginProfile[] = "login-profile";
220 220
221 // Specifies the user which is already logged in. 221 // Specifies the user which is already logged in.
222 const char kLoginUser[] = "login-user"; 222 const char kLoginUser[] = "login-user";
223 223
224 // The memory pressure thresholds selection which is used to decide when a 224 // The memory pressure thresholds selection which is used to decide when a
225 // memory pressure event needs to get fired. 225 // memory pressure event needs to get fired.
226 const char kMemoryPressureThresholds[] = "memory-pressure-thresholds"; 226 const char kMemoryPressureThresholds[] = "memory-pressure-thresholds";
227 const char kConservativeThreshold[] = "conservative-threshold";
228 const char kAggressiveCacheDiscardThreshold[] =
229 "aggressive-cache-discard-threshold";
230 const char kAggressiveTabDiscardThreshold[] =
231 "aggressive-tab-discard-threshold";
232 const char kAggressiveThreshold[] = "aggressive-threshold";
227 233
228 // Enables natural scroll by default. 234 // Enables natural scroll by default.
229 const char kNaturalScrollDefault[] = "enable-natural-scroll-default"; 235 const char kNaturalScrollDefault[] = "enable-natural-scroll-default";
230 236
231 // Skips all other OOBE pages after user login. 237 // Skips all other OOBE pages after user login.
232 const char kOobeSkipPostLogin[] = "oobe-skip-postlogin"; 238 const char kOobeSkipPostLogin[] = "oobe-skip-postlogin";
233 239
234 // Disable GAIA services such as enrollment and OAuth session restore. Used by 240 // Disable GAIA services such as enrollment and OAuth session restore. Used by
235 // 'fake' telemetry login. 241 // 'fake' telemetry login.
236 const char kDisableGaiaServices[] = "disable-gaia-services"; 242 const char kDisableGaiaServices[] = "disable-gaia-services";
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 const char kEnableCaptivePortalBypassProxy[] = 310 const char kEnableCaptivePortalBypassProxy[] =
305 "enable-captive-portal-bypass-proxy"; 311 "enable-captive-portal-bypass-proxy";
306 312
307 // Enable automatic timezone update. 313 // Enable automatic timezone update.
308 const char kEnableTimeZoneTrackingOption[] = "enable-timezone-tracking-option"; 314 const char kEnableTimeZoneTrackingOption[] = "enable-timezone-tracking-option";
309 315
310 bool WakeOnWifiEnabled() { 316 bool WakeOnWifiEnabled() {
311 return !base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableWakeOnWifi); 317 return !base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableWakeOnWifi);
312 } 318 }
313 319
314 base::MemoryPressureObserverChromeOS::MemoryPressureThresholds
315 GetMemoryPressureThresholds() {
316 if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
317 kMemoryPressureThresholds)) {
318 return base::MemoryPressureObserverChromeOS::THRESHOLD_DEFAULT;
319 }
320 const std::string option =
321 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
322 kMemoryPressureThresholds);
323 if (option == "1") {
324 return base::MemoryPressureObserverChromeOS::THRESHOLD_CONSERVATIVE;
325 }
326 if (option == "2") {
327 return base::MemoryPressureObserverChromeOS::
328 THRESHOLD_AGGRESSIVE_CACHE_DISCARD;
329 }
330 if (option == "3") {
331 return base::MemoryPressureObserverChromeOS::
332 THRESHOLD_AGGRESSIVE_TAB_DISCARD;
333 }
334 return base::MemoryPressureObserverChromeOS::THRESHOLD_AGGRESSIVE;
335 }
336
337 } // namespace switches 320 } // namespace switches
338 } // namespace chromeos 321 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698