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 fcf4d9288207da0c5b6e26b12b439c347413028e..0c19c8e47c70353705cceb044137753cc3424a1e 100644 |
--- a/chrome/browser/chromeos/memory/oom_priority_manager.h |
+++ b/chrome/browser/chromeos/memory/oom_priority_manager.h |
@@ -79,6 +79,7 @@ class OomPriorityManager : public content::NotificationObserver { |
bool is_discarded; |
base::TimeTicks last_active; |
base::ProcessHandle renderer_handle; |
+ int child_process_host_id; |
base::string16 title; |
int64 tab_contents_id; // unique ID per WebContents |
}; |
@@ -111,10 +112,11 @@ class OomPriorityManager : public content::NotificationObserver { |
// Called when the timer fires, sets oom_adjust_score for all renderers. |
void AdjustOomPriorities(); |
- // Returns a list of unique process handles from |stats_list|. If multiple |
- // tabs use the same process, returns the first process handle. This implies |
- // that the processes are selected based on their "most important" tab. |
- static std::vector<base::ProcessHandle> GetProcessHandles( |
+ // Returns a list of child process host ids from |stats_list| with unique |
+ // pids. If multiple tabs use the same process, returns the first child |
+ // process host id. This implies that the processes are selected based on |
+ // their "most important" tab. |
+ static std::vector<int> GetChildProcessHostIds( |
const TabStatsList& stats_list); |
// Called by AdjustOomPriorities. |
@@ -137,12 +139,13 @@ class OomPriorityManager : public content::NotificationObserver { |
base::RepeatingTimer<OomPriorityManager> recent_tab_discard_timer_; |
content::NotificationRegistrar registrar_; |
- // 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. |
- typedef base::hash_map<base::ProcessHandle, int> ProcessScoreMap; |
- ProcessScoreMap pid_to_oom_score_; |
- base::ProcessHandle focused_tab_pid_; |
+ // This lock is for |oom_score_map_| and |focused_tab_process_host_id_|. |
+ base::Lock oom_score_lock_; |
+ // Map maintaining the child process host id - oom_score mapping. |
+ typedef base::hash_map<int, int> ProcessScoreMap; |
+ ProcessScoreMap oom_score_map_; |
+ // Holds the focussed tab's child process host id. |
James Cook
2014/11/22 00:38:46
nit: focussed -> focused
sramajay
2014/11/24 12:00:07
Done.
|
+ int focused_tab_process_host_id_; |
// Observer for the kernel low memory signal. NULL if tab discarding is |
// disabled. |