• Nick Burris's avatar
    Fix DCHECK in PaymentAppProviderImpl::SetOpenedWindow · 0c22e779
    Nick Burris authored
    The PaymentAppProviderImpl's web contents is not always closed via
    PaymentAppProviderImpl::CloseOpenedWindow, e.g. when the bottom sheet UI
    is closed the web contents is destroyed. If the PaymentAppProviderImpl
    instance then reopens a web contents, we hit the DCHECK in
    SetOpenedWindow.
    
    This patch properly resets the payment_handler_window_ pointer even if
    the web contents is already closed. Ideally the bottom sheet UI code
    should close the web contents via CloseOpenedWindow(), but we don't
    currently have any other logic in here so the issue is minimal. This
    temporary fix is worthwhile as we often hit this in manual testing.
    
    Bug: 1099270
    Change-Id: I377406f385f2250073dacd6b750a948019cea3f5
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2269792Reviewed-by: default avatarLiquan (Max) Gu <maxlg@chromium.org>
    Commit-Queue: Nick Burris <nburris@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#784150}
    0c22e779
payment_app_provider_impl.cc 41.6 KB