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

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

Issue 1495993002: Enforce all subframes to be in the same BrowsingInstance as the parent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes based on Charlie's review. Created 5 years 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 | « chrome/browser/site_details_browsertest.cc ('k') | content/test/web_contents_observer_sanity_checker.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 67a150e11a6ac9700f05fa5aa63cc57d0bd0075a..8ffd6abdeace2bab1bde29f543505c297bc4e2fe 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1269,6 +1269,12 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation(
SiteInstance* new_site_instance,
const GURL& new_effective_url,
bool new_is_view_source_mode) const {
+ // A subframe must stay in the same BrowsingInstance as its parent.
+ // TODO(nasko): Ensure that SiteInstance swap is still triggered for subframes
+ // in the cases covered by the rest of the checks in this method.
+ if (!frame_tree_node_->IsMainFrame())
+ return false;
+
// If new_entry already has a SiteInstance, assume it is correct. We only
// need to force a swap if it is in a different BrowsingInstance.
if (new_site_instance) {
« no previous file with comments | « chrome/browser/site_details_browsertest.cc ('k') | content/test/web_contents_observer_sanity_checker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698