[Portals] Disallow activation during unload
This CL makes it so that portal activation is blocked when the document enters a beforeunload handler. If the unload proceeds, portal activation will continue to be blocked This must be implemented inside the renderer as the renderer can initiate navigations which the browser won't hear about until after beforeunload is confirmed. We do this by looking at the Document's LoadEventProgress state. Unfortunately, the current behavior is that, following a beforeunload, this state would progress unconditionally to kBeforeUnloadEventCompleted. This prevents us from distinguishing the case where the navigation is canceled, which should once again allow portal activation. This CL updates this state to only progress to the (renamed for consistency and clarity) kBeforeUnloadEventCompleted state only after we confirm the unload will proceed. Bug: 1043764 Change-Id: I80363ccf2228e3dc5434486c95c62c17e00743aa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2251104 Commit-Queue: David Bokan <bokan@chromium.org> Reviewed-by:Jeremy Roman <jbroman@chromium.org> Cr-Commit-Position: refs/heads/master@{#780470}
Showing
Please register or sign in to comment