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

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)
@@ -68,6 +68,10 @@
// 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 AdjustTabScore(base::ProcessHandle pid);
+
static bool CompareRendererStats(RendererStats first, RendererStats second);
virtual void Observe(int type,
@@ -78,10 +82,12 @@
// renderer_stats_ is used on both UI and file threads.
base::Lock renderer_stats_lock_;
StatsList renderer_stats_;
+ // This lock is for pid_to_oom_score_ and last_set_score_.
James Cook 2011/09/19 17:08:55 Thanks for a separate comment!
+ base::Lock pid_to_oom_score_lock_;
// map maintaining the process - oom_score map.
- base::Lock pid_to_oom_score_lock_;
ProcessScoreMap pid_to_oom_score_;
NotificationRegistrar registrar_;
+ int last_used_score_;
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