Commit 7c3d7bbd authored by lfg's avatar lfg Committed by Commit bot

Do not hide the old RenderWidgetHostView when commiting a navigation.

This fixes an issue where the old RenderView is reused by a new remote
subframe. We shouldn't be leaking resources, because now we are already
hiding the unused RenderView in the renderer, when the local main frame
gets detached and the WebViewFrameWidget is closed.

BUG=638375
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation

Review-Url: https://chromiumcodereview.appspot.com/2415973002
Cr-Commit-Position: refs/heads/master@{#426913}
parent 58290e53
...@@ -2163,14 +2163,6 @@ void RenderFrameHostManager::CommitPending() { ...@@ -2163,14 +2163,6 @@ void RenderFrameHostManager::CommitPending() {
render_frame_host_->render_view_host()); render_frame_host_->render_view_host());
} }
// For top-level frames, also hide the old RenderViewHost's view.
// TODO(creis): As long as show/hide are on RVH, we don't want to hide on
// subframe navigations or we will interfere with the top-level frame.
if (is_main_frame &&
old_render_frame_host->render_view_host()->GetWidget()->GetView()) {
old_render_frame_host->render_view_host()->GetWidget()->GetView()->Hide();
}
// Make sure the size is up to date. (Fix for bug 1079768.) // Make sure the size is up to date. (Fix for bug 1079768.)
delegate_->UpdateRenderViewSizeForRenderManager(); delegate_->UpdateRenderViewSizeForRenderManager();
......
...@@ -8522,4 +8522,30 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ...@@ -8522,4 +8522,30 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
} }
// This tests that we don't hide the RenderViewHost when reusing the
// RenderViewHost for a subframe. See https://crbug.com/638375.
IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ReusedRenderViewNotHidden) {
GURL a_url(embedded_test_server()->GetURL("a.com", "/title1.html"));
GURL b_url_a_subframe(embedded_test_server()->GetURL(
"b.com", "/cross_site_iframe_factory.html?b(a)"));
EXPECT_TRUE(NavigateToURL(shell(), a_url));
// Open a popup in a.com.
Shell* popup = OpenPopup(shell(), a_url, "popup");
// Navigate this popup to b.com with an a.com subframe.
EXPECT_TRUE(NavigateToURL(popup, b_url_a_subframe));
FrameTreeNode* root = static_cast<WebContentsImpl*>(popup->web_contents())
->GetFrameTree()
->root();
FrameTreeNode* child_node = root->child_at(0);
EXPECT_FALSE(child_node->current_frame_host()
->render_view_host()
->GetWidget()
->is_hidden());
}
} // namespace content } // namespace content
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment