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

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

Issue 1262563003: Subframes in inner WebContents should not create proxies in process of outer WebContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments from lfg@ Created 5 years, 5 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 18890339a74b76ed4f2293c1bc742e6372f42fb6..a9e3021b2696e02b0cb0cf5db5758da1b84b855c 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -263,17 +263,13 @@ RenderWidgetHostView* RenderFrameHostManager::GetRenderWidgetHostView() const {
}
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;
+ return delegate_->GetOuterDelegateFrameTreeNodeID() !=
+ FrameTreeNode::kFrameTreeNodeInvalidID;
}
RenderWidgetHostImpl*
RenderFrameHostManager::GetOuterRenderWidgetHostForKeyboardInput() {
- if (!ForInnerDelegate())
+ if (!ForInnerDelegate() || !frame_tree_node_->IsMainFrame())
return nullptr;
FrameTreeNode* outer_contents_frame_tree_node =
@@ -1787,6 +1783,11 @@ int RenderFrameHostManager::CreateRenderFrameProxy(SiteInstance* instance) {
void RenderFrameHostManager::CreateProxiesForChildFrame(FrameTreeNode* child) {
for (const auto& pair : *proxy_hosts_) {
+ // Do not create proxies for subframes in the outer delegate's process,
+ // since the outer delegate does not need to interact with them.
+ if (ForInnerDelegate() && pair.second == GetProxyToOuterDelegate())
+ continue;
+
child->render_manager()->CreateRenderFrameProxy(
pair.second->GetSiteInstance());
}
@@ -1838,7 +1839,7 @@ void RenderFrameHostManager::CreateOuterDelegateProxy(
void RenderFrameHostManager::SetRWHViewForInnerContents(
RenderWidgetHostView* child_rwhv) {
- DCHECK(ForInnerDelegate());
+ DCHECK(ForInnerDelegate() && frame_tree_node_->IsMainFrame());
GetProxyToOuterDelegate()->SetChildRWHView(child_rwhv);
}
« no previous file with comments | « content/browser/frame_host/render_frame_host_manager.h ('k') | content/browser/frame_host/render_frame_proxy_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698