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

Unified Diff: content/browser/site_instance_impl.cc

Issue 15799009: Store the RenderProcessHostFactory in a global variable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
« no previous file with comments | « content/browser/site_instance_impl.h ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « content/browser/site_instance_impl.h ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698