Bugfix: beforeunload starts navigation during webcontent destructor.
Fix https://crbug.com/1147567 and add a regression test. This is meant to be merged back into M88 beta. No new navigations should start in a non current frame. There is a DCHECK and a DumpWithoutCrashing. It was triggered in M88. What happened: - Start with nested documents: A(B(C)). - C adds a beforeunload handler. - B starts a navigation, waiting for C. - The WebContents is closed, deleting C, then B, and then A. By deleting C, the navigations in B can begin, but this happen in the middle of destructing B. This is fixed by putting the code responsible for continuing the navigation in a new task. This is indeed the current behavior for the second part of the "if" already. This patch just generalize it to both clauses. A lot of things can be done to improve the architecture here, but this patch is meant to be merged into M88, so it should stay short to minimize the change. Bug: 1147567 Fixed: 1147567 Change-Id: I980c7da56b9f02b2644ebcb9a9401637848d9c34 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2544967Reviewed-by:Camille Lamy <clamy@chromium.org> Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org> Cr-Commit-Position: refs/heads/master@{#829166}
Showing
Please register or sign in to comment