Index: content/browser/site_instance_impl.cc |
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc |
index 56ee6df39d3493db582f3083348ec2754df04774..889d9d22b3fae0dd73520212f2a019e64ced97cb 100644 |
--- a/content/browser/site_instance_impl.cc |
+++ b/content/browser/site_instance_impl.cc |
@@ -35,12 +35,13 @@ static bool IsURLSameAsAnySiteInstance(const GURL& url) { |
url == GURL(kChromeUIShorthangURL); |
} |
+const RenderProcessHostFactory* |
+ SiteInstanceImpl::g_render_process_host_factory_ = NULL; |
int32 SiteInstanceImpl::next_site_instance_id_ = 1; |
SiteInstanceImpl::SiteInstanceImpl(BrowsingInstance* browsing_instance) |
: id_(next_site_instance_id_++), |
browsing_instance_(browsing_instance), |
- render_process_host_factory_(NULL), |
process_(NULL), |
has_site_(false) { |
DCHECK(browsing_instance); |
@@ -111,8 +112,8 @@ RenderProcessHost* SiteInstanceImpl::GetProcess() { |
// Otherwise (or if that fails), create a new one. |
if (!process_) { |
- if (render_process_host_factory_) { |
- process_ = render_process_host_factory_->CreateRenderProcessHost( |
+ if (g_render_process_host_factory_) { |
+ process_ = g_render_process_host_factory_->CreateRenderProcessHost( |
browser_context); |
} else { |
StoragePartitionImpl* partition = |
@@ -220,6 +221,11 @@ bool SiteInstanceImpl::HasWrongProcessForURL(const GURL& url) { |
GetProcess(), browsing_instance_->browser_context(), site_url); |
} |
+void SiteInstanceImpl::set_render_process_host_factory( |
+ const RenderProcessHostFactory* rph_factory) { |
+ g_render_process_host_factory_ = rph_factory; |
+} |
+ |
BrowserContext* SiteInstanceImpl::GetBrowserContext() const { |
return browsing_instance_->browser_context(); |
} |