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

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: Rebase after swapped out changes major rework with RFP 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 952b0b0fd17d83e732369f61780de207194629c2..742c0b9b68ced0559f3ef9e4f82865f7d366c4a8 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -144,6 +144,19 @@ RenderWidgetHostView* RenderFrameHostManager::GetRenderWidgetHostView() const {
return nullptr;
}
+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;
@@ -160,6 +173,38 @@ 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());
+}
+
+bool RenderFrameHostManager::ForInnerDelegate() {
+ // TODO(lazyboy): We should remove IsMainFrame() check below since any frames
nasko 2015/06/11 00:21:28 Should we? Wouldn't this cause us to skip the ref-
lazyboy 2015/06/11 22:20:29 Hmmm, I think so. Out of process subframes inside
+ // in the inner WebContents should be treated as a part of inner
+ // WebContents/Delegate.
+ return frame_tree_node_->IsMainFrame() &&
+ delegate_->GetOuterDelegateFrameTreeNodeID() != -1;
+}
+
+void RenderFrameHostManager::RemoveOuterDelegateFrame() {
+ 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(
nasko 2015/06/11 00:21:28 Shouldn't this work be driven by the chrome/ layer
lazyboy 2015/06/11 22:20:29 This is an <iframe> element in outer WebContents b
+ 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 +1692,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, render_frame_host->render_view_host(),
nasko 2015/06/11 00:21:28 I thought the idea was to not associate this proxy
lazyboy 2015/06/11 22:20:29 That works. Done.
+ frame_tree_node_);
+ proxy_hosts_[outer_contents_site_instance->GetId()] = proxy;
+
+ render_frame_host->Send(
+ new FrameMsg_SwapOut(render_frame_host->GetRoutingID(),
+ proxy->GetRoutingID(), false /* is_loading */,
+ FrameReplicationState()));
+ proxy->set_render_frame_proxy_created(true);
+}
+
+void RenderFrameHostManager::SetRWHViewForInnerContents(
+ RenderWidgetHostView* child_rwhv) {
+ GetProxyToOuterDelegate()->SetChildRWHView(child_rwhv);
+}
+
bool RenderFrameHostManager::InitRenderView(
RenderViewHostImpl* render_view_host,
int opener_route_id,

Powered by Google App Engine
This is Rietveld 408576698