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

Unified Diff: chrome/browser/oom_priority_manager.h

Issue 7930022: chromeos: Set a least score to the currently focused tab so that it is not selected (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/oom_priority_manager.cc » ('j') | chrome/browser/oom_priority_manager.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | chrome/browser/oom_priority_manager.cc » ('j') | chrome/browser/oom_priority_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698