Commit bd157bae authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Move presenting_ DCHECK to after presentation context checks

It is no longer true that presenting_ will always be false when
PresentOverlayForActiveRequest is called. This can occur if the
current active request is dismissed by being removed from the queue
and adds another overlay in its completion callback. Instead, the
DCHECK can be moved after the OverlayPresentationContext checks,
which should be enough to early return when an overlay is already
being presented.

Bug: 1114547
Change-Id: I1756df163dfb10e96537449491d0cfc5295c4aed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2360376
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Auto-Submit: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarMike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#799195}
parent e9cef07a
...@@ -195,8 +195,6 @@ OverlayRequest* OverlayPresenterImpl::GetActiveRequest() const { ...@@ -195,8 +195,6 @@ OverlayRequest* OverlayPresenterImpl::GetActiveRequest() const {
#pragma mark UI Presentation and Dismissal helpers #pragma mark UI Presentation and Dismissal helpers
void OverlayPresenterImpl::PresentOverlayForActiveRequest() { void OverlayPresenterImpl::PresentOverlayForActiveRequest() {
// Overlays cannot be presented if one is already presented.
DCHECK(!presenting_);
// Overlays cannot be shown without a presentation context or if the // Overlays cannot be shown without a presentation context or if the
// presentation context is already showing overlay UI. // presentation context is already showing overlay UI.
...@@ -215,6 +213,9 @@ void OverlayPresenterImpl::PresentOverlayForActiveRequest() { ...@@ -215,6 +213,9 @@ void OverlayPresenterImpl::PresentOverlayForActiveRequest() {
return; return;
} }
// If an overlay is already presented, the Presentation Context should be
// marked as showing an Overlay.
DCHECK(!presenting_);
presenting_ = true; presenting_ = true;
presented_request_ = request; presented_request_ = request;
......
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