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

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: address comments from nasko@ + git cl format 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 84bc856a931d4c0104177edc5cbadc90332ae438..8d126e538ae86615a132a9d234c30d10c3f058fe 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,39 @@ 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): 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;
+}
+
+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(
+ 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();
@@ -1648,6 +1694,27 @@ 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;
+
+ render_frame_host->Send(new FrameMsg_SwapOut(
Charlie Reis 2015/06/18 00:13:18 Let's put a comment here (and/or the declaration)
lazyboy 2015/06/18 22:45:12 Done.
+ render_frame_host->GetRoutingID(), proxy->GetRoutingID(),
+ false /* is_loading */, FrameReplicationState()));
+ 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