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

Unified Diff: content/browser/frame_host/render_frame_host_manager.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: Move iframe*guestview to components/ Created 5 years, 6 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_host_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 7bf17336c2db200023351d26342c51d6a31aba1c..bf80943f4f6ecd2f5dd7797d5c834480da8a8c09 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -145,6 +145,28 @@ RenderWidgetHostView* RenderFrameHostManager::GetRenderWidgetHostView() const {
return nullptr;
}
+bool RenderFrameHostManager::ForInnerDelegate() {
+ // TODO(lazyboy): Subframes inside inner WebContents needs to be tested and
+ // we have to make sure that IsMainFrame() check below is appropriate. See
+ // http://crbug.com/500957.
+ return frame_tree_node_->IsMainFrame() &&
+ delegate_->GetOuterDelegateFrameTreeNodeID() !=
+ FrameTreeNode::kFrameTreeNodeInvalidID;
+}
+
+RenderWidgetHostImpl*
+RenderFrameHostManager::GetOuterRenderWidgetHostForKeyboardInput() {
+ if (!ForInnerDelegate())
+ return nullptr;
+
+ FrameTreeNode* outer_contents_frame_tree_node =
+ FrameTreeNode::GloballyFindByID(
+ delegate_->GetOuterDelegateFrameTreeNodeID());
+ return outer_contents_frame_tree_node->parent()
+ ->current_frame_host()
+ ->render_view_host();
+}
+
RenderFrameProxyHost* RenderFrameHostManager::GetProxyToParent() {
if (frame_tree_node_->IsMainFrame())
return NULL;
@@ -161,6 +183,30 @@ RenderFrameProxyHost* RenderFrameHostManager::GetProxyToParent() {
return iter->second;
}
+RenderFrameProxyHost* RenderFrameHostManager::GetProxyToOuterDelegate() {
+ int outer_contents_frame_tree_node_id =
+ delegate_->GetOuterDelegateFrameTreeNodeID();
+ FrameTreeNode* outer_contents_frame_tree_node =
+ FrameTreeNode::GloballyFindByID(outer_contents_frame_tree_node_id);
+ if (!outer_contents_frame_tree_node ||
+ !outer_contents_frame_tree_node->parent()) {
+ return nullptr;
+ }
+
+ return GetRenderFrameProxyHost(outer_contents_frame_tree_node->parent()
+ ->current_frame_host()
+ ->GetSiteInstance());
+}
+
+void RenderFrameHostManager::RemoveOuterDelegateFrame() {
nasko 2015/06/23 13:39:23 I also feel this method doesn't quite belong in RF
lazyboy 2015/06/23 23:00:00 I've added a TODO for this to move out of RFHM.
+ FrameTreeNode* outer_delegate_frame_tree_node =
+ FrameTreeNode::GloballyFindByID(
+ delegate_->GetOuterDelegateFrameTreeNodeID());
+ DCHECK(outer_delegate_frame_tree_node->parent());
+ outer_delegate_frame_tree_node->frame_tree()->RemoveFrame(
+ outer_delegate_frame_tree_node);
+}
+
void RenderFrameHostManager::SetPendingWebUI(const GURL& url, int bindings) {
pending_web_ui_ = CreateWebUI(url, bindings);
pending_and_current_web_ui_.reset();
@@ -1647,6 +1693,28 @@ void RenderFrameHostManager::EnsureRenderViewInitialized(
proxy->set_render_frame_proxy_created(true);
}
+void RenderFrameHostManager::CreateOuterDelegateProxy(
+ SiteInstance* outer_contents_site_instance,
+ RenderFrameHostImpl* render_frame_host) {
+ CHECK(base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSitePerProcess));
+ RenderFrameProxyHost* proxy = new RenderFrameProxyHost(
+ outer_contents_site_instance, nullptr, frame_tree_node_);
+ proxy_hosts_[outer_contents_site_instance->GetId()] = proxy;
+
+ // Swap the outer WebContents's frame with the proxy to inner WebContents.
+ render_frame_host->Send(new FrameMsg_SwapOut(
+ render_frame_host->GetRoutingID(), proxy->GetRoutingID(),
+ false /* is_loading */, FrameReplicationState()));
nasko 2015/06/23 13:39:23 nit: Do we still need a TODO for the is_loading?
lazyboy 2015/06/23 23:00:00 Done.
+ proxy->set_render_frame_proxy_created(true);
+}
+
+void RenderFrameHostManager::SetRWHViewForInnerContents(
+ RenderWidgetHostView* child_rwhv) {
+ DCHECK(ForInnerDelegate());
+ GetProxyToOuterDelegate()->SetChildRWHView(child_rwhv);
+}
+
bool RenderFrameHostManager::InitRenderView(
RenderViewHostImpl* render_view_host,
int opener_route_id,

Powered by Google App Engine
This is Rietveld 408576698