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

Unified Diff: content/browser/renderer_host/render_process_host.cc

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: browser_context Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_process_host.cc
diff --git a/content/browser/renderer_host/render_process_host.cc b/content/browser/renderer_host/render_process_host.cc
index f942e0482da93b7ca62afc23932e51b6f7440f7f..b3284a1ff072e5138b03b19337e5c976663cef28 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 context.
+static bool IsSuitableHost(RenderProcessHost* host,
+ content::BrowserContext* context,
RenderProcessHost::Type type) {
- if (host->profile() != profile)
+ if (host->context() != context)
return false;
RenderProcessHost::Type host_type = RenderProcessHost::TYPE_NORMAL;
@@ -90,14 +92,15 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
max_renderer_count_override = count;
}
-RenderProcessHost::RenderProcessHost(Profile* profile)
+RenderProcessHost::RenderProcessHost(content::BrowserContext* context)
: max_page_id_(-1),
fast_shutdown_started_(false),
deleting_soon_(false),
is_extension_process_(false),
pending_views_(0),
id_(ChildProcessInfo::GenerateChildProcessUniqueId()),
- profile_(profile),
+ context_(context),
+ profile_(static_cast<Profile*>(context)),
sudden_termination_allowed_(true),
ignore_input_events_(false) {
all_hosts.AddWithID(this, id());
@@ -183,7 +186,7 @@ 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.
+ // a renderer process for a context that has no existing renderers.
// This is OK in moderation, since the GetMaxRendererProcessCount()
// is conservative.
@@ -192,8 +195,8 @@ bool RenderProcessHost::ShouldTryToUseExistingProcessHost() {
}
// static
-RenderProcessHost* RenderProcessHost::GetExistingProcessHost(Profile* profile,
- Type type) {
+RenderProcessHost* RenderProcessHost::GetExistingProcessHost(
+ content::BrowserContext* 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 +204,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(), context, type))
suitable_renderers.push_back(iter.GetCurrentValue());
iter.Advance();

Powered by Google App Engine
This is Rietveld 408576698