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

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

Issue 558943002: Revert of Cross-process iframe accessibility. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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
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..de6c69b59bd06e46c839dbcff6e67ef7012d55b7 100644
--- a/content/browser/frame_host/frame_tree.cc
+++ b/content/browser/frame_host/frame_tree.cc
@@ -14,7 +14,6 @@
#include "content/browser/frame_host/navigator.h"
#include "content/browser/frame_host/render_frame_host_factory.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
-#include "content/browser/frame_host/render_frame_proxy_host.h"
#include "content/browser/renderer_host/render_view_host_factory.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/public/browser/browser_thread.h"
@@ -36,6 +35,20 @@
FrameTreeNode** out_node,
FrameTreeNode* node) {
if (node->frame_tree_node_id() == frame_tree_node_id) {
+ *out_node = node;
+ // Terminate iteration once the node has been found.
+ return false;
+ }
+ return true;
+}
+
+bool FrameTreeNodeForRoutingId(int routing_id,
+ int process_id,
+ FrameTreeNode** out_node,
+ FrameTreeNode* node) {
+ // TODO(creis): Look through the swapped out RFHs as well.
+ if (node->current_frame_host()->GetProcess()->GetID() == process_id &&
+ node->current_frame_host()->GetRoutingID() == routing_id) {
*out_node = node;
// Terminate iteration once the node has been found.
return false;
@@ -107,23 +120,10 @@
}
FrameTreeNode* FrameTree::FindByRoutingID(int routing_id, int process_id) {
- RenderFrameHostImpl* render_frame_host =
- RenderFrameHostImpl::FromID(process_id, routing_id);
- if (render_frame_host) {
- FrameTreeNode* result = render_frame_host->frame_tree_node();
- if (this == result->frame_tree())
- return result;
- }
-
- RenderFrameProxyHost* render_frame_proxy_host =
- RenderFrameProxyHost::FromID(process_id, routing_id);
- if (render_frame_proxy_host) {
- FrameTreeNode* result = render_frame_proxy_host->frame_tree_node();
- if (this == result->frame_tree())
- return result;
- }
-
- return NULL;
+ FrameTreeNode* node = NULL;
+ ForEach(
+ base::Bind(&FrameTreeNodeForRoutingId, routing_id, process_id, &node));
+ return node;
}
void FrameTree::ForEach(

Powered by Google App Engine
This is Rietveld 408576698