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

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

Issue 600483003: Do not create proxy hosts in the subtree of navigating frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix NavigateRemoteFrame. Created 6 years, 2 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 4c2b565a1fd8b919e5313972ea2de4cba307525d..37997ac276e9374024fd8c4b865924b92aca6b76 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1293,19 +1293,33 @@ void RenderFrameHostManager::CommitPending() {
// the proxy.
SwapOutOldFrame(old_render_frame_host.Pass());
- // If this is a subframe, it should have a CrossProcessFrameConnector
- // created already. Use it to link the new RFH's view to the proxy that
- // belongs to the parent frame's SiteInstance.
- // Note: We do this after swapping out the old RFH because that may create the
- // proxy we're looking for.
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSitePerProcess) &&
!is_main_frame) {
+ // If this is a subframe, it should have a CrossProcessFrameConnector
+ // created already. Use it to link the new RFH's view to the proxy that
+ // belongs to the parent frame's SiteInstance.
+ // Note: We do this after swapping out the old RFH because that may create
+ // the proxy we're looking for.
RenderFrameProxyHost* proxy_to_parent = GetProxyToParent();
if (proxy_to_parent) {
proxy_to_parent->SetChildRWHView(
render_frame_host_->render_view_host()->GetView());
}
+
+ // Since the new RenderFrameHost is now committed, there must be no proxies
+ // for its SiteInstance. Delete any existing ones.
+ RenderFrameProxyHostMap::iterator iter =
+ proxy_hosts_.find(render_frame_host_->GetSiteInstance()->GetId());
+ if (iter != proxy_hosts_.end()) {
+ delete iter->second;
+ proxy_hosts_.erase(iter);
+ }
}
+
+ // After all is done, there must never be a proxy in the list which has the
+ // same SiteInstance as the current RenderFrameHost.
+ CHECK(proxy_hosts_.find(render_frame_host_->GetSiteInstance()->GetId()) ==
+ proxy_hosts_.end());
}
void RenderFrameHostManager::ShutdownRenderFrameProxyHostsInSiteInstance(
« no previous file with comments | « content/browser/frame_host/frame_tree_browsertest.cc ('k') | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698