| 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 "base/memory/ptr_util.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/frame_host/debug_urls.h" | 10 #include "content/browser/frame_host/debug_urls.h" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } | 268 } |
| 269 | 269 |
| 270 bool SiteInstanceImpl::HasSite() const { | 270 bool SiteInstanceImpl::HasSite() const { |
| 271 return has_site_; | 271 return has_site_; |
| 272 } | 272 } |
| 273 | 273 |
| 274 bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) { | 274 bool SiteInstanceImpl::HasRelatedSiteInstance(const GURL& url) { |
| 275 return browsing_instance_->HasSiteInstance(url); | 275 return browsing_instance_->HasSiteInstance(url); |
| 276 } | 276 } |
| 277 | 277 |
| 278 int SiteInstanceImpl::GetBrowsingInstanceId() const { |
| 279 return browsing_instance_->browsing_instance_id(); |
| 280 } |
| 281 |
| 278 scoped_refptr<SiteInstance> SiteInstanceImpl::GetRelatedSiteInstance( | 282 scoped_refptr<SiteInstance> SiteInstanceImpl::GetRelatedSiteInstance( |
| 279 const GURL& url) { | 283 const GURL& url) { |
| 280 return browsing_instance_->GetSiteInstanceForURL(url); | 284 return browsing_instance_->GetSiteInstanceForURL(url); |
| 281 } | 285 } |
| 282 | 286 |
| 283 bool SiteInstanceImpl::IsRelatedSiteInstance(const SiteInstance* instance) { | 287 bool SiteInstanceImpl::IsRelatedSiteInstance(const SiteInstance* instance) { |
| 284 return browsing_instance_.get() == static_cast<const SiteInstanceImpl*>( | 288 return browsing_instance_.get() == static_cast<const SiteInstanceImpl*>( |
| 285 instance)->browsing_instance_.get(); | 289 instance)->browsing_instance_.get(); |
| 286 } | 290 } |
| 287 | 291 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 browsing_instance_->browser_context(), site_)) | 527 browsing_instance_->browser_context(), site_)) |
| 524 return; | 528 return; |
| 525 | 529 |
| 526 ChildProcessSecurityPolicyImpl* policy = | 530 ChildProcessSecurityPolicyImpl* policy = |
| 527 ChildProcessSecurityPolicyImpl::GetInstance(); | 531 ChildProcessSecurityPolicyImpl::GetInstance(); |
| 528 policy->LockToOrigin(process_->GetID(), site_); | 532 policy->LockToOrigin(process_->GetID(), site_); |
| 529 } | 533 } |
| 530 } | 534 } |
| 531 | 535 |
| 532 } // namespace content | 536 } // namespace content |
| OLD | NEW |