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

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

Issue 667813002: Revert of Revert of Drop CreateChildFrame messages when swapping out. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2171
Patch Set: Created 6 years, 2 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 | « content/browser/frame_host/frame_tree.h ('k') | content/browser/frame_host/frame_tree_node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/frame_tree.cc
diff --git a/content/browser/frame_host/frame_tree.cc b/content/browser/frame_host/frame_tree.cc
index 3415e46780ea6f1145fe1968a2f107a6f842be5c..ec67d8d5a624993f4c55b0436fe3abc87aaebd6c 100644
--- a/content/browser/frame_host/frame_tree.cc
+++ b/content/browser/frame_host/frame_tree.cc
@@ -143,8 +143,16 @@
}
RenderFrameHostImpl* FrameTree::AddFrame(FrameTreeNode* parent,
+ int process_id,
int new_routing_id,
const std::string& frame_name) {
+ // A child frame always starts with an initial empty document, which means
+ // it is in the same SiteInstance as the parent frame. Ensure that the process
+ // which requested a child frame to be added is the same as the process of the
+ // parent node.
+ if (parent->current_frame_host()->GetProcess()->GetID() != process_id)
+ return nullptr;
+
scoped_ptr<FrameTreeNode> node(new FrameTreeNode(
this, parent->navigator(), render_frame_delegate_, render_view_delegate_,
render_widget_delegate_, manager_delegate_, frame_name));
@@ -154,7 +162,7 @@
CHECK(result.second);
FrameTreeNode* node_ptr = node.get();
// AddChild is what creates the RenderFrameHost.
- parent->AddChild(node.Pass(), new_routing_id);
+ parent->AddChild(node.Pass(), process_id, new_routing_id);
return node_ptr->current_frame_host();
}
« no previous file with comments | « content/browser/frame_host/frame_tree.h ('k') | content/browser/frame_host/frame_tree_node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698