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

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

Issue 536143002: Do not create proxy hosts in the subtree of navigating frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update CreateCrossProcessSubframeProxies Created 6 years, 3 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 0d95e1e361c7f630c4187a8eec3a49fa0828b8a0..4c31d29f52d59d9903523fe3b8242899e4a2ae85 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -1357,8 +1357,18 @@ void RenderFrameHostManager::CommitPending() {
linked_ptr<RenderFrameHostImpl>(old_render_frame_host.release());
}
} else {
- CHECK(proxy_hosts_.find(render_frame_host_->GetSiteInstance()->GetId()) ==
- proxy_hosts_.end());
+ // In --site-per-process, delete the proxy for the SiteInstance we are
Charlie Reis 2014/09/10 07:39:10 I'm having trouble understanding this part. Is th
nasko 2014/09/10 19:36:34 Added a TODO as per our chat.
+ // committing. In the case of main frame, the proxy wraps the
+ // |old_render_frame_host|, so it must be left intact.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kSitePerProcess) && !is_main_frame) {
+ RenderFrameProxyHostMap::iterator iter =
+ proxy_hosts_.find(render_frame_host_->GetSiteInstance()->GetId());
+ if (iter != proxy_hosts_.end()) {
+ delete iter->second;
+ proxy_hosts_.erase(iter);
+ }
+ }
// Capture the active view count on the old RFH SiteInstance, since the
// ownership might be passed into the proxy and the pointer will be
@@ -1393,6 +1403,11 @@ void RenderFrameHostManager::CommitPending() {
}
}
}
+
+ // 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(

Powered by Google App Engine
This is Rietveld 408576698