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

Issue 2410153005: Fix RenderView reuse issues when canceling a pending RenderFrameHost. (Closed)

Created:
4 years, 2 months ago by alexmos
Modified:
4 years, 2 months ago
Reviewers:
Charlie Reis, nasko
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, mlamouri+watch-blink_chromium.org, nasko+codewatch_chromium.org, jam, Randy Smith (Not in Mondays), dcheng, blink-reviews, darin-cc_chromium.org, loading-reviews_chromium.org, kinuko+watch, mmenke, Charlie Reis, site-isolation-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix RenderView reuse issues when canceling a pending RenderFrameHost. This CL fixes three issues that happen when a pending RenderFrameHost is canceled and discarded, but its SiteInstance has other active frames. In that case, the pending RenderFrameHost is replaced with a proxy, so that other frames in the SiteInstance can still communicate with it. 1) When a main frame pending RFH is canceled, we never update its RVH's main_frame_routing_id() or is_active() status. If the RVH is later reused by another main frame navigation, these parameters would be stale, leading to a crash in CreateRenderView trying to resolve the main frame via the stale routing ID. (Issue 627400) 2) The discarded RFH was deleted on the browser side, but the corresponding RenderFrame wasn't deleted on the renderer side. That led to a renderer-side crash of trying to reuse the leaked RenderFrame's widget if we ever re-navigated to the same SiteInstance in the same frame. The fix is to send a FrameMsg_Delete in the cases where the discarded main frame isn't going to be cleaned up by its RVH going away (in the case where the proxy is going to keep it alive). (Issue 651980) 3) The replacement proxy's RenderFrameProxyHost was created, but the RenderFrameProxy wasn't actually initialized on the renderer side, so other frames couldn't actually communicate with this frame. (Issue 653746) These changes are also likely to help with crashes we've been chasing in issues 626802 and 575245. BUG=627400, 651980, 653746, 626802, 575245 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/78c9c0d7d8e45837bc93efababf7fe517b2b36ad Cr-Commit-Position: refs/heads/master@{#425409}

Patch Set 1 #

Patch Set 2 : Cleanup #

Patch Set 3 : Rebase #

Patch Set 4 : Fix compile #

Patch Set 5 : Fix is_swapped_out() state on renderer side #

Patch Set 6 : Nits #

Total comments: 18

Patch Set 7 : Address Nasko's and Charlie's feedback #

Patch Set 8 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+209 lines, -33 lines) Patch
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 1 chunk +8 lines, -3 lines 0 comments Download
M content/browser/frame_host/render_frame_host_manager.cc View 1 2 3 4 5 6 7 2 chunks +26 lines, -9 lines 0 comments Download
M content/browser/site_per_process_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +145 lines, -0 lines 0 comments Download
M content/renderer/render_frame_proxy.cc View 1 2 3 4 5 6 7 1 chunk +8 lines, -0 lines 0 comments Download
M content/renderer/render_widget.h View 1 2 3 4 5 6 7 3 chunks +8 lines, -7 lines 0 comments Download
M content/renderer/render_widget.cc View 1 2 3 4 5 6 2 chunks +14 lines, -14 lines 0 comments Download

Messages

Total messages: 44 (37 generated)
alexmos
Nasko, can you please take a look? This has all the fixes related to RVH ...
4 years, 2 months ago (2016-10-12 20:29:46 UTC) #25
nasko
LGTM with a few nits. https://codereview.chromium.org/2410153005/diff/100001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2410153005/diff/100001/content/browser/frame_host/render_frame_host_impl.cc#newcode350 content/browser/frame_host/render_frame_host_impl.cc:350: frame_tree_node_->IsMainFrame() && render_view_host_->ref_count() == ...
4 years, 2 months ago (2016-10-13 21:26:29 UTC) #28
Charlie Reis
LGTM! Thanks so much for tracking these down. https://codereview.chromium.org/2410153005/diff/100001/content/browser/frame_host/render_frame_host_manager.cc File content/browser/frame_host/render_frame_host_manager.cc (right): https://codereview.chromium.org/2410153005/diff/100001/content/browser/frame_host/render_frame_host_manager.cc#newcode679 content/browser/frame_host/render_frame_host_manager.cc:679: rvh->set_is_active(false); ...
4 years, 2 months ago (2016-10-14 16:25:11 UTC) #30
alexmos
Thanks! All comments addressed below. https://codereview.chromium.org/2410153005/diff/100001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/2410153005/diff/100001/content/browser/frame_host/render_frame_host_impl.cc#newcode352 content/browser/frame_host/render_frame_host_impl.cc:352: render_frame_created_) { On 2016/10/13 ...
4 years, 2 months ago (2016-10-14 17:07:38 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2410153005/140001
4 years, 2 months ago (2016-10-14 17:29:12 UTC) #41
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 2 months ago (2016-10-14 18:57:31 UTC) #42
commit-bot: I haz the power
4 years, 2 months ago (2016-10-14 19:00:44 UTC) #44
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/78c9c0d7d8e45837bc93efababf7fe517b2b36ad
Cr-Commit-Position: refs/heads/master@{#425409}

Powered by Google App Engine
This is Rietveld 408576698