Index: content/browser/frame_host/render_frame_proxy_host.cc |
diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc |
index 6d41f873516b9a088bb9d4fed4aa3eb8a267dc65..82788069966688f2f4f3ce7a8c7dea2859e957a1 100644 |
--- a/content/browser/frame_host/render_frame_proxy_host.cc |
+++ b/content/browser/frame_host/render_frame_proxy_host.cc |
@@ -55,12 +55,16 @@ RenderFrameProxyHost::RenderFrameProxyHost(SiteInstance* site_instance, |
std::make_pair( |
RenderFrameProxyHostID(GetProcess()->GetID(), routing_id_), |
this)).second); |
- |
- if (!frame_tree_node_->IsMainFrame() && |
- frame_tree_node_->parent() |
- ->render_manager() |
- ->current_frame_host() |
- ->GetSiteInstance() == site_instance) { |
+ bool is_proxy_to_parent = !frame_tree_node_->IsMainFrame() && |
+ frame_tree_node_->parent() |
+ ->render_manager() |
+ ->current_frame_host() |
+ ->GetSiteInstance() == site_instance; |
+ |
+ // If this is a proxy to parent frame or this proxy is for the inner |
+ // WebContents' FTN in outer WebContents' process, then we need a |
Charlie Reis
2015/05/22 23:44:31
nit: WebContents's
nit: FrameTreeNode
lazyboy
2015/05/26 16:32:54
Done.
|
+ // CrossProcessFrameConnector. |
+ if (is_proxy_to_parent || frame_tree_node_->render_manager()->IsGuest()) { |
// The RenderFrameHost navigating cross-process is destroyed and a proxy for |
// it is created in the parent's process. CrossProcessFrameConnector |
// initialization only needs to happen on an initial cross-process |
@@ -92,9 +96,20 @@ void RenderFrameProxyHost::SetChildRWHView(RenderWidgetHostView* view) { |
static_cast<RenderWidgetHostViewChildFrame*>(view)); |
} |
+// TODO(lazyboy): We can probably cache a pointer to RVH in this class |
+// as we do in RenderFrameHostImpl. |
nasko
2015/05/22 16:32:27
I have a CL that does just that, but got reverted.
lazyboy
2015/05/26 16:32:54
This function has been moved now.
|
RenderViewHostImpl* RenderFrameProxyHost::GetRenderViewHost() { |
- return frame_tree_node_->frame_tree()->GetRenderViewHost( |
- site_instance_.get()); |
+ // RVH of outer WebContents' SiteInstance does not live in the RFHM of the |
nasko
2015/05/22 16:32:27
Hmmm, this strikes me as odd and possibly wrong. A
Charlie Reis
2015/05/22 23:44:31
+1. The RVH for a proxy should be in the same tre
lazyboy
2015/05/26 16:32:54
This is required because RWHVChildFrame needed to
|
+ // inner WebContents, we need to look it up in the FrameTree of the outer |
+ // WebContents. |
+ RenderFrameProxyHost* proxy_to_outer_contents = |
+ frame_tree_node_->render_manager()->GetProxyToOuterContents(); |
+ FrameTree* frame_tree = |
+ proxy_to_outer_contents && |
+ proxy_to_outer_contents->GetSiteInstance() == GetSiteInstance() |
+ ? proxy_to_outer_contents->frame_tree_node_->frame_tree() |
+ : frame_tree_node_->frame_tree(); |
+ return frame_tree->GetRenderViewHost(site_instance_.get()); |
} |
void RenderFrameProxyHost::TakeFrameHostOwnership( |