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

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: Fix UMA test. 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
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..491a01a2827eccaecc4dd17ecf0ee4517fe4213a 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1269,6 +1269,10 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation(
SiteInstance* new_site_instance,
const GURL& new_effective_url,
bool new_is_view_source_mode) const {
+ // Subframe must stay in the same BrowsingInstance as its parent.
Charlie Reis 2015/12/04 18:23:23 nit: A subframe Do we want a TODO for "Ensure tha
nasko 2015/12/04 18:32:33 Done.
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698