| OLD | NEW |
| 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/memory/ptr_util.h" |
| 7 #include "content/browser/browsing_instance.h" | 8 #include "content/browser/browsing_instance.h" |
| 8 #include "content/browser/child_process_security_policy_impl.h" | 9 #include "content/browser/child_process_security_policy_impl.h" |
| 9 #include "content/browser/frame_host/debug_urls.h" | 10 #include "content/browser/frame_host/debug_urls.h" |
| 10 #include "content/browser/frame_host/frame_tree_node.h" | 11 #include "content/browser/frame_host/frame_tree_node.h" |
| 11 #include "content/browser/renderer_host/render_process_host_impl.h" | 12 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 12 #include "content/browser/storage_partition_impl.h" | 13 #include "content/browser/storage_partition_impl.h" |
| 13 #include "content/common/site_isolation_policy.h" | 14 #include "content/common/site_isolation_policy.h" |
| 14 #include "content/public/browser/content_browser_client.h" | 15 #include "content/public/browser/content_browser_client.h" |
| 15 #include "content/public/browser/render_process_host_factory.h" | 16 #include "content/public/browser/render_process_host_factory.h" |
| 16 #include "content/public/browser/web_ui_controller_factory.h" | 17 #include "content/public/browser/web_ui_controller_factory.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } // namespace | 145 } // namespace |
| 145 | 146 |
| 146 RenderProcessHost* SiteInstanceImpl::GetDefaultSubframeProcessHost( | 147 RenderProcessHost* SiteInstanceImpl::GetDefaultSubframeProcessHost( |
| 147 BrowserContext* browser_context, | 148 BrowserContext* browser_context, |
| 148 bool is_for_guests_only) { | 149 bool is_for_guests_only) { |
| 149 DefaultSubframeProcessHostHolder* holder = | 150 DefaultSubframeProcessHostHolder* holder = |
| 150 static_cast<DefaultSubframeProcessHostHolder*>( | 151 static_cast<DefaultSubframeProcessHostHolder*>( |
| 151 browser_context->GetUserData(&kDefaultSubframeProcessHostHolderKey)); | 152 browser_context->GetUserData(&kDefaultSubframeProcessHostHolderKey)); |
| 152 if (!holder) { | 153 if (!holder) { |
| 153 holder = new DefaultSubframeProcessHostHolder(browser_context); | 154 holder = new DefaultSubframeProcessHostHolder(browser_context); |
| 154 browser_context->SetUserData(kDefaultSubframeProcessHostHolderKey, holder); | 155 browser_context->SetUserData(kDefaultSubframeProcessHostHolderKey, |
| 156 base::WrapUnique(holder)); |
| 155 } | 157 } |
| 156 | 158 |
| 157 return holder->GetProcessHost(this, is_for_guests_only); | 159 return holder->GetProcessHost(this, is_for_guests_only); |
| 158 } | 160 } |
| 159 | 161 |
| 160 RenderProcessHost* SiteInstanceImpl::GetProcess() { | 162 RenderProcessHost* SiteInstanceImpl::GetProcess() { |
| 161 // TODO(erikkay) It would be nice to ensure that the renderer type had been | 163 // TODO(erikkay) It would be nice to ensure that the renderer type had been |
| 162 // properly set before we get here. The default tab creation case winds up | 164 // properly set before we get here. The default tab creation case winds up |
| 163 // with no site set at this point, so it will default to TYPE_NORMAL. This | 165 // with no site set at this point, so it will default to TYPE_NORMAL. This |
| 164 // may not be correct, so we'll wind up potentially creating a process that | 166 // may not be correct, so we'll wind up potentially creating a process that |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 browsing_instance_->browser_context(), site_)) | 523 browsing_instance_->browser_context(), site_)) |
| 522 return; | 524 return; |
| 523 | 525 |
| 524 ChildProcessSecurityPolicyImpl* policy = | 526 ChildProcessSecurityPolicyImpl* policy = |
| 525 ChildProcessSecurityPolicyImpl::GetInstance(); | 527 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 526 policy->LockToOrigin(process_->GetID(), site_); | 528 policy->LockToOrigin(process_->GetID(), site_); |
| 527 } | 529 } |
| 528 } | 530 } |
| 529 | 531 |
| 530 } // namespace content | 532 } // namespace content |
| OLD | NEW |