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 "content/browser/browsing_instance.h" | 7 #include "content/browser/browsing_instance.h" |
8 #include "content/browser/child_process_security_policy_impl.h" | 8 #include "content/browser/child_process_security_policy_impl.h" |
9 #include "content/browser/frame_host/debug_urls.h" | 9 #include "content/browser/frame_host/debug_urls.h" |
10 #include "content/browser/frame_host/frame_tree_node.h" | 10 #include "content/browser/frame_host/frame_tree_node.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 process_->RemoveObserver(this); | 39 process_->RemoveObserver(this); |
40 | 40 |
41 // Now that no one is referencing us, we can safely remove ourselves from | 41 // Now that no one is referencing us, we can safely remove ourselves from |
42 // the BrowsingInstance. Any future visits to a page from this site | 42 // the BrowsingInstance. Any future visits to a page from this site |
43 // (within the same BrowsingInstance) can safely create a new SiteInstance. | 43 // (within the same BrowsingInstance) can safely create a new SiteInstance. |
44 if (has_site_) | 44 if (has_site_) |
45 browsing_instance_->UnregisterSiteInstance( | 45 browsing_instance_->UnregisterSiteInstance( |
46 static_cast<SiteInstance*>(this)); | 46 static_cast<SiteInstance*>(this)); |
47 } | 47 } |
48 | 48 |
49 int32_t SiteInstanceImpl::GetId() { | 49 int32_t SiteInstanceImpl::GetId() const { |
50 return id_; | 50 return id_; |
51 } | 51 } |
52 | 52 |
53 bool SiteInstanceImpl::HasProcess() const { | 53 bool SiteInstanceImpl::HasProcess() const { |
54 if (process_ != NULL) | 54 if (process_ != NULL) |
55 return true; | 55 return true; |
56 | 56 |
57 // If we would use process-per-site for this site, also check if there is an | 57 // If we would use process-per-site for this site, also check if there is an |
58 // existing process that we would use if GetProcess() were called. | 58 // existing process that we would use if GetProcess() were called. |
59 BrowserContext* browser_context = | 59 BrowserContext* browser_context = |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 browsing_instance_->browser_context(), site_)) | 422 browsing_instance_->browser_context(), site_)) |
423 return; | 423 return; |
424 | 424 |
425 ChildProcessSecurityPolicyImpl* policy = | 425 ChildProcessSecurityPolicyImpl* policy = |
426 ChildProcessSecurityPolicyImpl::GetInstance(); | 426 ChildProcessSecurityPolicyImpl::GetInstance(); |
427 policy->LockToOrigin(process_->GetID(), site_); | 427 policy->LockToOrigin(process_->GetID(), site_); |
428 } | 428 } |
429 } | 429 } |
430 | 430 |
431 } // namespace content | 431 } // namespace content |
OLD | NEW |