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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2496233003: Destroy the old RenderWidgetHostView when swapping out a main frame. (Closed)
Patch Set: rebase Created 4 years 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 | « content/browser/site_per_process_browsertest.cc ('k') | content/public/test/test_renderer_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 4a1d2fb83c227dde49a3513ebb6c714b2a3067d5..bd1a6461f5493368859ba6884700f22a94151d73 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4921,14 +4921,17 @@ bool WebContentsImpl::CreateRenderViewForRenderManager(
TRACE_EVENT0("browser,navigation",
"WebContentsImpl::CreateRenderViewForRenderManager");
- if (proxy_routing_id == MSG_ROUTING_NONE)
+ RenderViewHostImpl* rvhi = static_cast<RenderViewHostImpl*>(render_view_host);
+
+ // We only create a RWHV for active RenderViewHosts. When an inactive RVH is
+ // reused, the RWHV is created in RenderFrameHostManager::CommitPending.
piman 2017/03/28 20:57:55 Belated drive-by... This seems to be assuming it'
+ if (rvhi->is_active()) {
+ DCHECK_EQ(MSG_ROUTING_NONE, proxy_routing_id);
CreateRenderWidgetHostViewForRenderManager(render_view_host);
+ }
- if (!static_cast<RenderViewHostImpl*>(render_view_host)
- ->CreateRenderView(opener_frame_routing_id,
- proxy_routing_id,
- replicated_frame_state,
- created_with_opener_)) {
+ if (!rvhi->CreateRenderView(opener_frame_routing_id, proxy_routing_id,
+ replicated_frame_state, created_with_opener_)) {
return false;
}
« no previous file with comments | « content/browser/site_per_process_browsertest.cc ('k') | content/public/test/test_renderer_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698