Chromium Code Reviews| Index: chrome/browser/oom_priority_manager.h |
| =================================================================== |
| --- chrome/browser/oom_priority_manager.h (revision 101722) |
| +++ chrome/browser/oom_priority_manager.h (working copy) |
| @@ -65,9 +65,16 @@ |
| // the timer fires. |
| void AdjustOomPriorities(); |
| + // Posts AdjustFocusedTabScore task to the file thread. |
| + void FocusTabScoreAdjustmentTimeout(); |
|
James Cook
2011/09/20 17:08:03
nit: Maybe call this PostAdjustFocusedTabScore() o
amruthraj
2011/09/21 04:25:01
Done.
|
| + |
| // Called by AdjustOomPriorities. Runs on the file thread. |
| void DoAdjustOomPriorities(); |
| + // Called when a tab comes into focus. Runs on the file thread. |
| + // Sets the score of only the currently focused tab to the least value. |
| + void AdjustFocusedTabScore(); |
| + |
| static bool CompareRendererStats(RendererStats first, RendererStats second); |
| virtual void Observe(int type, |
| @@ -75,13 +82,16 @@ |
| const NotificationDetails& details); |
| base::RepeatingTimer<OomPriorityManager> timer_; |
| + base::OneShotTimer<OomPriorityManager> focus_tab_score_adjust_timer_; |
| // renderer_stats_ is used on both UI and file threads. |
| base::Lock renderer_stats_lock_; |
| StatsList renderer_stats_; |
| - // map maintaining the process - oom_score map. |
| + // This lock is for pid_to_oom_score_ and focus_tab_pid_. |
| base::Lock pid_to_oom_score_lock_; |
| + // map maintaining the process - oom_score mapping. |
| ProcessScoreMap pid_to_oom_score_; |
| NotificationRegistrar registrar_; |
| + base::ProcessHandle focused_tab_pid_; |
| DISALLOW_COPY_AND_ASSIGN(OomPriorityManager); |
| }; |