[webkit-changes] [WebKit/WebKit] 337620: REGRESSION(285507 at main): [ macOS iOS Debug ] ASSER...
Chris Dumez
noreply at github.com
Thu Oct 24 09:41:19 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3376205b5d9b7ccf64b938731f37a9f086406b15
https://github.com/WebKit/WebKit/commit/3376205b5d9b7ccf64b938731f37a9f086406b15
Author: Chris Dumez <cdumez at apple.com>
Date: 2024-10-24 (Thu, 24 Oct 2024)
Changed paths:
M LayoutTests/platform/mac-wk2/TestExpectations
M Source/WebCore/testing/MockPaymentCoordinator.cpp
M Source/WebCore/testing/MockPaymentCoordinator.h
Log Message:
-----------
REGRESSION(285507 at main): [ macOS iOS Debug ] ASSERTION FAILED: showCount == hideCount in virtual WebCore::MockPaymentCoordinator result of crash in ApplePay
https://bugs.webkit.org/show_bug.cgi?id=282003
rdar://138506302
Reviewed by Per Arne Vollan.
In 285507 at main, MockPaymentCoordinator was made ref-counted, which means its
lifetime can now get extended. This means that when a MockPaymentCoordinator
get replaced with another, 2 MockPaymentCoordinator instance can be alive at
the same time, temporarily.
The assertion in the MockPaymentCoordinator destructor checks that the
coordinator has shown as many dialogs as it has hidden. However, this check
relies on global static variables. This used to work fine when only one
MockPaymentCoordinator could be alive at the same time. However, now that
this is no longer true, the assertion can be hit because a new MockPaymentCoordinator
instance may have shown a dialog before the previous MockPaymentCoordinator
got a chance to get destroyed.
To address the issue, I converted this global variables into data members.
* LayoutTests/platform/mac-wk2/TestExpectations:
* Source/WebCore/testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::~MockPaymentCoordinator):
(WebCore::MockPaymentCoordinator::dispatchIfShowing):
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::cancelPayment):
(WebCore::MockPaymentCoordinator::completePaymentSession):
(WebCore::MockPaymentCoordinator::abortPaymentSession):
(WebCore::MockPaymentCoordinator::cancelPaymentSession):
* Source/WebCore/testing/MockPaymentCoordinator.h:
Canonical link: https://commits.webkit.org/285653@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list