Index: content/browser/site_instance_impl.cc |
diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc |
index 3a93f25c9fa5de8db5c3b77772fed47daedd22bd..29b806d10a1d34741415fc753c662dd9d57d1f69 100644 |
--- a/content/browser/site_instance_impl.cc |
+++ b/content/browser/site_instance_impl.cc |
@@ -56,8 +56,7 @@ SiteInstanceImpl::~SiteInstanceImpl() { |
// the BrowsingInstance. Any future visits to a page from this site |
// (within the same BrowsingInstance) can safely create a new SiteInstance. |
if (has_site_) |
- browsing_instance_->UnregisterSiteInstance( |
- static_cast<SiteInstance*>(this)); |
+ browsing_instance_->UnregisterSiteInstance(this); |
} |
int32 SiteInstanceImpl::GetId() { |
@@ -191,7 +190,10 @@ bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) { |
} |
SiteInstance* SiteInstanceImpl::GetRelatedSiteInstance(const GURL& url) { |
- return browsing_instance_->GetSiteInstanceForURL(url); |
+ SiteInstanceImpl* result = browsing_instance_->GetSiteInstanceForURL(url); |
+ if (render_process_host_factory_) |
+ result->set_render_process_host_factory(render_process_host_factory_); |
+ return result; |
} |
bool SiteInstanceImpl::IsRelatedSiteInstance(const SiteInstance* instance) { |
@@ -224,6 +226,11 @@ BrowserContext* SiteInstanceImpl::GetBrowserContext() const { |
return browsing_instance_->browser_context(); |
} |
+void SiteInstanceImpl::set_render_process_host_factory( |
+ const RenderProcessHostFactory* rph_factory) { |
+ render_process_host_factory_ = rph_factory; |
+} |
+ |
/*static*/ |
SiteInstance* SiteInstance::Create(BrowserContext* browser_context) { |
return new SiteInstanceImpl(new BrowsingInstance(browser_context)); |