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

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

Issue 12518033: Browser Plugin: Only install BrowserPluginMessageFilter if render process supports BrowserPlugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments Created 7 years, 9 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 // Otherwise (or if that fails), create a new one. 112 // Otherwise (or if that fails), create a new one.
113 if (!process_) { 113 if (!process_) {
114 if (render_process_host_factory_) { 114 if (render_process_host_factory_) {
115 process_ = render_process_host_factory_->CreateRenderProcessHost( 115 process_ = render_process_host_factory_->CreateRenderProcessHost(
116 browser_context); 116 browser_context);
117 } else { 117 } else {
118 StoragePartitionImpl* partition = 118 StoragePartitionImpl* partition =
119 static_cast<StoragePartitionImpl*>( 119 static_cast<StoragePartitionImpl*>(
120 BrowserContext::GetStoragePartition(browser_context, this)); 120 BrowserContext::GetStoragePartition(browser_context, this));
121 bool supports_browser_plugin = GetContentClient()->browser()->
122 SupportsBrowserPlugin(browser_context, site_);
121 process_ = 123 process_ =
122 new RenderProcessHostImpl(browser_context, partition, 124 new RenderProcessHostImpl(browser_context, partition,
125 supports_browser_plugin,
123 site_.SchemeIs(chrome::kGuestScheme)); 126 site_.SchemeIs(chrome::kGuestScheme));
124 } 127 }
125 } 128 }
126 CHECK(process_); 129 CHECK(process_);
127 130
128 // If we are using process-per-site, we need to register this process 131 // If we are using process-per-site, we need to register this process
129 // for the current site so that we can find it again. (If no site is set 132 // for the current site so that we can find it again. (If no site is set
130 // at this time, we will register it in SetSite().) 133 // at this time, we will register it in SetSite().)
131 if (use_process_per_site) { 134 if (use_process_per_site) {
132 RenderProcessHostImpl::RegisterProcessHostForSite(browser_context, 135 RenderProcessHostImpl::RegisterProcessHostForSite(browser_context,
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 330 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
328 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) || 331 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation) ||
329 command_line.HasSwitch(switches::kSitePerProcess)) { 332 command_line.HasSwitch(switches::kSitePerProcess)) {
330 ChildProcessSecurityPolicyImpl* policy = 333 ChildProcessSecurityPolicyImpl* policy =
331 ChildProcessSecurityPolicyImpl::GetInstance(); 334 ChildProcessSecurityPolicyImpl::GetInstance();
332 policy->LockToOrigin(process_->GetID(), site_); 335 policy->LockToOrigin(process_->GetID(), site_);
333 } 336 }
334 } 337 }
335 338
336 } // namespace content 339 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698