Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[M110] Reset navigations using swapped out pending delete RFH when un…
…loading We used to delete all navigations happening in a FrameTreeNode when a RFH in that FrameTreeNode gets into the "pending deletion" state, but with crrev.com/c/4067080 we stopped doing that for cases where the RFH is pending deletion because it got swapped out by another RFH after a navigation commits (so now we only cancel all navigations on FrameTreeNode detach). However, this might introduce problems with existing NavigationRequests that uses the swapped out RFH. Pending-commit navigations that are owned by the swapped out RFH is already deleted from RenderFrameHostManager::UnloadOldFrame(), but non-pending-commit navigations that point to the swapped out RFH might still be around. When the non-pending-commit navigation tries to access the RFH (which is possible from e.g. NavigationThrottles running OnWillProcessResponse method), the RFH might already be deleted, causing a use-after-free. This CL makes it so that we also delete non-pending-commit navigations owned by the FrameTreeNode if it points to the swapped out RFH. We will also delete all navigations happening in child frames of the swapped out RFH, as those frames will be detached and deleted. Note that this is not a full revert of crrev.com/c/4067080, because we will only delete the navigations that are using the swapped out RFH, and not navigations that use other RFHs. (cherry picked from commit 7f10cfd) Bug: 1401933 Change-Id: I94fc25a4643ea0508783064a2feb615fe7c748c4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4122380 Commit-Queue: Rakina Zata Amni <rakina@chromium.org> Reviewed-by: Nasko Oskov <nasko@chromium.org> Cr-Original-Commit-Position: refs/heads/main@{#1087482} Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4127320 Auto-Submit: Rakina Zata Amni <rakina@chromium.org> Commit-Queue: Nasko Oskov <nasko@chromium.org> Cr-Commit-Position: refs/branch-heads/5481@{#99} Cr-Branched-From: 130f3e4-refs/heads/main@{#1084008}
- Loading branch information