Chromium Code Reviews| Index: chrome/browser/chromeos/memory/oom_priority_manager.h |
| diff --git a/chrome/browser/chromeos/memory/oom_priority_manager.h b/chrome/browser/chromeos/memory/oom_priority_manager.h |
| index 92ef696fe9763591bfd8ed65d45e4247e9f93bf9..63a504422bdc9d8be4cd6e336ecfba5c0c32fa62 100644 |
| --- a/chrome/browser/chromeos/memory/oom_priority_manager.h |
| +++ b/chrome/browser/chromeos/memory/oom_priority_manager.h |
| @@ -11,6 +11,7 @@ |
| #include "base/compiler_specific.h" |
| #include "base/containers/hash_tables.h" |
| #include "base/gtest_prod_util.h" |
| +#include "base/memory/memory_pressure_listener.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/process/process.h" |
| #include "base/strings/string16.h" |
| @@ -138,6 +139,10 @@ class OomPriorityManager : public content::NotificationObserver { |
| const content::NotificationSource& source, |
| const content::NotificationDetails& details) override; |
| + // Called by the memory pressure listener when the memory pressure rises. |
| + void OnMemoryPressure( |
| + base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
| + |
| base::RepeatingTimer<OomPriorityManager> timer_; |
| base::OneShotTimer<OomPriorityManager> focus_tab_score_adjust_timer_; |
| base::RepeatingTimer<OomPriorityManager> recent_tab_discard_timer_; |
| @@ -151,10 +156,17 @@ class OomPriorityManager : public content::NotificationObserver { |
| // Holds the focused tab's child process host id. |
| ProcessInfo focused_tab_process_info_; |
| - // Observer for the kernel low memory signal. NULL if tab discarding is |
| - // disabled. |
| + // The old observer for the kernel low memory signal. This is NULL if |
|
James Cook
2014/12/19 19:38:08
nit: NULL -> null in comments
Mr4D (OOO till 08-26)
2014/12/19 23:34:41
Done.
|
| + // the new MemoryPressureListener is used. |
| + // TODO(skuhne): Remove this when the enhanced memory observer is turned on |
| + // by default. |
| scoped_ptr<LowMemoryObserver> low_memory_observer_; |
| + // A listener to global memory pressure events. This will be used if the |
| + // memory pressure system was instantiated - otherwise the LowMemoryObserver |
| + // will be used. |
| + scoped_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
| + |
| // Wall-clock time when the priority manager started running. |
| base::TimeTicks start_time_; |