Changeset 285898 in webkit
- Timestamp:
- Nov 16, 2021, 4:30:29 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Modules/applepay/ApplePaySetupFeature.mm (modified) (2 diffs)
-
WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h (modified) (1 diff)
-
WebCore/Modules/applepay/PaymentInstallmentConfiguration.mm (modified) (3 diffs)
-
WebCore/PAL/ChangeLog (modified) (1 diff)
-
WebCore/PAL/pal/spi/cocoa/PassKitSPI.h (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Shared/ApplePay/ApplePayPaymentSetupFeatures.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r285893 r285898 1 2021-11-16 Devin Rousso <drousso@apple.com> 2 3 [Apple Pay] handle unknown setup features 4 https://bugs.webkit.org/show_bug.cgi?id=233212 5 6 Reviewed by Wenson Hsieh. 7 8 * Modules/applepay/ApplePaySetupFeatureWebCore.h: 9 * Modules/applepay/ApplePaySetupFeature.mm: 10 (WebCore::ApplePaySetupFeature::supportsFeature): Added. 11 (WebCore::ApplePaySetupFeature::type const): 12 13 * Modules/applepay/PaymentInstallmentConfiguration.mm: 14 (WebCore::applePaySetupFeatureType): 15 (WebCore::platformFeatureType): 16 (WebCore::PaymentInstallmentConfiguration::applePayInstallmentConfiguration const): 17 If the `PKPaymentSetupFeatureType` is unknown/unsupported, return an empty `ApplePayInstallmentConfiguration`. 18 Drive-by: Replace all `PKPaymentSetupFeatureTypeApplePay_X` with `PKPaymentSetupFeatureTypeAppleCard`. 19 1 20 2021-11-16 Nikolaos Mouchtaris <nmouchtaris@apple.com> 2 21 -
trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeature.mm
r264058 r285898 35 35 namespace WebCore { 36 36 37 bool ApplePaySetupFeature::supportsFeature(PKPaymentSetupFeature *feature) 38 { 39 switch (feature.type) { 40 case PKPaymentSetupFeatureTypeApplePay: 41 case PKPaymentSetupFeatureTypeAppleCard: 42 return true; 43 44 default: 45 return false; 46 } 47 } 48 37 49 ApplePaySetupFeature::ApplePaySetupFeature() = default; 38 50 ApplePaySetupFeature::~ApplePaySetupFeature() = default; … … 43 55 case PKPaymentSetupFeatureTypeApplePay: 44 56 return ApplePaySetupFeatureType::ApplePay; 45 ALLOW_DEPRECATED_DECLARATIONS_BEGIN 46 case PKPaymentSetupFeatureTypeApplePay_X: 47 ALLOW_DEPRECATED_DECLARATIONS_END 57 58 case PKPaymentSetupFeatureTypeAppleCard: 48 59 return ApplePaySetupFeatureType::AppleCard; 60 61 default: 62 ASSERT(!supportsFeature(m_feature.get())); 63 return ApplePaySetupFeatureType::ApplePay; 49 64 } 50 65 } -
trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h
r262714 r285898 44 44 return adoptRef(*new ApplePaySetupFeature(feature)); 45 45 } 46 47 WEBCORE_EXPORT static bool supportsFeature(PKPaymentSetupFeature *); 46 48 47 49 WEBCORE_EXPORT virtual ~ApplePaySetupFeature(); -
trunk/Source/WebCore/Modules/applepay/PaymentInstallmentConfiguration.mm
r282844 r285898 58 58 } 59 59 60 static ApplePaySetupFeatureTypeapplePaySetupFeatureType(PKPaymentSetupFeatureType featureType)60 static std::optional<ApplePaySetupFeatureType> applePaySetupFeatureType(PKPaymentSetupFeatureType featureType) 61 61 { 62 62 switch (featureType) { 63 63 case PKPaymentSetupFeatureTypeApplePay: 64 64 return ApplePaySetupFeatureType::ApplePay; 65 ALLOW_DEPRECATED_DECLARATIONS_BEGIN 66 case PKPaymentSetupFeatureTypeApplePay_X: 67 ALLOW_DEPRECATED_DECLARATIONS_END 65 66 case PKPaymentSetupFeatureTypeAppleCard: 68 67 return ApplePaySetupFeatureType::AppleCard; 68 69 default: 70 ASSERT_NOT_REACHED(); 71 return std::nullopt; 69 72 } 70 73 } … … 76 79 return PKPaymentSetupFeatureTypeApplePay; 77 80 case ApplePaySetupFeatureType::AppleCard: 78 ALLOW_DEPRECATED_DECLARATIONS_BEGIN 79 return PKPaymentSetupFeatureTypeApplePay_X; 80 ALLOW_DEPRECATED_DECLARATIONS_END 81 return PKPaymentSetupFeatureTypeAppleCard; 81 82 } 82 83 } … … 234 235 return installmentConfiguration; 235 236 236 installmentConfiguration.featureType = applePaySetupFeatureType([m_configuration feature]); 237 if (auto featureType = applePaySetupFeatureType([m_configuration feature])) 238 installmentConfiguration.featureType = *featureType; 239 else 240 return installmentConfiguration; 237 241 238 242 installmentConfiguration.bindingTotalAmount = fromDecimalNumber([m_configuration bindingTotalAmount]); -
trunk/Source/WebCore/PAL/ChangeLog
r285881 r285898 1 2021-11-16 Devin Rousso <drousso@apple.com> 2 3 [Apple Pay] handle unknown setup features 4 https://bugs.webkit.org/show_bug.cgi?id=233212 5 6 Reviewed by Wenson Hsieh. 7 8 * pal/spi/cocoa/PassKitSPI.h: 9 Drive-by: Replace all `PKPaymentSetupFeatureTypeApplePay_X` with `PKPaymentSetupFeatureTypeAppleCard`. 10 1 11 2021-11-16 Myles C. Maxfield <mmaxfield@apple.com> 2 12 -
trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h
r285521 r285898 369 369 PKPaymentSetupFeatureTypeApplePay, 370 370 PKPaymentSetupFeatureTypeAppleCard, 371 PKPaymentSetupFeatureTypeApplePay_X API_DEPRECATED_WITH_REPLACEMENT("PKPaymentSetupFeatureTypeAppleCard", ios(12.3, 12.3), macos(10.14.5, 10.14.5)) = PKPaymentSetupFeatureTypeAppleCard,372 371 }; 373 372 -
trunk/Source/WebKit/ChangeLog
r285893 r285898 1 2021-11-16 Devin Rousso <drousso@apple.com> 2 3 [Apple Pay] handle unknown setup features 4 https://bugs.webkit.org/show_bug.cgi?id=233212 5 6 Reviewed by Wenson Hsieh. 7 8 * Shared/ApplePay/ApplePayPaymentSetupFeatures.mm: 9 (WebKit::PaymentSetupFeatures::operator Vector<Ref<WebCore::ApplePaySetupFeature>> const): 10 Skip `PKPaymentSetupFeature` that have an unknown `PKPaymentSetupFeatureType`. This ensures 11 that `WebCore::ApplePaySetupFeature` will only ever be created with known/supported `PKPaymentSetupFeatureType`. 12 1 13 2021-11-16 Nikolaos Mouchtaris <nmouchtaris@apple.com> 2 14 -
trunk/Source/WebKit/Shared/ApplePay/ApplePayPaymentSetupFeatures.mm
r278253 r285898 86 86 Vector<Ref<WebCore::ApplePaySetupFeature>> features; 87 87 features.reserveInitialCapacity([m_platformFeatures count]); 88 for (PKPaymentSetupFeature *platformFeature in m_platformFeatures.get()) 89 features.uncheckedAppend(WebCore::ApplePaySetupFeature::create(platformFeature)); 88 for (PKPaymentSetupFeature *platformFeature in m_platformFeatures.get()) { 89 if (WebCore::ApplePaySetupFeature::supportsFeature(platformFeature)) 90 features.uncheckedAppend(WebCore::ApplePaySetupFeature::create(platformFeature)); 91 } 90 92 return features; 91 93 }
Note:
See TracChangeset
for help on using the changeset viewer.