Commit 93eb2b03 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Check removed_request_awaiting_dismissal_ as active request

When a presenting popup infobar is replaced, the request is removed
from the queue, set as removed_request_awaiting_dismissal_ in
OverlayPresenter, and UI is dismissed. But, dismissal logic is async
and resetting the request_ property of OverlayPresentationContext
requires waiting for OverlayUIWasDismissed() callback. In the meantime,
changing active WebStates causes the OverlayPresenter to ask the
OverlayPresentationContext to hide its presented request by calling
HideOverlayUI and passing the current front of the queue as the request
to hide. This is where there is a discrepancy and a DCHECK on request_
fails.

Check for removed_request_awaiting_dismissal_ before assuming the front
request is the currently presenting request.

Bug: 1120786
Change-Id: Icb25572bfcf9fb7450c2b7ce6d00eb3a3915e8e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2383011Reviewed-by: default avatarMike Dougherty <michaeldo@chromium.org>
Commit-Queue: Mike Dougherty <michaeldo@chromium.org>
Auto-Submit: Chris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803413}
parent 0d9baf06
......@@ -131,7 +131,10 @@ void OverlayPresenterImpl::SetActiveWebState(
if (active_web_state_ == web_state)
return;
OverlayRequest* previously_active_request = GetActiveRequest();
OverlayRequest* previously_active_request =
removed_request_awaiting_dismissal_ != nullptr
? removed_request_awaiting_dismissal_.get()
: GetActiveRequest();
// The UI should be cancelled instead of hidden if the presenter does not
// expect to show any more overlay UI for previously active WebState in the UI
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment