Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(207)

Side by Side Diff: content/browser/browsing_instance.cc

Issue 2861433002: Implement ProcessReusePolicy for SiteInstances (Closed)
Patch Set: Fixed ChromeOS issue Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/media/capture/web_contents_video_capture_device_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 SiteInstanceImpl::ProcessReusePolicy::USE_DEFAULT_SUBFRAME_PROCESS);
55 56
56 // TODO(nick): This is a hack for now. 57 // TODO(nick): This is a hack for now.
57 instance->SetSite(GURL("http://web-subframes.invalid")); 58 instance->SetSite(GURL("http://web-subframes.invalid"));
58 59
59 default_subframe_site_instance_ = instance; 60 default_subframe_site_instance_ = instance;
60 } 61 }
61 62
62 return make_scoped_refptr(default_subframe_site_instance_); 63 return make_scoped_refptr(default_subframe_site_instance_);
63 } 64 }
64 65
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 104 }
104 105
105 BrowsingInstance::~BrowsingInstance() { 106 BrowsingInstance::~BrowsingInstance() {
106 // We should only be deleted when all of the SiteInstances that refer to 107 // We should only be deleted when all of the SiteInstances that refer to
107 // us are gone. 108 // us are gone.
108 DCHECK(site_instance_map_.empty()); 109 DCHECK(site_instance_map_.empty());
109 DCHECK_EQ(0u, active_contents_count_); 110 DCHECK_EQ(0u, active_contents_count_);
110 } 111 }
111 112
112 } // namespace content 113 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/capture/web_contents_video_capture_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698