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

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

Issue 536143002: Do not create proxy hosts in the subtree of navigating frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CrossSiteIframe asserts. Created 6 years, 3 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_browsertest.cc » ('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..d5a183ff8cbdb3d1ddd04bbc11c38b092f834a50 100644
--- a/content/browser/frame_host/frame_tree.cc
+++ b/content/browser/frame_host/frame_tree.cc
@@ -52,13 +52,8 @@ bool ResetNodesForNewProcess(RenderViewHost* render_view_host,
return true;
}
-bool CreateProxyForSiteInstance(FrameTreeNode* source_node,
- const scoped_refptr<SiteInstance>& instance,
+bool CreateProxyForSiteInstance(const scoped_refptr<SiteInstance>& instance,
FrameTreeNode* node) {
- // Skip the node that initiated the creation.
- if (source_node == node)
- return true;
-
node->render_manager()->CreateRenderFrameProxy(instance.get());
return true;
}
@@ -128,12 +123,21 @@ FrameTreeNode* FrameTree::FindByRoutingID(int routing_id, int process_id) {
void FrameTree::ForEach(
const base::Callback<bool(FrameTreeNode*)>& on_node) const {
+ ForEach(on_node, NULL);
+}
+
+void FrameTree::ForEach(
+ const base::Callback<bool(FrameTreeNode*)>& on_node,
+ FrameTreeNode* skip_this_subtree) const {
std::queue<FrameTreeNode*> queue;
queue.push(root_.get());
while (!queue.empty()) {
FrameTreeNode* node = queue.front();
queue.pop();
+ if (skip_this_subtree == node)
+ continue;
+
if (!on_node.Run(node))
break;
@@ -193,7 +197,11 @@ void FrameTree::CreateProxiesForSiteInstance(
}
scoped_refptr<SiteInstance> instance(site_instance);
- ForEach(base::Bind(&CreateProxyForSiteInstance, source, instance));
+
+ // Proxies are created in the FrameTree in response to a node navigating to a
+ // new SiteInstance. Since |source|'s navigation will replace the currently
+ // loaded document, the entire subtree under |source| will be removed.
+ ForEach(base::Bind(&CreateProxyForSiteInstance, instance), source);
}
void FrameTree::ResetForMainFrameSwap() {
« no previous file with comments | « content/browser/frame_host/frame_tree.h ('k') | content/browser/frame_host/frame_tree_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698