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

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

Issue 519203002: Don't try to use RFH from proxies for subframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b983d2cb0ba0410c9a858877b834c42e4f5714e2..0d95e1e361c7f630c4187a8eec3a49fa0828b8a0 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1067,7 +1067,7 @@ int RenderFrameHostManager::CreateRenderFrame(SiteInstance* instance,
// remove it from the list of proxy hosts below if it will be active.
RenderFrameProxyHost* proxy = GetRenderFrameProxyHost(instance);
- if (proxy) {
+ if (proxy && proxy->render_frame_host()) {
routing_id = proxy->GetRenderViewHost()->GetRoutingID();
// Delete the existing RenderFrameProxyHost, but reuse the RenderFrameHost.
// Prevent the process from exiting while we're trying to use it.
@@ -1108,8 +1108,9 @@ int RenderFrameHostManager::CreateRenderFrame(SiteInstance* instance,
proxy = new RenderFrameProxyHost(
new_render_frame_host->GetSiteInstance(), frame_tree_node_);
proxy_hosts_[instance->GetId()] = proxy;
- proxy->TakeFrameHostOwnership(new_render_frame_host.Pass());
proxy_routing_id = proxy->GetRoutingID();
+ if (frame_tree_node_->IsMainFrame())
+ proxy->TakeFrameHostOwnership(new_render_frame_host.Pass());
}
bool success = InitRenderView(render_view_host,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698