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); |