PM: Fix invalid access to DocumentResourceCoordinator on freeze.
Currently, LocalFrame::DidFreeze performs these steps: 1. Obtain the DocumentResourceCoordinator. 2. Dispatch the beforeunload event. 3. Invoke SetHasNonEmptyBeforeUnload on the DocumentResourceCoordinator. However, it is believed* that dispatching the beforeunload event can invalidate the DocumentResourceCoordinator (by shutting down the document), which causes an invalid access at step 3. With this CL, the latest DocumentResourceCoordinator is obtained just before calling SetHasNonEmptyBeforeUnload. *Ideally, a Blink expert could confirm if that's a reasonable assumption. Bug: 991380 Change-Id: Ie542b34a67900d427fbdc720f0d362522eba5da2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1749531Reviewed-by:Kentaro Hara <haraken@chromium.org> Commit-Queue: François Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#686587}
Showing
Please register or sign in to comment