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

Issue 1345353003: Fix detection of RenderViewHosts pending deletion in CreateRenderViewHost. (Closed)

Created:
5 years, 3 months ago by alexmos
Modified:
5 years, 3 months ago
Reviewers:
nasko
CC:
chromium-reviews, jam, nasko+codewatch_chromium.org, creis+watch_chromium.org, darin-cc_chromium.org, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix detection of RenderViewHosts pending deletion in CreateRenderViewHost. Previously, if FrameTree::CreateRenderViewHost found an existing RVH, it checked whether its main frame is pending deletion to decide that the RVH shouldn't be reused. This doesn't work when IsSwappedOutForbidden is true, because the RVH's main frame might have been cleared by RFHM::CommitPending. Consequently, on A->B->A navigations, if B->A happened before the swapout ACK was received for A->B, we ended up reusing RVH(A) for the new navigation, and crashed trying to create RF(A) because creating main frames with an existing RenderView and without a proxy to replace isn't supported by the renderer. In such situations, RVH(A) shouldn't be reused, and this code introduces a flag on RVH to ensure that this happens even after the main frame has been cleared. BUG=515302 Committed: https://crrev.com/b97d6bb6f374d80d432d74ce5c31465fa21209f7 Cr-Commit-Position: refs/heads/master@{#350489}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : Rewrite test #

Patch Set 4 : Nits #

Total comments: 10

Patch Set 5 : Nasko's comments #

Patch Set 6 : Fix UAFs due to SwapOut timer calling OnSwappedOut in the middle of test. #

Total comments: 2

Patch Set 7 : Tweak test per Nasko's suggestions; fix pending RVH check #

Total comments: 2

Patch Set 8 : Fix Nasko's nit #

Patch Set 9 : Fix test timeout on Mac #

Unified diffs Side-by-side diffs Delta from patch set Stats (+104 lines, -10 lines) Patch
M content/browser/frame_host/frame_tree.cc View 1 2 3 1 chunk +7 lines, -8 lines 0 comments Download
M content/browser/frame_host/render_frame_host_impl.h View 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/frame_host/render_frame_host_manager.cc View 1 1 chunk +5 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.h View 1 2 2 chunks +13 lines, -0 lines 0 comments Download
M content/browser/renderer_host/render_view_host_impl.cc View 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/site_per_process_browsertest.cc View 1 2 3 4 5 6 7 8 2 chunks +77 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (5 generated)
alexmos
Nasko, can you please take a look? I went with your suggestion on tracking the ...
5 years, 3 months ago (2015-09-18 18:32:17 UTC) #2
nasko
Thanks for taking this on! I think the code itself looks good! Some comments on ...
5 years, 3 months ago (2015-09-18 19:06:17 UTC) #3
alexmos
Please take another look. PS3 addresses your comments, and PS4 fixes the UAFs due to ...
5 years, 3 months ago (2015-09-18 22:37:05 UTC) #4
alexmos
On 2015/09/18 22:37:05, alexmos wrote: > Please take another look. PS3 addresses your comments, and ...
5 years, 3 months ago (2015-09-18 22:42:46 UTC) #5
nasko
LGTM with one question. https://codereview.chromium.org/1345353003/diff/100001/content/browser/site_per_process_browsertest.cc File content/browser/site_per_process_browsertest.cc (right): https://codereview.chromium.org/1345353003/diff/100001/content/browser/site_per_process_browsertest.cc#newcode3430 content/browser/site_per_process_browsertest.cc:3430: shell()->LoadURL(a_url); This navigation doesn't wait ...
5 years, 3 months ago (2015-09-18 23:29:14 UTC) #6
alexmos
https://codereview.chromium.org/1345353003/diff/100001/content/browser/site_per_process_browsertest.cc File content/browser/site_per_process_browsertest.cc (right): https://codereview.chromium.org/1345353003/diff/100001/content/browser/site_per_process_browsertest.cc#newcode3430 content/browser/site_per_process_browsertest.cc:3430: shell()->LoadURL(a_url); On 2015/09/18 23:29:14, nasko (slow to review) wrote: ...
5 years, 3 months ago (2015-09-21 16:25:24 UTC) #7
nasko
LGTM with a nit. https://codereview.chromium.org/1345353003/diff/120001/content/browser/site_per_process_browsertest.cc File content/browser/site_per_process_browsertest.cc (right): https://codereview.chromium.org/1345353003/diff/120001/content/browser/site_per_process_browsertest.cc#newcode3428 content/browser/site_per_process_browsertest.cc:3428: TestNavigationObserver observer(shell()->web_contents()); nit: Let's add ...
5 years, 3 months ago (2015-09-21 17:07:20 UTC) #8
alexmos
Thanks! https://codereview.chromium.org/1345353003/diff/120001/content/browser/site_per_process_browsertest.cc File content/browser/site_per_process_browsertest.cc (right): https://codereview.chromium.org/1345353003/diff/120001/content/browser/site_per_process_browsertest.cc#newcode3428 content/browser/site_per_process_browsertest.cc:3428: TestNavigationObserver observer(shell()->web_contents()); On 2015/09/21 17:07:20, nasko (slow to ...
5 years, 3 months ago (2015-09-21 17:11:14 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1345353003/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1345353003/140001
5 years, 3 months ago (2015-09-21 17:12:22 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/115816)
5 years, 3 months ago (2015-09-21 18:49:40 UTC) #14
alexmos
Nasko, can you please take a look at the Mac timeout workaround in PS9?
5 years, 3 months ago (2015-09-23 21:11:05 UTC) #15
nasko
LGTM
5 years, 3 months ago (2015-09-23 21:13:05 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1345353003/160001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1345353003/160001
5 years, 3 months ago (2015-09-24 05:29:02 UTC) #18
commit-bot: I haz the power
Committed patchset #9 (id:160001)
5 years, 3 months ago (2015-09-24 07:31:36 UTC) #19
commit-bot: I haz the power
5 years, 3 months ago (2015-09-24 07:33:52 UTC) #20
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/b97d6bb6f374d80d432d74ce5c31465fa21209f7
Cr-Commit-Position: refs/heads/master@{#350489}

Powered by Google App Engine
This is Rietveld 408576698