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

Side by Side Diff: chrome/browser/renderer_host/render_process_host.cc

Issue 6513010: WebUI: Get rid of more references to DOMUI in the rest of the directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 10 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/renderer_host/render_process_host.h" 5 #include "chrome/browser/renderer_host/render_process_host.h"
6 6
7 #include "base/rand_util.h" 7 #include "base/rand_util.h"
8 #include "base/sys_info.h" 8 #include "base/sys_info.h"
9 #include "chrome/browser/child_process_security_policy.h" 9 #include "chrome/browser/child_process_security_policy.h"
10 #include "chrome/common/child_process_info.h" 10 #include "chrome/common/child_process_info.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 // Returns true if the given host is suitable for launching a new view 60 // Returns true if the given host is suitable for launching a new view
61 // associated with the given profile. 61 // associated with the given profile.
62 static bool IsSuitableHost(RenderProcessHost* host, Profile* profile, 62 static bool IsSuitableHost(RenderProcessHost* host, Profile* profile,
63 RenderProcessHost::Type type) { 63 RenderProcessHost::Type type) {
64 if (host->profile() != profile) 64 if (host->profile() != profile)
65 return false; 65 return false;
66 66
67 RenderProcessHost::Type host_type = RenderProcessHost::TYPE_NORMAL; 67 RenderProcessHost::Type host_type = RenderProcessHost::TYPE_NORMAL;
68 if (ChildProcessSecurityPolicy::GetInstance()->HasWebUIBindings(host->id())) 68 if (ChildProcessSecurityPolicy::GetInstance()->HasWebUIBindings(host->id()))
69 host_type = RenderProcessHost::TYPE_DOMUI; 69 host_type = RenderProcessHost::TYPE_WEBUI;
70 if (ChildProcessSecurityPolicy::GetInstance()-> 70 if (ChildProcessSecurityPolicy::GetInstance()->
71 HasExtensionBindings(host->id())) 71 HasExtensionBindings(host->id()))
72 host_type = RenderProcessHost::TYPE_EXTENSION; 72 host_type = RenderProcessHost::TYPE_EXTENSION;
73 73
74 return host_type == type; 74 return host_type == type;
75 } 75 }
76 76
77 // the global list of all renderer processes 77 // the global list of all renderer processes
78 IDMap<RenderProcessHost> all_hosts; 78 IDMap<RenderProcessHost> all_hosts;
79 79
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 // Now pick a random suitable renderer, if we have any. 196 // Now pick a random suitable renderer, if we have any.
197 if (!suitable_renderers.empty()) { 197 if (!suitable_renderers.empty()) {
198 int suitable_count = static_cast<int>(suitable_renderers.size()); 198 int suitable_count = static_cast<int>(suitable_renderers.size());
199 int random_index = base::RandInt(0, suitable_count - 1); 199 int random_index = base::RandInt(0, suitable_count - 1);
200 return suitable_renderers[random_index]; 200 return suitable_renderers[random_index];
201 } 201 }
202 202
203 return NULL; 203 return NULL;
204 } 204 }
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_process_host.h ('k') | chrome/browser/renderer_host/render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698