Title: [264058] trunk/Source/WebCore
Revision
264058
Author
[email protected]
Date
2020-07-07 20:21:59 -0700 (Tue, 07 Jul 2020)

Log Message

[Apple Pay] Fix the build on Catalina internal SDKs
https://bugs.webkit.org/show_bug.cgi?id=214066

Unreviewed build fix for the 10.15.0 Internal SDK.


Source/WebCore:

* Modules/applepay/ApplePaySetupFeature.mm:
(WebCore::ApplePaySetupFeature::supportsInstallments const):

Source/WebCore/PAL:

* pal/spi/cocoa/PassKitInstallmentsSPI.h:
* pal/spi/cocoa/PassKitSPI.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (264057 => 264058)


--- trunk/Source/WebCore/ChangeLog	2020-07-08 03:18:55 UTC (rev 264057)
+++ trunk/Source/WebCore/ChangeLog	2020-07-08 03:21:59 UTC (rev 264058)
@@ -1,3 +1,13 @@
+2020-07-07  Andy Estes  <[email protected]>
+
+        [Apple Pay] Fix the build on Catalina internal SDKs
+        https://bugs.webkit.org/show_bug.cgi?id=214066
+
+        Unreviewed build fix for the 10.15.0 Internal SDK.
+
+        * Modules/applepay/ApplePaySetupFeature.mm:
+        (WebCore::ApplePaySetupFeature::supportsInstallments const):
+
 2020-07-07  Alex Christensen  <[email protected]>
 
         Allow WebCoreNSURLSession sendH2Ping:pongHandler: to be called from any thread like the rest of WebCoreNSURLSession methods

Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeature.mm (264057 => 264058)


--- trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeature.mm	2020-07-08 03:18:55 UTC (rev 264057)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySetupFeature.mm	2020-07-08 03:21:59 UTC (rev 264058)
@@ -66,6 +66,10 @@
 #if ENABLE(APPLE_PAY_INSTALLMENTS)
 bool ApplePaySetupFeature::supportsInstallments() const
 {
+#if PLATFORM(MAC)
+    if (![m_feature respondsToSelector:@selector(supportedOptions)])
+        return false;
+#endif
     return [m_feature supportedOptions] & PKPaymentSetupFeatureSupportedOptionsInstallments;
 }
 #endif

Modified: trunk/Source/WebCore/PAL/ChangeLog (264057 => 264058)


--- trunk/Source/WebCore/PAL/ChangeLog	2020-07-08 03:18:55 UTC (rev 264057)
+++ trunk/Source/WebCore/PAL/ChangeLog	2020-07-08 03:21:59 UTC (rev 264058)
@@ -1,3 +1,13 @@
+2020-07-07  Andy Estes  <[email protected]>
+
+        [Apple Pay] Fix the build on Catalina internal SDKs
+        https://bugs.webkit.org/show_bug.cgi?id=214066
+
+        Unreviewed build fix for the 10.15.0 Internal SDK.
+
+        * pal/spi/cocoa/PassKitInstallmentsSPI.h:
+        * pal/spi/cocoa/PassKitSPI.h:
+
 2020-07-07  Tim Horton  <[email protected]>
 
         <attachment> layout does not scale with Dynamic Type size changes

Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitInstallmentsSPI.h (264057 => 264058)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitInstallmentsSPI.h	2020-07-08 03:18:55 UTC (rev 264057)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitInstallmentsSPI.h	2020-07-08 03:21:59 UTC (rev 264058)
@@ -102,4 +102,23 @@
 @property (nonatomic, copy) NSString *installmentGroupIdentifier;
 @end
 
+// FIXME: The SPIs above can be declared by WebKit without causing redeclaration errors on Catalina
+// internal SDKs because we can avoid including the SPIs' private headers from PassKit, but we can't
+// avoid importing PKPaymentSetupFeature.h due to how many other private headers include it. To avoid
+// redeclaration errors while continuing to support all Catalina SDKs, declare -supportedOptions
+// only when building against an internal SDK without PKPaymentInstallmentConfiguration.h (so that we
+// can implement a -respondsToSelector: check). The __has_include portion of this check can be
+// removed once the minimum supported Catalina internal SDK is known to contain this private header.
+#if !USE(APPLE_INTERNAL_SDK) || !__has_include(<PassKitCore/PKPaymentInstallmentConfiguration.h>)
+
+typedef NS_OPTIONS(NSInteger, PKPaymentSetupFeatureSupportedOptions) {
+    PKPaymentSetupFeatureSupportedOptionsInstallments = 1 << 0,
+};
+
+@interface PKPaymentSetupFeature ()
+@property (nonatomic, assign, readonly) PKPaymentSetupFeatureSupportedOptions supportedOptions;
+@end
+
+#endif
+
 #endif // HAVE(PASSKIT_INSTALLMENTS)

Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h (264057 => 264058)


--- trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h	2020-07-08 03:18:55 UTC (rev 264057)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h	2020-07-08 03:21:59 UTC (rev 264058)
@@ -301,11 +301,6 @@
     PKPaymentSetupFeatureTypeApplePay_X API_DEPRECATED_WITH_REPLACEMENT("PKPaymentSetupFeatureTypeAppleCard", ios(12.3, 12.3), macos(10.14.5, 10.14.5)) = PKPaymentSetupFeatureTypeAppleCard,
 };
 
-typedef NS_OPTIONS(NSInteger, PKPaymentSetupFeatureSupportedOptions) {
-    PKPaymentSetupFeatureSupportedOptionsNone = 0,
-    PKPaymentSetupFeatureSupportedOptionsInstallments = 1 << 0,
-};
-
 @interface PKPaymentSetupConfiguration : NSObject <NSSecureCoding>
 @property (nonatomic, copy) NSString *referrerIdentifier;
 @end
@@ -325,7 +320,6 @@
 @interface PKPaymentSetupFeature : NSObject <NSSecureCoding, NSCopying>
 @property (nonatomic, assign, readonly) PKPaymentSetupFeatureType type;
 @property (nonatomic, assign, readonly) PKPaymentSetupFeatureState state;
-@property (nonatomic, assign, readonly) PKPaymentSetupFeatureSupportedOptions supportedOptions;
 @end
 
 @interface PKPaymentSetupRequest : NSObject <NSSecureCoding>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to