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

Unified Diff: base/chromeos/memory_pressure_observer_chromeos.h

Issue 803443006: Adding flag to specify the used memory pressure strategy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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: base/chromeos/memory_pressure_observer_chromeos.h
diff --git a/base/chromeos/memory_pressure_observer_chromeos.h b/base/chromeos/memory_pressure_observer_chromeos.h
index 23b6b3450d8cf2f9ef7f907be1aab144b69ff58f..d543036305ba4ce8bad247ab94792861a8f58863 100644
--- a/base/chromeos/memory_pressure_observer_chromeos.h
+++ b/base/chromeos/memory_pressure_observer_chromeos.h
@@ -27,7 +27,15 @@ class BASE_EXPORT MemoryPressureObserverChromeOS {
public:
using GetUsedMemoryInPercentCallback = int (*)();
- MemoryPressureObserverChromeOS();
+ enum MemoryPressureThresholds {
+ DEFAULT_THRESHOLDS = 0, // Use the default.
Charlie Reis 2015/01/21 17:42:05 These names and comments are confusing to me. Nor
Mr4D (OOO till 08-26) 2015/01/21 18:52:14 Done.
+ NORMAL_THRESHOLDS = 1, // Use both thresholds as normal.
+ AGGRESSIVE_MODERATE_THRESHOLD = 2, // Use an aggressive moderate threshold.
+ AGGRESSIVE_CRITICAL_THRESHOLD = 3, // Use an aggressive critical threshold.
+ AGGRESSIVE_THRESHOLDS = 4 // Both thresholds are aggressive.
+ };
+
+ explicit MemoryPressureObserverChromeOS(MemoryPressureThresholds thresholds);
virtual ~MemoryPressureObserverChromeOS();
// Redo the memory pressure calculation soon and call again if a critical
@@ -71,6 +79,10 @@ class BASE_EXPORT MemoryPressureObserverChromeOS {
// gets used to count the number of events since the last event occured.
int moderate_pressure_repeat_count_;
+ // The thresholds for moderate and critical pressure.
+ const int moderate_pressure_threshold_;
+ const int critical_pressure_threshold_;
+
base::WeakPtrFactory<MemoryPressureObserverChromeOS> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(MemoryPressureObserverChromeOS);
« no previous file with comments | « no previous file | base/chromeos/memory_pressure_observer_chromeos.cc » ('j') | base/chromeos/memory_pressure_observer_chromeos.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698