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

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

Issue 565103002: Revert of Do not create proxy hosts in the subtree of navigating frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 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() {
« 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