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 d5a183ff8cbdb3d1ddd04bbc11c38b092f834a50..3415e46780ea6f1145fe1968a2f107a6f842be5c 100644 |
--- a/content/browser/frame_host/frame_tree.cc |
+++ b/content/browser/frame_host/frame_tree.cc |
@@ -52,8 +52,13 @@ |
return true; |
} |
-bool CreateProxyForSiteInstance(const scoped_refptr<SiteInstance>& instance, |
+bool CreateProxyForSiteInstance(FrameTreeNode* source_node, |
+ 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; |
} |
@@ -123,21 +128,12 @@ |
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; |
@@ -197,11 +193,7 @@ |
} |
scoped_refptr<SiteInstance> instance(site_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); |
+ ForEach(base::Bind(&CreateProxyForSiteInstance, source, instance)); |
} |
void FrameTree::ResetForMainFrameSwap() { |