Skip to content

Commit 3b79a52

Browse files
committed
Unreviewed, fix regression from r273194 that was spotted by Darin Adler after landing.
* Platform/cocoa/WKPaymentAuthorizationDelegate.mm: (-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]): (-[WKPaymentAuthorizationDelegate completeShippingContactSelection:]): (-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]): Canonical link: https://commits.webkit.org/234387@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@273201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent b54a2a2 commit 3b79a52

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

Source/WebKit/ChangeLog

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
2021-02-20 Chris Dumez <cdumez@apple.com>
2+
3+
Unreviewed, fix regression from r273194 that was spotted by Darin Adler after landing.
4+
5+
* Platform/cocoa/WKPaymentAuthorizationDelegate.mm:
6+
(-[WKPaymentAuthorizationDelegate completePaymentMethodSelection:]):
7+
(-[WKPaymentAuthorizationDelegate completeShippingContactSelection:]):
8+
(-[WKPaymentAuthorizationDelegate completeShippingMethodSelection:]):
9+
110
2021-02-19 Chris Dumez <cdumez@apple.com>
211

312
Crash under Decoder::Decoder()

Source/WebKit/Platform/cocoa/WKPaymentAuthorizationDelegate.mm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ - (void)completeMerchantValidation:(PKPaymentMerchantSession *)session error:(NS
6969

7070
- (void)completePaymentMethodSelection:(PKPaymentRequestPaymentMethodUpdate *)paymentMethodUpdate
7171
{
72-
auto update = !paymentMethodUpdate ? adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:_summaryItems.get()]) : nil;
72+
auto update = paymentMethodUpdate ? retainPtr(paymentMethodUpdate) : adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:_summaryItems.get()]);
7373
_summaryItems = adoptNS([[update paymentSummaryItems] copy]);
7474
std::exchange(_didSelectPaymentMethodCompletion, nil)(update.get());
7575
}
@@ -81,15 +81,15 @@ - (void)completePaymentSession:(PKPaymentAuthorizationStatus)status errors:(NSAr
8181
}
8282
- (void)completeShippingContactSelection:(PKPaymentRequestShippingContactUpdate *)shippingContactUpdate
8383
{
84-
auto update = !shippingContactUpdate ? adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[] paymentSummaryItems:_summaryItems.get() shippingMethods:_shippingMethods.get()]) : nil;
84+
auto update = shippingContactUpdate ? retainPtr(shippingContactUpdate) : adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[] paymentSummaryItems:_summaryItems.get() shippingMethods:_shippingMethods.get()]);
8585
_summaryItems = adoptNS([[update paymentSummaryItems] copy]);
8686
_shippingMethods = adoptNS([[update shippingMethods] copy]);
8787
std::exchange(_didSelectShippingContactCompletion, nil)(update.get());
8888
}
8989

9090
- (void)completeShippingMethodSelection:(PKPaymentRequestShippingMethodUpdate *)shippingMethodUpdate
9191
{
92-
auto update = !shippingMethodUpdate ? adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:_summaryItems.get()]) : nil;
92+
auto update = shippingMethodUpdate ? retainPtr(shippingMethodUpdate) : adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:_summaryItems.get()]);
9393
_summaryItems = adoptNS([[update paymentSummaryItems] copy]);
9494
std::exchange(_didSelectShippingMethodCompletion, nil)(update.get());
9595
}

0 commit comments

Comments
 (0)