summaryrefslogtreecommitdiffstats
path: root/content/browser/renderer_host/render_process_host.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/browser/renderer_host/render_process_host.cc')
-rw-r--r--content/browser/renderer_host/render_process_host.cc24
1 files changed, 13 insertions, 11 deletions
diff --git a/content/browser/renderer_host/render_process_host.cc b/content/browser/renderer_host/render_process_host.cc
index f942e04..93eac4d 100644
--- a/content/browser/renderer_host/render_process_host.cc
+++ b/content/browser/renderer_host/render_process_host.cc
@@ -6,6 +6,7 @@
#include "base/rand_util.h"
#include "base/sys_info.h"
+#include "chrome/browser/profiles/profile.h"
#include "content/browser/browser_thread.h"
#include "content/browser/child_process_security_policy.h"
#include "content/common/child_process_info.h"
@@ -59,10 +60,11 @@ size_t GetMaxRendererProcessCount() {
}
// Returns true if the given host is suitable for launching a new view
-// associated with the given profile.
-static bool IsSuitableHost(RenderProcessHost* host, Profile* profile,
+// associated with the given browser context.
+static bool IsSuitableHost(RenderProcessHost* host,
+ content::BrowserContext* browser_context,
RenderProcessHost::Type type) {
- if (host->profile() != profile)
+ if (host->browser_context() != browser_context)
return false;
RenderProcessHost::Type host_type = RenderProcessHost::TYPE_NORMAL;
@@ -90,14 +92,14 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
max_renderer_count_override = count;
}
-RenderProcessHost::RenderProcessHost(Profile* profile)
+RenderProcessHost::RenderProcessHost(content::BrowserContext* browser_context)
: max_page_id_(-1),
fast_shutdown_started_(false),
deleting_soon_(false),
is_extension_process_(false),
pending_views_(0),
id_(ChildProcessInfo::GenerateChildProcessUniqueId()),
- profile_(profile),
+ browser_context_(browser_context),
sudden_termination_allowed_(true),
ignore_input_events_(false) {
all_hosts.AddWithID(this, id());
@@ -183,17 +185,17 @@ bool RenderProcessHost::ShouldTryToUseExistingProcessHost() {
// NOTE: Sometimes it's necessary to create more render processes than
// GetMaxRendererProcessCount(), for instance when we want to create
- // a renderer process for a profile that has no existing renderers.
- // This is OK in moderation, since the GetMaxRendererProcessCount()
- // is conservative.
+ // a renderer process for a browser context that has no existing
+ // renderers. This is OK in moderation, since the
+ // GetMaxRendererProcessCount() is conservative.
return run_renderer_in_process() ||
(renderer_process_count >= GetMaxRendererProcessCount());
}
// static
-RenderProcessHost* RenderProcessHost::GetExistingProcessHost(Profile* profile,
- Type type) {
+RenderProcessHost* RenderProcessHost::GetExistingProcessHost(
+ content::BrowserContext* browser_context, Type type) {
// First figure out which existing renderers we can use.
std::vector<RenderProcessHost*> suitable_renderers;
suitable_renderers.reserve(all_hosts.size());
@@ -201,7 +203,7 @@ RenderProcessHost* RenderProcessHost::GetExistingProcessHost(Profile* profile,
iterator iter(AllHostsIterator());
while (!iter.IsAtEnd()) {
if (run_renderer_in_process() ||
- IsSuitableHost(iter.GetCurrentValue(), profile, type))
+ IsSuitableHost(iter.GetCurrentValue(), browser_context, type))
suitable_renderers.push_back(iter.GetCurrentValue());
iter.Advance();