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

Side by Side Diff: chrome/browser/oom_priority_manager.cc

Issue 9600036: Move Render(View|Widget)Host and associated classes to content namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review comments. Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/oom_priority_manager.h" 5 #include "chrome/browser/oom_priority_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 } 210 }
211 case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED: { 211 case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED: {
212 handle = content::Source<content::RenderProcessHost>(source)-> 212 handle = content::Source<content::RenderProcessHost>(source)->
213 GetHandle(); 213 GetHandle();
214 pid_to_oom_score_.erase(handle); 214 pid_to_oom_score_.erase(handle);
215 break; 215 break;
216 } 216 }
217 case content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED: { 217 case content::NOTIFICATION_RENDER_WIDGET_VISIBILITY_CHANGED: {
218 bool visible = *content::Details<bool>(details).ptr(); 218 bool visible = *content::Details<bool>(details).ptr();
219 if (visible) { 219 if (visible) {
220 focused_tab_pid_ = content::Source<RenderWidgetHost>(source).ptr()-> 220 focused_tab_pid_ =
221 content::Source<content::RenderWidgetHost>(source).ptr()->
221 GetProcess()->GetHandle(); 222 GetProcess()->GetHandle();
222 223
223 // If the currently focused tab already has a lower score, do not 224 // If the currently focused tab already has a lower score, do not
224 // set it. This can happen in case the newly focused tab is script 225 // set it. This can happen in case the newly focused tab is script
225 // connected to the previous tab. 226 // connected to the previous tab.
226 ProcessScoreMap::iterator it; 227 ProcessScoreMap::iterator it;
227 it = pid_to_oom_score_.find(focused_tab_pid_); 228 it = pid_to_oom_score_.find(focused_tab_pid_);
228 if (it == pid_to_oom_score_.end() 229 if (it == pid_to_oom_score_.end()
229 || it->second != chrome::kLowestRendererOomScore) { 230 || it->second != chrome::kLowestRendererOomScore) {
230 // By starting a timer we guarantee that the tab is focused for 231 // By starting a timer we guarantee that the tab is focused for
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 content::ZygoteHost::GetInstance()->AdjustRendererOOMScore( 334 content::ZygoteHost::GetInstance()->AdjustRendererOOMScore(
334 iterator->renderer_handle, score); 335 iterator->renderer_handle, score);
335 pid_to_oom_score_[iterator->renderer_handle] = score; 336 pid_to_oom_score_[iterator->renderer_handle] = score;
336 } 337 }
337 priority += priority_increment; 338 priority += priority_increment;
338 } 339 }
339 } 340 }
340 } 341 }
341 342
342 } // namespace browser 343 } // namespace browser
OLDNEW
« no previous file with comments | « chrome/browser/notifications/notification_object_proxy.cc ('k') | chrome/browser/prerender/prerender_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698