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

Unified Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 2650473002: Don't swap processes for chrome:// subframes. (Closed)
Patch Set: Restore transfer code due to failing WebUI tests. Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/render_frame_host_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 1dc50e79c0d7f1b3b0a266f8493823f1367d18e1..c6f444fdfbf7611ed408b831365dc604afb89663 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1320,6 +1320,21 @@ RenderFrameHostManager::DetermineSiteInstanceForURL(
return SiteInstanceDescriptor(current_instance_impl);
}
+ // If the parent frame is a chrome:// page and the subframe is as well, keep
+ // the subframe in the parent's process even if they would be considered
+ // different sites. This avoids unnecessary OOPIFs on pages like
+ // chrome://settings, which currently has multiple "cross-site" subframes that
+ // don't need isolation.
+ if (SiteIsolationPolicy::AreCrossProcessFramesPossible() &&
+ !frame_tree_node_->IsMainFrame()) {
+ SiteInstance* parent_site_instance =
+ frame_tree_node_->parent()->current_frame_host()->GetSiteInstance();
+ if (parent_site_instance->GetSiteURL().SchemeIs(kChromeUIScheme) &&
+ dest_url.SchemeIs(kChromeUIScheme)) {
+ return SiteInstanceDescriptor(parent_site_instance);
+ }
+ }
+
// If we haven't used our SiteInstance (and thus RVH) yet, then we can use it
// for this entry. We won't commit the SiteInstance to this site until the
// navigation commits (in DidNavigate), unless the navigation entry was
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698