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

Unified Diff: chrome/browser/chromeos/memory/oom_priority_manager.h

Issue 681733003: Removed the ProcessHandle from the RendererClosedDetails payload (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated child_process_id to child_process_host_id Created 6 years, 1 month 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/chromeos/memory/oom_priority_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | chrome/browser/chromeos/memory/oom_priority_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698