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 445119efb73853c1f712dab8c85ad190ddb86f6b..7ecaef85688cb97d3b1402928cd0b2ed0a672066 100644 |
--- a/base/chromeos/memory_pressure_observer_chromeos.h |
+++ b/base/chromeos/memory_pressure_observer_chromeos.h |
@@ -24,6 +24,11 @@ class BASE_EXPORT MemoryPressureObserverChromeOS { |
MemoryPressureObserverChromeOS(); |
~MemoryPressureObserverChromeOS(); |
+ // Redo the memory pressure calculation soon and call again if a critical |
+ // memory pressure prevails. Note that this call will trigger an asynchronous |
+ // action which gives the system time to release memory back into the pool. |
+ void ScheduleEarlyCheck(); |
+ |
// Get the current memory pressure level. |
base::MemoryPressureListener::MemoryPressureLevel GetCurrentPressureLevel() { |
return current_memory_pressure_level_; |
@@ -39,8 +44,9 @@ class BASE_EXPORT MemoryPressureObserverChromeOS { |
// May be safely called if StartObserving has not been called. |
void StopObserving(); |
- // The function which gets periodically be called to check any changes in the |
- // memory pressure. |
+ // The function which gets periodically called to check any changes in the |
+ // memory pressure. It will report pressure changes as well as continuous |
+ // critical pressure levels. |
void CheckMemoryPressure(); |
// The current memory pressure. |
@@ -51,6 +57,10 @@ class BASE_EXPORT MemoryPressureObserverChromeOS { |
// replaced by a kernel triggered event system (see crbug.com/381196). |
base::RepeatingTimer<MemoryPressureObserverChromeOS> timer_; |
+ // To slow down the amount of moderate pressure event calls, this counter |
+ // gets used to count the number of events since the last event occured. |
+ int moderate_pressure_repeat_counter_; |
James Cook
2014/12/19 19:38:07
nit: maybe "moderate_pressure_repeat_count_"?
Mr4D (OOO till 08-26)
2014/12/19 23:34:41
Done.
|
+ |
DISALLOW_COPY_AND_ASSIGN(MemoryPressureObserverChromeOS); |
}; |