| 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/browsing_instance.h" | 5 #include "content/browser/browsing_instance.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "content/browser/site_instance_impl.h" | 9 #include "content/browser/site_instance_impl.h" |
| 10 #include "content/common/site_isolation_policy.h" | 10 #include "content/common/site_isolation_policy.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 instance->SetSite(url); | 44 instance->SetSite(url); |
| 45 return instance; | 45 return instance; |
| 46 } | 46 } |
| 47 | 47 |
| 48 scoped_refptr<SiteInstanceImpl> | 48 scoped_refptr<SiteInstanceImpl> |
| 49 BrowsingInstance::GetDefaultSubframeSiteInstance() { | 49 BrowsingInstance::GetDefaultSubframeSiteInstance() { |
| 50 // This should only be used for --top-document-isolation mode. | 50 // This should only be used for --top-document-isolation mode. |
| 51 CHECK(SiteIsolationPolicy::IsTopDocumentIsolationEnabled()); | 51 CHECK(SiteIsolationPolicy::IsTopDocumentIsolationEnabled()); |
| 52 if (!default_subframe_site_instance_) { | 52 if (!default_subframe_site_instance_) { |
| 53 SiteInstanceImpl* instance = new SiteInstanceImpl(this); | 53 SiteInstanceImpl* instance = new SiteInstanceImpl(this); |
| 54 instance->set_is_default_subframe_site_instance(); | 54 instance->set_process_reuse_policy( |
| 55 RenderProcessHostImpl::ProcessReusePolicy:: |
| 56 USE_DEFAULT_SUBFRAME_INSTANCE); |
| 55 | 57 |
| 56 // TODO(nick): This is a hack for now. | 58 // TODO(nick): This is a hack for now. |
| 57 instance->SetSite(GURL("http://web-subframes.invalid")); | 59 instance->SetSite(GURL("http://web-subframes.invalid")); |
| 58 | 60 |
| 59 default_subframe_site_instance_ = instance; | 61 default_subframe_site_instance_ = instance; |
| 60 } | 62 } |
| 61 | 63 |
| 62 return make_scoped_refptr(default_subframe_site_instance_); | 64 return make_scoped_refptr(default_subframe_site_instance_); |
| 63 } | 65 } |
| 64 | 66 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 } | 105 } |
| 104 | 106 |
| 105 BrowsingInstance::~BrowsingInstance() { | 107 BrowsingInstance::~BrowsingInstance() { |
| 106 // We should only be deleted when all of the SiteInstances that refer to | 108 // We should only be deleted when all of the SiteInstances that refer to |
| 107 // us are gone. | 109 // us are gone. |
| 108 DCHECK(site_instance_map_.empty()); | 110 DCHECK(site_instance_map_.empty()); |
| 109 DCHECK_EQ(0u, active_contents_count_); | 111 DCHECK_EQ(0u, active_contents_count_); |
| 110 } | 112 } |
| 111 | 113 |
| 112 } // namespace content | 114 } // namespace content |
| OLD | NEW |