[webkit-changes] [WebKit/WebKit] f69976: 3 internal PaymentRequest tests are crashing in debug

Chris Dumez noreply at github.com
Fri Jul 7 15:53:45 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f69976c08fd705f03ff8d384f63161465f129de9
      https://github.com/WebKit/WebKit/commit/f69976c08fd705f03ff8d384f63161465f129de9
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-07-07 (Fri, 07 Jul 2023)

  Changed paths:
    M Source/WebCore/Modules/applepay/ApplePaySession.cpp
    M Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp
    M Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp
    M Source/WebCore/testing/MockPaymentCoordinator.cpp

  Log Message:
  -----------
  3 internal PaymentRequest tests are crashing in debug
https://bugs.webkit.org/show_bug.cgi?id=258988
rdar://105024815

Reviewed by Devin Rousso.

The tests in question call abort() on the PaymentRequest from unexpected places,
and our code was missing checks in several places to make sure there is still
an active payment session, causing crashes.

To address the issue, we now check if we still have an active payment session in
more places, in particular after calling functions that may run JavaScript, since
JS may abort the request at any point.

This change is covered by those 3 internal tests, which I'll unskip.

* Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::merchantValidationCompleted):
(WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
(WebCore::ApplePayPaymentHandler::retry):
* Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::abortWithException):
* Source/WebCore/testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::dispatchIfShowing):

Canonical link: https://commits.webkit.org/265867@main




More information about the webkit-changes mailing list