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

Side by Side Diff: content/browser/site_instance_impl.cc

Issue 16490003: Pass the SiteInstance into CreateRenderProcessHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove ContentBrowserClient, which is global, from argument list 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/site_instance_impl.h" 5 #include "content/browser/site_instance_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/browsing_instance.h" 8 #include "content/browser/browsing_instance.h"
9 #include "content/browser/child_process_security_policy_impl.h" 9 #include "content/browser/child_process_security_policy_impl.h"
10 #include "content/browser/renderer_host/render_process_host_impl.h" 10 #include "content/browser/renderer_host/render_process_host_impl.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (!process_ && RenderProcessHostImpl::ShouldTryToUseExistingProcessHost( 107 if (!process_ && RenderProcessHostImpl::ShouldTryToUseExistingProcessHost(
108 browser_context, site_)) { 108 browser_context, site_)) {
109 process_ = RenderProcessHostImpl::GetExistingProcessHost(browser_context, 109 process_ = RenderProcessHostImpl::GetExistingProcessHost(browser_context,
110 site_); 110 site_);
111 } 111 }
112 112
113 // Otherwise (or if that fails), create a new one. 113 // Otherwise (or if that fails), create a new one.
114 if (!process_) { 114 if (!process_) {
115 if (g_render_process_host_factory_) { 115 if (g_render_process_host_factory_) {
116 process_ = g_render_process_host_factory_->CreateRenderProcessHost( 116 process_ = g_render_process_host_factory_->CreateRenderProcessHost(
117 browser_context); 117 browser_context, this);
118 } else { 118 } else {
119 StoragePartitionImpl* partition = 119 StoragePartitionImpl* partition =
120 static_cast<StoragePartitionImpl*>( 120 static_cast<StoragePartitionImpl*>(
121 BrowserContext::GetStoragePartition(browser_context, this)); 121 BrowserContext::GetStoragePartition(browser_context, this));
122 bool supports_browser_plugin = GetContentClient()->browser()-> 122 bool supports_browser_plugin = GetContentClient()->browser()->
123 SupportsBrowserPlugin(browser_context, site_); 123 SupportsBrowserPlugin(browser_context, site_);
124 process_ = 124 process_ =
125 new RenderProcessHostImpl(browser_context, partition, 125 new RenderProcessHostImpl(browser_context, partition,
126 supports_browser_plugin, 126 supports_browser_plugin,
127 site_.SchemeIs(chrome::kGuestScheme)); 127 site_.SchemeIs(chrome::kGuestScheme));
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 341 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
342 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || 342 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) ||
343 command_line.HasSwitch(switches::kSitePerProcess)) { 343 command_line.HasSwitch(switches::kSitePerProcess)) {
344 ChildProcessSecurityPolicyImpl* policy = 344 ChildProcessSecurityPolicyImpl* policy =
345 ChildProcessSecurityPolicyImpl::GetInstance(); 345 ChildProcessSecurityPolicyImpl::GetInstance();
346 policy->LockToOrigin(process_->GetID(), site_); 346 policy->LockToOrigin(process_->GetID(), site_);
347 } 347 }
348 } 348 }
349 349
350 } // namespace content 350 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/text_input_client_mac_unittest.mm ('k') | content/public/browser/render_process_host_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698