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

Side by Side 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, 8 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 #ifndef CHROMEOS_CHROMEOS_SWITCHES_H_ 5 #ifndef CHROMEOS_CHROMEOS_SWITCHES_H_
6 #define CHROMEOS_CHROMEOS_SWITCHES_H_ 6 #define CHROMEOS_CHROMEOS_SWITCHES_H_
7 7
8 #include "base/chromeos/memory_pressure_observer_chromeos.h"
9 #include "chromeos/chromeos_export.h" 8 #include "chromeos/chromeos_export.h"
10 9
11 namespace chromeos { 10 namespace chromeos {
12 namespace switches { 11 namespace switches {
13 12
14 // Switches that are used in src/chromeos must go here. 13 // Switches that are used in src/chromeos must go here.
15 // Other switches that apply just to chromeos code should go here also (along 14 // Other switches that apply just to chromeos code should go here also (along
16 // with any code that is specific to the chromeos system). ChromeOS specific UI 15 // with any code that is specific to the chromeos system). ChromeOS specific UI
17 // should be in src/ash. 16 // should be in src/ash.
18 17
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 CHROMEOS_EXPORT extern const char kTestMetronomeTimer[]; 106 CHROMEOS_EXPORT extern const char kTestMetronomeTimer[];
108 CHROMEOS_EXPORT extern const char kWakeOnPackets[]; 107 CHROMEOS_EXPORT extern const char kWakeOnPackets[];
109 CHROMEOS_EXPORT extern const char kEnableCaptivePortalBypassProxyOption[]; 108 CHROMEOS_EXPORT extern const char kEnableCaptivePortalBypassProxyOption[];
110 CHROMEOS_EXPORT extern const char kDisableTimeZoneTrackingOption[]; 109 CHROMEOS_EXPORT extern const char kDisableTimeZoneTrackingOption[];
111 CHROMEOS_EXPORT extern const char kEnableOAuthTokenHandlers[]; 110 CHROMEOS_EXPORT extern const char kEnableOAuthTokenHandlers[];
112 CHROMEOS_EXPORT extern const char kDisableWebviewSigninFlow[]; 111 CHROMEOS_EXPORT extern const char kDisableWebviewSigninFlow[];
113 112
114 CHROMEOS_EXPORT bool WakeOnWifiEnabled(); 113 CHROMEOS_EXPORT bool WakeOnWifiEnabled();
115 114
116 CHROMEOS_EXPORT bool MemoryPressureHandlingEnabled(); 115 CHROMEOS_EXPORT bool MemoryPressureHandlingEnabled();
117 CHROMEOS_EXPORT base::MemoryPressureObserverChromeOS::MemoryPressureThresholds 116
118 GetMemoryPressureThresholds(); 117 // There are two memory pressure events:
118 // MODERATE - which will mainly release caches.
119 // CRITICAL - which will discard tabs.
120 // The |MemoryPressureThresholds| enum selects the strategy of firing these
121 // events: A conservative strategy will keep as much content in memory as
122 // possible (causing the system to swap to zram) and an aggressive strategy
123 // will release memory earlier to avoid swapping.
124 enum MemoryPressureThresholds {
125 // Use the system default.
126 THRESHOLD_DEFAULT = 0,
127 // Try to keep as much content in memory as possible.
128 THRESHOLD_CONSERVATIVE = 1,
129 // Discard caches earlier, allowing to keep more tabs in memory.
130 THRESHOLD_AGGRESSIVE_CACHE_DISCARD = 2,
131 // Discard tabs earlier, allowing the system to get faster.
132 THRESHOLD_AGGRESSIVE_TAB_DISCARD = 3,
133 // Discard caches and tabs earlier to allow the system to be faster.
134 THRESHOLD_AGGRESSIVE = 4
135 };
136 CHROMEOS_EXPORT MemoryPressureThresholds GetMemoryPressureThresholds();
119 137
120 } // namespace switches 138 } // namespace switches
121 } // namespace chromeos 139 } // namespace chromeos
122 140
123 #endif // CHROMEOS_CHROMEOS_SWITCHES_H_ 141 #endif // CHROMEOS_CHROMEOS_SWITCHES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698