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

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

Issue 972313002: Make <webview> use out-of-process iframe architecture. (Closed) Base URL: ssh://saopaulo.wat/mnt/dev/shared/src@testoopif2z-better-chrome
Patch Set: add basic postMessage test Created 5 years, 7 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/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..0d592fb3f5ac3215958c000aa7cb506384077e52 100644
--- a/content/browser/frame_host/render_frame_proxy_host.cc
+++ b/content/browser/frame_host/render_frame_proxy_host.cc
@@ -56,11 +56,14 @@ RenderFrameProxyHost::RenderFrameProxyHost(SiteInstance* site_instance,
RenderFrameProxyHostID(GetProcess()->GetID(), routing_id_),
this)).second);
- if (!frame_tree_node_->IsMainFrame() &&
- frame_tree_node_->parent()
- ->render_manager()
- ->current_frame_host()
- ->GetSiteInstance() == site_instance) {
+ if ((!frame_tree_node_->IsMainFrame() &&
+ frame_tree_node_->parent()
+ ->render_manager()
+ ->current_frame_host()
+ ->GetSiteInstance() == site_instance) ||
+ // If this is a proxy for the guest FTN in its embedder process, then we
+ // need a CrossProcessFrameConnector.
Charlie Reis 2015/05/19 07:12:31 This is getting a bit too complicated, given that
lazyboy 2015/05/21 23:23:47 Done.
+ 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 +95,19 @@ 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.
RenderViewHostImpl* RenderFrameProxyHost::GetRenderViewHost() {
- return frame_tree_node_->frame_tree()->GetRenderViewHost(
- site_instance_.get());
+ // RVH of embedder SiteInstance does not live in the guest RFHM, we need to
+ // look it up in the embedder's FrameTree.
+ RenderFrameProxyHost* proxy_to_embedder =
+ frame_tree_node_->render_manager()->GetProxyToEmbedder();
+ FrameTree* frame_tree =
+ proxy_to_embedder &&
+ proxy_to_embedder->GetSiteInstance() == GetSiteInstance()
+ ? proxy_to_embedder->frame_tree_node_->frame_tree()
+ : frame_tree_node_->frame_tree();
+ return frame_tree->GetRenderViewHost(site_instance_.get());
}
void RenderFrameProxyHost::TakeFrameHostOwnership(

Powered by Google App Engine
This is Rietveld 408576698