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/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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 // Ensure the process is registered for this site if necessary. | 174 // Ensure the process is registered for this site if necessary. |
175 if (RenderProcessHostImpl::ShouldUseProcessPerSite(browser_context, | 175 if (RenderProcessHostImpl::ShouldUseProcessPerSite(browser_context, |
176 site_)) { | 176 site_)) { |
177 RenderProcessHostImpl::RegisterProcessHostForSite( | 177 RenderProcessHostImpl::RegisterProcessHostForSite( |
178 browser_context, process_, site_); | 178 browser_context, process_, site_); |
179 } | 179 } |
180 } | 180 } |
181 } | 181 } |
182 | 182 |
183 const GURL& SiteInstanceImpl::GetSite() const { | 183 const GURL& SiteInstanceImpl::GetSiteURL() const { |
184 return site_; | 184 return site_; |
185 } | 185 } |
186 | 186 |
187 bool SiteInstanceImpl::HasSite() const { | 187 bool SiteInstanceImpl::HasSite() const { |
188 return has_site_; | 188 return has_site_; |
189 } | 189 } |
190 | 190 |
191 bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) { | 191 bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) { |
192 return browsing_instance_->HasSiteInstance(url); | 192 return browsing_instance_->HasSiteInstance(url); |
193 } | 193 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 } | 323 } |
324 | 324 |
325 void SiteInstanceImpl::LockToOrigin() { | 325 void SiteInstanceImpl::LockToOrigin() { |
326 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 326 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
327 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation)) { | 327 if (command_line.HasSwitch(switches::kEnableStrictSiteIsolation)) { |
328 ChildProcessSecurityPolicyImpl* policy = | 328 ChildProcessSecurityPolicyImpl* policy = |
329 ChildProcessSecurityPolicyImpl::GetInstance(); | 329 ChildProcessSecurityPolicyImpl::GetInstance(); |
330 policy->LockToOrigin(process_->GetID(), site_); | 330 policy->LockToOrigin(process_->GetID(), site_); |
331 } | 331 } |
332 } | 332 } |
OLD | NEW |