Diff
Modified: trunk/Source/WTF/ChangeLog (238433 => 238434)
--- trunk/Source/WTF/ChangeLog 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WTF/ChangeLog 2018-11-22 02:12:04 UTC (rev 238434)
@@ -1,3 +1,16 @@
+2018-11-21 Andy Estes <[email protected]>
+
+ [Cocoa] Create a soft-linking file for PassKit
+ https://bugs.webkit.org/show_bug.cgi?id=191875
+ <rdar://problem/46203215>
+
+ Reviewed by Myles Maxfield.
+
+ * wtf/Platform.h: Defined USE_PASSKIT.
+ * wtf/cocoa/SoftLinking.h: Added _WITH_EXPORT variants of SOFT_LINK_FRAMEWORK_FOR_SOURCE,
+ SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE, SOFT_LINK_CLASS_FOR_SOURCE,
+ SOFT_LINK_FUNCTION_FOR_SOURCE, and SOFT_LINK_CONSTANT_FOR_SOURCE.
+
2018-11-21 Dominik Infuehr <[email protected]>
Enable JIT on ARM/Linux
Modified: trunk/Source/WTF/wtf/Platform.h (238433 => 238434)
--- trunk/Source/WTF/wtf/Platform.h 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WTF/wtf/Platform.h 2018-11-22 02:12:04 UTC (rev 238434)
@@ -616,9 +616,10 @@
#if PLATFORM(MAC)
-#define USE_APPKIT 1
#define HAVE_RUNLOOP_TIMER 1
#define HAVE_SEC_KEYCHAIN 1
+#define USE_APPKIT 1
+#define USE_PASSKIT 1
#if CPU(X86_64)
#define HAVE_NETWORK_EXTENSION 1
@@ -1060,9 +1061,10 @@
#endif
#if PLATFORM(IOS)
+#define HAVE_APP_LINKS 1
+#define USE_PASSKIT 1
#define USE_QUICK_LOOK 1
#define USE_SYSTEM_PREVIEW 1
-#define HAVE_APP_LINKS 1
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(IOSMAC)
Modified: trunk/Source/WTF/wtf/cocoa/SoftLinking.h (238433 => 238434)
--- trunk/Source/WTF/wtf/cocoa/SoftLinking.h 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WTF/wtf/cocoa/SoftLinking.h 2018-11-22 02:12:04 UTC (rev 238434)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007, 2008, 2011-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -340,9 +340,9 @@
} \
}
-#define SOFT_LINK_FRAMEWORK_FOR_SOURCE(functionNamespace, framework) \
+#define SOFT_LINK_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, export) \
namespace functionNamespace { \
- void* framework##Library(bool isOptional = false); \
+ export void* framework##Library(bool isOptional = false); \
void* framework##Library(bool isOptional) \
{ \
static void* frameworkLibrary; \
@@ -356,9 +356,12 @@
} \
}
-#define SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(functionNamespace, framework) \
+#define SOFT_LINK_FRAMEWORK_FOR_SOURCE(functionNamespace, framework) \
+ SOFT_LINK_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, )
+
+#define SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, export) \
namespace functionNamespace { \
- void* framework##Library(bool isOptional = false); \
+ export void* framework##Library(bool isOptional = false); \
void* framework##Library(bool isOptional) \
{ \
static void* frameworkLibrary; \
@@ -372,6 +375,9 @@
} \
}
+#define SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(functionNamespace, framework) \
+ SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, )
+
#define SOFT_LINK_CLASS_FOR_HEADER(functionNamespace, framework, className) \
@class className; \
namespace functionNamespace { \
@@ -383,11 +389,11 @@
} \
}
-#define SOFT_LINK_CLASS_FOR_SOURCE(functionNamespace, framework, className) \
+#define SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, className, export) \
@class className; \
namespace functionNamespace { \
static Class init##className(); \
- Class (*get_##framework##_##className##Class)() = init##className; \
+ export Class (*get_##framework##_##className##Class)() = init##className; \
static Class class##className; \
\
static Class className##Function() \
@@ -408,6 +414,9 @@
} \
}
+#define SOFT_LINK_CLASS_FOR_SOURCE(functionNamespace, framework, className) \
+ SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, className, )
+
#define SOFT_LINK_CONSTANT_FOR_HEADER(functionNamespace, framework, variableName, variableType) \
WTF_EXTERN_C_BEGIN \
extern const variableType variableName; \
@@ -416,12 +425,12 @@
variableType get_##framework##_##variableName(); \
}
-#define SOFT_LINK_CONSTANT_FOR_SOURCE(functionNamespace, framework, variableName, variableType) \
+#define SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, variableName, variableType, export) \
WTF_EXTERN_C_BEGIN \
extern const variableType variableName; \
WTF_EXTERN_C_END \
namespace functionNamespace { \
- variableType get_##framework##_##variableName(); \
+ export variableType get_##framework##_##variableName(); \
variableType get_##framework##_##variableName() \
{ \
static variableType constant##framework##variableName; \
@@ -435,6 +444,9 @@
} \
}
+#define SOFT_LINK_CONSTANT_FOR_SOURCE(functionNamespace, framework, variableName, variableType) \
+ SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, variableName, variableType, )
+
#define SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(functionNamespace, framework, variableName, variableType) \
WTF_EXTERN_C_BEGIN \
extern const variableType variableName; \
@@ -489,13 +501,13 @@
return functionNamespace::softLink##framework##functionName parameterNames; \
}
-#define SOFT_LINK_FUNCTION_FOR_SOURCE(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \
+#define SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames, export) \
WTF_EXTERN_C_BEGIN \
resultType functionName parameterDeclarations; \
WTF_EXTERN_C_END \
namespace functionNamespace { \
static resultType init##framework##functionName parameterDeclarations; \
- resultType (*softLink##framework##functionName) parameterDeclarations = init##framework##functionName; \
+ export resultType(*softLink##framework##functionName) parameterDeclarations = init##framework##functionName; \
static resultType init##framework##functionName parameterDeclarations \
{ \
static dispatch_once_t once; \
@@ -507,6 +519,9 @@
} \
}
+#define SOFT_LINK_FUNCTION_FOR_SOURCE(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \
+ SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames, )
+
#define SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \
WTF_EXTERN_C_BEGIN \
resultType functionName parameterDeclarations; \
Modified: trunk/Source/WebCore/ChangeLog (238433 => 238434)
--- trunk/Source/WebCore/ChangeLog 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebCore/ChangeLog 2018-11-22 02:12:04 UTC (rev 238434)
@@ -1,3 +1,17 @@
+2018-11-21 Andy Estes <[email protected]>
+
+ [Cocoa] Create a soft-linking file for PassKit
+ https://bugs.webkit.org/show_bug.cgi?id=191875
+ <rdar://problem/46203215>
+
+ Reviewed by Myles Maxfield.
+
+ * Modules/applepay/cocoa/PaymentContactCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
+ * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm: Ditto.
+ * SourcesCocoa.txt: Removed @no-unify from PaymentMerchantSessionCocoa.mm.
+ * WebCore.xcodeproj/project.pbxproj: Removed PaymentMerchantSessionCocoa.mm from the WebCore target.
+ * rendering/RenderThemeCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
+
2018-11-21 Zalan Bujtas <[email protected]>
[LFC] LayoutState should always be initialized with the initial containing block.
Modified: trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm (238433 => 238434)
--- trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm 2018-11-22 02:12:04 UTC (rev 238434)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -30,7 +30,7 @@
#import "ApplePayPaymentContact.h"
#import <Contacts/Contacts.h>
-#import <pal/spi/cocoa/PassKitSPI.h>
+#import <pal/cocoa/PassKitSoftLink.h>
#import <wtf/SoftLinking.h>
#import <wtf/text/StringBuilder.h>
@@ -38,14 +38,6 @@
SOFT_LINK_CLASS(Contacts, CNMutablePostalAddress)
SOFT_LINK_CLASS(Contacts, CNPhoneNumber)
-#if PLATFORM(MAC)
-SOFT_LINK_PRIVATE_FRAMEWORK(PassKit)
-#else
-SOFT_LINK_FRAMEWORK(PassKit)
-#endif
-
-SOFT_LINK_CLASS(PassKit, PKContact)
-
namespace WebCore {
static NSString *subLocality(CNPostalAddress *address)
@@ -106,7 +98,7 @@
static RetainPtr<PKContact> convert(unsigned version, const ApplePayPaymentContact& contact)
{
- auto result = adoptNS([allocPKContactInstance() init]);
+ auto result = adoptNS([PAL::allocPKContactInstance() init]);
NSString *familyName = nil;
NSString *phoneticFamilyName = nil;
Modified: trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm (238433 => 238434)
--- trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm 2018-11-22 02:12:04 UTC (rev 238434)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -29,17 +29,8 @@
#if ENABLE(APPLE_PAY)
#import <_javascript_Core/JSONObject.h>
-#import <pal/spi/cocoa/PassKitSPI.h>
-#import <wtf/SoftLinking.h>
+#import <pal/cocoa/PassKitSoftLink.h>
-#if PLATFORM(MAC)
-SOFT_LINK_PRIVATE_FRAMEWORK(PassKit)
-#else
-SOFT_LINK_FRAMEWORK(PassKit)
-#endif
-
-SOFT_LINK_CLASS(PassKit, PKPaymentMerchantSession)
-
namespace WebCore {
std::optional<PaymentMerchantSession> PaymentMerchantSession::fromJS(JSC::ExecState& state, JSC::JSValue value, String&)
@@ -53,7 +44,7 @@
if (!dictionary || ![dictionary isKindOfClass:[NSDictionary class]])
return std::nullopt;
- auto pkPaymentMerchantSession = adoptNS([allocPKPaymentMerchantSessionInstance() initWithDictionary:dictionary]);
+ auto pkPaymentMerchantSession = adoptNS([PAL::allocPKPaymentMerchantSessionInstance() initWithDictionary:dictionary]);
return PaymentMerchantSession(pkPaymentMerchantSession.get());
}
Modified: trunk/Source/WebCore/PAL/ChangeLog (238433 => 238434)
--- trunk/Source/WebCore/PAL/ChangeLog 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebCore/PAL/ChangeLog 2018-11-22 02:12:04 UTC (rev 238434)
@@ -1,3 +1,18 @@
+2018-11-21 Andy Estes <[email protected]>
+
+ [Cocoa] Create a soft-linking file for PassKit
+ https://bugs.webkit.org/show_bug.cgi?id=191875
+ <rdar://problem/46203215>
+
+ Reviewed by Myles Maxfield.
+
+ * PAL.xcodeproj/project.pbxproj:
+ * pal/PlatformMac.cmake:
+ * pal/cocoa/PassKitSoftLink.h: Added.
+ * pal/cocoa/PassKitSoftLink.mm: Added. Used _WITH_EXPORT soft-linking macros in order to
+ make the PAL soft-linking symbols visible to WebKit.
+ * pal/spi/cocoa/PassKitSPI.h:
+
2018-11-17 Wenson Hsieh <[email protected]>
[iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes
Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (238433 => 238434)
--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj 2018-11-22 02:12:04 UTC (rev 238434)
@@ -131,6 +131,8 @@
A1175B581F6B470500C4B9F0 /* DefaultSearchProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1175B561F6B470500C4B9F0 /* DefaultSearchProvider.cpp */; };
A1175B5A1F6B4A8400C4B9F0 /* NSScrollViewSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B591F6B4A8400C4B9F0 /* NSScrollViewSPI.h */; };
A1F55DCF1F5528EC00EDB75F /* MetadataSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F55DCE1F5528EC00EDB75F /* MetadataSPI.h */; };
+ A1F63C9F21A4DBF7006FB43B /* PassKitSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F63C9D21A4DBF7006FB43B /* PassKitSoftLink.h */; };
+ A1F63CA021A4DBF7006FB43B /* PassKitSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1F63C9E21A4DBF7006FB43B /* PassKitSoftLink.mm */; };
A30D41211F0DD0EA00B71954 /* KillRing.h in Headers */ = {isa = PBXBuildFile; fileRef = A30D411E1F0DD0EA00B71954 /* KillRing.h */; };
A30D41221F0DD0EA00B71954 /* KillRing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A30D411F1F0DD0EA00B71954 /* KillRing.cpp */; };
A30D41251F0DD12D00B71954 /* KillRingMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = A30D41241F0DD12D00B71954 /* KillRingMac.mm */; };
@@ -287,6 +289,8 @@
A1175B561F6B470500C4B9F0 /* DefaultSearchProvider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DefaultSearchProvider.cpp; sourceTree = "<group>"; };
A1175B591F6B4A8400C4B9F0 /* NSScrollViewSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSScrollViewSPI.h; sourceTree = "<group>"; };
A1F55DCE1F5528EC00EDB75F /* MetadataSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MetadataSPI.h; sourceTree = "<group>"; };
+ A1F63C9D21A4DBF7006FB43B /* PassKitSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PassKitSoftLink.h; sourceTree = "<group>"; };
+ A1F63C9E21A4DBF7006FB43B /* PassKitSoftLink.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PassKitSoftLink.mm; sourceTree = "<group>"; };
A30D411E1F0DD0EA00B71954 /* KillRing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KillRing.h; sourceTree = "<group>"; };
A30D411F1F0DD0EA00B71954 /* KillRing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KillRing.cpp; sourceTree = "<group>"; };
A30D41241F0DD12D00B71954 /* KillRingMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KillRingMac.mm; sourceTree = "<group>"; };
@@ -560,6 +564,8 @@
isa = PBXGroup;
children = (
F44291661FA52705002CC93E /* FileSizeFormatterCocoa.mm */,
+ A1F63C9D21A4DBF7006FB43B /* PassKitSoftLink.h */,
+ A1F63C9E21A4DBF7006FB43B /* PassKitSoftLink.mm */,
);
path = cocoa;
sourceTree = "<group>";
@@ -729,6 +735,7 @@
0C77859D1F45130F00F4EBB6 /* NSWindowSPI.h in Headers */,
570AB8F920AF6E3D00B8BE87 /* NSXPCConnectionSPI.h in Headers */,
0C5AF91F1F43A4C7002EAC02 /* OpenGLESSPI.h in Headers */,
+ A1F63C9F21A4DBF7006FB43B /* PassKitSoftLink.h in Headers */,
0C2DA1551F3BEB4900DBC317 /* PassKitSPI.h in Headers */,
0C77859E1F45130F00F4EBB6 /* PIPSPI.h in Headers */,
A1175B4E1F6B337300C4B9F0 /* PopupMenu.h in Headers */,
@@ -854,6 +861,7 @@
A30D41251F0DD12D00B71954 /* KillRingMac.mm in Sources */,
1C4876D81F8D7F4E00CCEEBD /* Logging.cpp in Sources */,
0CF99CA41F736375007EE793 /* MediaTimeAVFoundation.cpp in Sources */,
+ A1F63CA021A4DBF7006FB43B /* PassKitSoftLink.mm in Sources */,
A1175B4F1F6B337300C4B9F0 /* PopupMenu.mm in Sources */,
A3C66CDC1F462D6A009E6EE9 /* SessionID.cpp in Sources */,
A3AB6E521F3D1DC5009C14B1 /* SleepDisabler.cpp in Sources */,
Modified: trunk/Source/WebCore/PAL/pal/PlatformMac.cmake (238433 => 238434)
--- trunk/Source/WebCore/PAL/pal/PlatformMac.cmake 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebCore/PAL/pal/PlatformMac.cmake 2018-11-22 02:12:04 UTC (rev 238434)
@@ -3,6 +3,8 @@
cf/CoreMediaSoftLink.h
+ cocoa/PassKitSoftLink.h
+
spi/cf/CFLocaleSPI.h
spi/cf/CFNetworkConnectionCacheSPI.h
spi/cf/CFNetworkSPI.h
@@ -96,6 +98,7 @@
cocoa/FileSizeFormatterCocoa.mm
cocoa/LoggingCocoa.mm
+ cocoa/PassKitSoftLink.mm
crypto/commoncrypto/CryptoDigestCommonCrypto.cpp
@@ -114,6 +117,7 @@
list(APPEND PAL_PRIVATE_INCLUDE_DIRECTORIES
"${PAL_DIR}/pal/avfoundation"
"${PAL_DIR}/pal/cf"
+ "${PAL_DIR}/pal/cocoa"
"${PAL_DIR}/pal/spi/cf"
"${PAL_DIR}/pal/spi/cg"
"${PAL_DIR}/pal/spi/cocoa"
Added: trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h (0 => 238434)
--- trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h (rev 0)
+++ trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h 2018-11-22 02:12:04 UTC (rev 238434)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(PASSKIT)
+
+#import <pal/spi/cocoa/PassKitSPI.h>
+#import <wtf/SoftLinking.h>
+
+SOFT_LINK_FRAMEWORK_FOR_HEADER(PAL, PassKit)
+
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKContact)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKPassLibrary)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKPayment)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKPaymentAuthorizationViewController)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKPaymentMethod)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKPaymentMerchantSession)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKPaymentRequest)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKPaymentSummaryItem)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKShippingMethod)
+
+SOFT_LINK_FUNCTION_FOR_HEADER(PAL, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion))
+SOFT_LINK_FUNCTION_FOR_HEADER(PAL, PassKit, PKDrawApplePayButton, void, (CGContextRef context, CGRect drawRect, CGFloat scale, PKPaymentButtonType type, PKPaymentButtonStyle style, NSString *languageCode), (context, drawRect, scale, type, style, languageCode))
+
+#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKPaymentAuthorizationResult)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKPaymentRequestPaymentMethodUpdate)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKPaymentRequestShippingContactUpdate)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, PassKit, PKPaymentRequestShippingMethodUpdate)
+
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKContactFieldEmailAddress, PKContactField)
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKContactFieldName, PKContactField)
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKContactFieldPhoneNumber, PKContactField)
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKContactFieldPhoneticName, PKContactField)
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKContactFieldPostalAddress, PKContactField)
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKPaymentErrorContactFieldUserInfoKey, PKPaymentErrorKey)
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, PassKit, PKPaymentErrorPostalAddressUserInfoKey, PKPaymentErrorKey)
+
+SOFT_LINK_FUNCTION_FOR_HEADER(PAL, PassKit, PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication, void, (NSString *identifier, NSString *domain, NSString *sourceApplicationSecondaryIdentifier, PKCanMakePaymentsCompletion completion), (identifier, domain, sourceApplicationSecondaryIdentifier, completion))
+#endif
+
+#endif // USE(PASSKIT)
Added: trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm (0 => 238434)
--- trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm (rev 0)
+++ trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm 2018-11-22 02:12:04 UTC (rev 238434)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2018 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+
+#if USE(PASSKIT)
+
+#import "PassKitSPI.h"
+#import <wtf/SoftLinking.h>
+
+#if PLATFORM(MAC)
+SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PAL_EXPORT)
+#else
+SOFT_LINK_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PAL_EXPORT)
+#endif
+
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContact, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPassLibrary, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPayment, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentAuthorizationViewController, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentMerchantSession, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentMethod, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentRequest, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentSummaryItem, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKShippingMethod, PAL_EXPORT)
+
+SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion), PAL_EXPORT)
+SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, PassKit, PKDrawApplePayButton, void, (CGContextRef context, CGRect drawRect, CGFloat scale, PKPaymentButtonType type, PKPaymentButtonStyle style, NSString *languageCode), (context, drawRect, scale, type, style, languageCode))
+
+#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentAuthorizationResult, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentRequestPaymentMethodUpdate, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentRequestShippingContactUpdate, PAL_EXPORT)
+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentRequestShippingMethodUpdate, PAL_EXPORT)
+
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContactFieldEmailAddress, PKContactField, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContactFieldName, PKContactField, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContactFieldPhoneNumber, PKContactField, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContactFieldPhoneticName, PKContactField, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContactFieldPostalAddress, PKContactField, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentErrorContactFieldUserInfoKey, PKPaymentErrorKey, PAL_EXPORT)
+SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentErrorPostalAddressUserInfoKey, PKPaymentErrorKey, PAL_EXPORT)
+
+SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication, void, (NSString *identifier, NSString *domain, NSString *sourceApplicationSecondaryIdentifier, PKCanMakePaymentsCompletion completion), (identifier, domain, sourceApplicationSecondaryIdentifier, completion), PAL_EXPORT)
+#endif
+
+#endif // USE(PASSKIT)
Modified: trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h (238433 => 238434)
--- trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h 2018-11-22 02:12:04 UTC (rev 238434)
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -25,6 +25,18 @@
#pragma once
+#if !PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK)
+
+// FIXME: PassKit does not declare its NSString constant symbols with C linkage, so we end up with
+// linkage mismatches in the SOFT_LINK_CONSTANT macros used in PassKitSoftLink.mm unless we wrap
+// these includes in an extern "C" block.
+WTF_EXTERN_C_BEGIN
+#import <PassKit/PKConstants.h>
+#import <PassKit/PKError.h>
+WTF_EXTERN_C_END
+
+#endif
+
#if USE(APPLE_INTERNAL_SDK)
#import <PassKit/PassKit.h>
@@ -39,8 +51,8 @@
#elif PLATFORM(MAC)
+#import <AppKit/AppKit.h>
#import <Contacts/Contacts.h>
-#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@@ -53,6 +65,7 @@
@class PKPaymentRequestShippingContactUpdate;
typedef NSString *PKContactField;
+typedef NSString *PKPaymentErrorKey;
extern NSString * const PKPaymentErrorDomain;
typedef NS_ERROR_ENUM(PKPaymentErrorDomain, PKPaymentErrorCode) {
@@ -225,7 +238,7 @@
NS_ASSUME_NONNULL_END
-#endif
+#endif // PLATFORM(MAC)
NS_ASSUME_NONNULL_BEGIN
@@ -261,7 +274,7 @@
NS_ASSUME_NONNULL_END
-#endif
+#endif // USE(APPLE_INTERNAL_SDK)
#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK)
typedef NS_ENUM(NSInteger, PKPaymentButtonStyle) {
@@ -324,4 +337,6 @@
@property (nonatomic, strong) NSString *CTDataConnectionServiceType;
@end
+typedef void(^PKCanMakePaymentsCompletion)(BOOL isValid, NSError *);
+
NS_ASSUME_NONNULL_END
Modified: trunk/Source/WebCore/SourcesCocoa.txt (238433 => 238434)
--- trunk/Source/WebCore/SourcesCocoa.txt 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebCore/SourcesCocoa.txt 2018-11-22 02:12:04 UTC (rev 238434)
@@ -587,7 +587,7 @@
Modules/applepay/cocoa/PaymentCocoa.mm
Modules/applepay/cocoa/PaymentContactCocoa.mm
- Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm @no-unify
+ Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm
Modules/applepay/cocoa/PaymentMethodCocoa.mm
Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (238433 => 238434)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2018-11-22 02:12:04 UTC (rev 238434)
@@ -4482,7 +4482,6 @@
DE5F860D1FA2386B006DB63A /* UnifiedSource478.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE5F85D21FA23856006DB63A /* UnifiedSource478.cpp */; };
DE5F860E1FA2386B006DB63A /* UnifiedSource479.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE5F85CF1FA23850006DB63A /* UnifiedSource479.cpp */; };
DE5F860F1FA2386B006DB63A /* UnifiedSource480.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE5F85D31FA23859006DB63A /* UnifiedSource480.cpp */; };
- DE5F86101FA238D9006DB63A /* PaymentMerchantSessionCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ADA4A1B1D22F2C0005A9A15 /* PaymentMerchantSessionCocoa.mm */; };
DE5F86111FA239DA006DB63A /* InternalSettingsGenerated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53E29E5C167A8A1900586D3D /* InternalSettingsGenerated.cpp */; };
DE5F86121FA239E7006DB63A /* JSGCObservation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51714EAE1CF6654A004723C4 /* JSGCObservation.cpp */; };
DE5F861D1FA2815B006DB63A /* WebAccessibilityObjectWrapperMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = AA478A7E16CD70C3007D1BB4 /* WebAccessibilityObjectWrapperMac.mm */; };
@@ -32426,7 +32425,6 @@
A31C4E4D16E02AA6002F7957 /* OESTextureHalfFloat.cpp in Sources */,
31078CC71880AAB5008099DC /* OESTextureHalfFloatLinear.cpp in Sources */,
77A17A7112F28182004E02F6 /* OESVertexArrayObject.cpp in Sources */,
- DE5F86101FA238D9006DB63A /* PaymentMerchantSessionCocoa.mm in Sources */,
CEA284662141E84900E407E8 /* PlatformEventFactoryIOS.mm in Sources */,
AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerIOS.mm in Sources */,
CDA29A301CBF74D400901CCF /* PlaybackSessionInterfaceAVKit.mm in Sources */,
Modified: trunk/Source/WebCore/rendering/RenderThemeCocoa.mm (238433 => 238434)
--- trunk/Source/WebCore/rendering/RenderThemeCocoa.mm 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebCore/rendering/RenderThemeCocoa.mm 2018-11-22 02:12:04 UTC (rev 238434)
@@ -32,17 +32,8 @@
#if ENABLE(APPLE_PAY)
-#import <pal/spi/cocoa/PassKitSPI.h>
-#import <wtf/SoftLinking.h>
+#import <pal/cocoa/PassKitSoftLink.h>
-#if PLATFORM(MAC)
-SOFT_LINK_PRIVATE_FRAMEWORK(PassKit);
-#else
-SOFT_LINK_FRAMEWORK(PassKit);
-#endif
-
-SOFT_LINK_MAY_FAIL(PassKit, PKDrawApplePayButton, void, (CGContextRef context, CGRect drawRect, CGFloat scale, PKPaymentButtonType type, PKPaymentButtonStyle style, NSString *languageCode), (context, drawRect, scale, type, style, languageCode));
-
#endif // ENABLE(APPLE_PAY)
#if ENABLE(VIDEO)
@@ -108,9 +99,6 @@
bool RenderThemeCocoa::paintApplePayButton(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& paintRect)
{
- if (!canLoadPKDrawApplePayButton())
- return false;
-
GraphicsContextStateSaver stateSaver(paintInfo.context());
paintInfo.context().setShouldSmoothFonts(true);
Modified: trunk/Source/WebKit/ChangeLog (238433 => 238434)
--- trunk/Source/WebKit/ChangeLog 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebKit/ChangeLog 2018-11-22 02:12:04 UTC (rev 238434)
@@ -1,3 +1,20 @@
+2018-11-21 Andy Estes <[email protected]>
+
+ [Cocoa] Create a soft-linking file for PassKit
+ https://bugs.webkit.org/show_bug.cgi?id=191875
+ <rdar://problem/46203215>
+
+ Reviewed by Myles Maxfield.
+
+ * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
+ * SourcesCocoa.txt: Removed @no-unify from WebPaymentCoordinatorProxyIOS.mm and WebPaymentCoordinatorProxyMac.mm.
+ * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
+ * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Ditto.
+ * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Ditto.
+ * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm: Included NSAttributedStringSPI.h.
+ * UIProcess/mac/WebProcessProxyMac.mm: Included ProcessPrivilege.h.
+ * WebKit.xcodeproj/project.pbxproj: Removed WebPaymentCoordinatorProxyIOS.mm and WebPaymentCoordinatorProxyMac.mm from the WebKit target.
+
2018-11-21 Fujii Hironori <[email protected]>
Remove @no-unify of InjectedBundleRangeHandle.cpp and InjectedBundleNodeHandle.cpp
Modified: trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm (238433 => 238434)
--- trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm 2018-11-22 02:12:04 UTC (rev 238434)
@@ -30,21 +30,9 @@
#import "DataReference.h"
#import <WebCore/PaymentAuthorizationStatus.h>
+#import <pal/cocoa/PassKitSoftLink.h>
#import <pal/spi/cocoa/NSKeyedArchiverSPI.h>
-#import <pal/spi/cocoa/PassKitSPI.h>
-#import <wtf/SoftLinking.h>
-#if PLATFORM(MAC)
-SOFT_LINK_PRIVATE_FRAMEWORK(PassKit)
-#else
-SOFT_LINK_FRAMEWORK(PassKit)
-#endif
-
-SOFT_LINK_CLASS(PassKit, PKContact);
-SOFT_LINK_CLASS(PassKit, PKPayment);
-SOFT_LINK_CLASS(PassKit, PKPaymentMethod);
-SOFT_LINK_CLASS(PassKit, PKPaymentMerchantSession);
-
namespace IPC {
using namespace WebCore;
@@ -67,7 +55,7 @@
auto data = "" alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(dataReference.data())) length:dataReference.size() freeWhenDone:NO]);
auto unarchiver = secureUnarchiverFromData(data.get());
@try {
- PKPayment *pkPayment = [unarchiver decodeObjectOfClass:getPKPaymentClass() forKey:NSKeyedArchiveRootObjectKey];
+ PKPayment *pkPayment = [unarchiver decodeObjectOfClass:PAL::get_PassKit_PKPaymentClass() forKey:NSKeyedArchiveRootObjectKey];
payment = Payment(pkPayment);
} @catch (NSException *exception) {
LOG_ERROR("Failed to decode PKPayment: %@", exception);
@@ -118,7 +106,7 @@
auto data = "" alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(dataReference.data())) length:dataReference.size() freeWhenDone:NO]);
auto unarchiver = secureUnarchiverFromData(data.get());
@try {
- PKContact *pkContact = [unarchiver decodeObjectOfClass:getPKContactClass() forKey:NSKeyedArchiveRootObjectKey];
+ PKContact *pkContact = [unarchiver decodeObjectOfClass:PAL::get_PassKit_PKContactClass() forKey:NSKeyedArchiveRootObjectKey];
paymentContact = PaymentContact(pkContact);
} @catch (NSException *exception) {
LOG_ERROR("Failed to decode PKContact: %@", exception);
@@ -175,7 +163,7 @@
auto data = "" alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(dataReference.data())) length:dataReference.size() freeWhenDone:NO]);
auto unarchiver = secureUnarchiverFromData(data.get());
@try {
- PKPaymentMerchantSession *pkPaymentMerchantSession = [unarchiver decodeObjectOfClass:getPKPaymentMerchantSessionClass() forKey:NSKeyedArchiveRootObjectKey];
+ PKPaymentMerchantSession *pkPaymentMerchantSession = [unarchiver decodeObjectOfClass:PAL::get_PassKit_PKPaymentMerchantSessionClass() forKey:NSKeyedArchiveRootObjectKey];
paymentMerchantSession = PaymentMerchantSession(pkPaymentMerchantSession);
} @catch (NSException *exception) {
LOG_ERROR("Failed to decode PKPaymentMerchantSession: %@", exception);
@@ -205,7 +193,7 @@
auto data = "" alloc] initWithBytesNoCopy:const_cast<void*>(static_cast<const void*>(dataReference.data())) length:dataReference.size() freeWhenDone:NO]);
auto unarchiver = secureUnarchiverFromData(data.get());
@try {
- PKPaymentMethod *pkPaymentMethod = [unarchiver decodeObjectOfClass:getPKPaymentMethodClass() forKey:NSKeyedArchiveRootObjectKey];
+ PKPaymentMethod *pkPaymentMethod = [unarchiver decodeObjectOfClass:PAL::get_PassKit_PKPaymentMethodClass() forKey:NSKeyedArchiveRootObjectKey];
paymentMethod = PaymentMethod(pkPaymentMethod);
} @catch (NSException *exception) {
LOG_ERROR("Failed to decode PKPayment: %@", exception);
Modified: trunk/Source/WebKit/SourcesCocoa.txt (238433 => 238434)
--- trunk/Source/WebKit/SourcesCocoa.txt 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebKit/SourcesCocoa.txt 2018-11-22 02:12:04 UTC (rev 238434)
@@ -294,9 +294,9 @@
UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
-UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm @no-unify
+UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm
-UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm @no-unify
+UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm
UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm
UIProcess/Authentication/cocoa/SecKeyProxyStore.mm
Modified: trunk/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (238433 => 238434)
--- trunk/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm 2018-11-22 02:12:04 UTC (rev 238434)
@@ -33,25 +33,11 @@
#import <WebCore/PaymentAuthorizationStatus.h>
#import <WebCore/PaymentHeaders.h>
#import <WebCore/URL.h>
-#import <pal/spi/cocoa/PassKitSPI.h>
+#import <pal/cocoa/PassKitSoftLink.h>
#import <wtf/BlockPtr.h>
#import <wtf/RunLoop.h>
-#import <wtf/SoftLinking.h>
-#if PLATFORM(MAC)
-SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(PassKit)
-#else
-SOFT_LINK_FRAMEWORK(PassKit)
-#endif
-
-SOFT_LINK_CLASS(PassKit, PKPassLibrary);
-SOFT_LINK_CLASS(PassKit, PKPaymentAuthorizationViewController);
-SOFT_LINK_CLASS(PassKit, PKPaymentMerchantSession);
-SOFT_LINK_CLASS(PassKit, PKPaymentRequest);
-SOFT_LINK_CLASS(PassKit, PKPaymentSummaryItem);
-SOFT_LINK_CLASS(PassKit, PKShippingMethod);
-
-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300)
SOFT_LINK_FRAMEWORK(Contacts)
SOFT_LINK_CONSTANT(Contacts, CNPostalAddressStreetKey, NSString *);
SOFT_LINK_CONSTANT(Contacts, CNPostalAddressSubLocalityKey, NSString *);
@@ -61,30 +47,9 @@
SOFT_LINK_CONSTANT(Contacts, CNPostalAddressPostalCodeKey, NSString *);
SOFT_LINK_CONSTANT(Contacts, CNPostalAddressCountryKey, NSString *);
SOFT_LINK_CONSTANT(Contacts, CNPostalAddressISOCountryCodeKey, NSString *);
-SOFT_LINK_CLASS(PassKit, PKPaymentAuthorizationResult)
-SOFT_LINK_CLASS(PassKit, PKPaymentRequestPaymentMethodUpdate)
-SOFT_LINK_CLASS(PassKit, PKPaymentRequestShippingContactUpdate)
-SOFT_LINK_CLASS(PassKit, PKPaymentRequestShippingMethodUpdate)
-SOFT_LINK_CONSTANT(PassKit, PKPaymentErrorDomain, NSString *);
-SOFT_LINK_CONSTANT(PassKit, PKContactFieldPostalAddress, NSString *);
-SOFT_LINK_CONSTANT(PassKit, PKContactFieldEmailAddress, NSString *);
-SOFT_LINK_CONSTANT(PassKit, PKContactFieldPhoneNumber, NSString *);
-SOFT_LINK_CONSTANT(PassKit, PKContactFieldName, NSString *);
-SOFT_LINK_CONSTANT(PassKit, PKContactFieldPhoneticName, NSString *);
-SOFT_LINK_CONSTANT(PassKit, PKPaymentErrorContactFieldUserInfoKey, NSString *);
-SOFT_LINK_CONSTANT(PassKit, PKPaymentErrorPostalAddressUserInfoKey, NSString *);
+SOFT_LINK_CONSTANT(PAL::PassKit, PKPaymentErrorDomain, NSString *);
#endif
-typedef void (^PKCanMakePaymentsCompletion)(BOOL isValid, NSError *error);
-#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
-extern "C" void PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(NSString *identifier, NSString *domain, NSString *sourceApplicationSecondaryIdentifier, PKCanMakePaymentsCompletion completion);
-SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebKit, PassKit, PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication, void, (NSString *identifier, NSString *domain, NSString *sourceApplicationSecondaryIdentifier, PKCanMakePaymentsCompletion completion), (identifier, domain, sourceApplicationSecondaryIdentifier, completion));
-#else
-extern "C" void PKCanMakePaymentsWithMerchantIdentifierAndDomain(NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion);
-SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebKit, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion));
-#endif
-
-
@implementation WKPaymentAuthorizationViewControllerDelegate
- (instancetype)initWithPaymentCoordinatorProxy:(WebKit::WebPaymentCoordinatorProxy&)webPaymentCoordinatorProxy
@@ -102,7 +67,7 @@
_webPaymentCoordinatorProxy = nullptr;
if (_paymentAuthorizedCompletion) {
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
- _paymentAuthorizedCompletion(adoptNS([allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get());
+ _paymentAuthorizedCompletion(adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get());
#else
_paymentAuthorizedCompletion(PKPaymentAuthorizationStatusFailure);
#endif
@@ -119,7 +84,7 @@
ASSERT(!_sessionBlock);
_sessionBlock = sessionBlock;
- [getPKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURL:^(NSURL *merchantURL, NSError *error) {
+ [PAL::get_PassKit_PKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURL:^(NSURL *merchantURL, NSError *error) {
if (error)
LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error);
@@ -155,7 +120,7 @@
{
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
if (!_webPaymentCoordinatorProxy) {
- completion(adoptNS([allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get());
+ completion(adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get());
return;
}
@@ -170,7 +135,7 @@
{
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
if (!_webPaymentCoordinatorProxy) {
- completion(adoptNS([allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());
+ completion(adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());
return;
}
@@ -183,7 +148,7 @@
- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectShippingMethod:(PKShippingMethod *)shippingMethod handler:(void (^)(PKPaymentRequestShippingMethodUpdate *update))completion {
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
if (!_webPaymentCoordinatorProxy) {
- completion(adoptNS([allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());
+ completion(adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());
return;
}
@@ -197,7 +162,7 @@
{
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
if (!_webPaymentCoordinatorProxy) {
- completion(adoptNS([allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[ ] paymentSummaryItems:@[ ] shippingMethods:@[ ]]).get());
+ completion(adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[ ] paymentSummaryItems:@[ ] shippingMethods:@[ ]]).get());
return;
}
@@ -293,32 +258,13 @@
bool WebPaymentCoordinatorProxy::platformCanMakePayments()
{
-#if PLATFORM(MAC)
- if (!PassKitLibrary())
- return false;
-#endif
-
- return [getPKPaymentAuthorizationViewControllerClass() canMakePayments];
+ return [PAL::get_PassKit_PKPaymentAuthorizationViewControllerClass() canMakePayments];
}
void WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler)
{
-#if PLATFORM(MAC)
- if (!PassKitLibrary()) {
- completionHandler(false);
- return;
- }
-#endif
-
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
- if (!canLoad_PassKit_PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication()) {
- RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler)] {
- completionHandler(false);
- });
- return;
- }
-
- softLink_PassKit_PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(merchantIdentifier, domainName, m_webPageProxy.process().processPool().configuration().sourceApplicationSecondaryIdentifier(), BlockPtr<void (BOOL, NSError *)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable {
+ PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(merchantIdentifier, domainName, m_webPageProxy.process().processPool().configuration().sourceApplicationSecondaryIdentifier(), BlockPtr<void(BOOL, NSError *)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable {
if (error)
LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error);
@@ -327,14 +273,7 @@
});
}).get());
#else
- if (!canLoad_PassKit_PKCanMakePaymentsWithMerchantIdentifierAndDomain()) {
- RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler)] {
- completionHandler(false);
- });
- return;
- }
-
- softLink_PassKit_PKCanMakePaymentsWithMerchantIdentifierAndDomain(merchantIdentifier, domainName, BlockPtr<void (BOOL, NSError *)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable {
+ PKCanMakePaymentsWithMerchantIdentifierAndDomain(merchantIdentifier, domainName, BlockPtr<void(BOOL, NSError *)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable {
if (error)
LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error);
@@ -347,14 +286,7 @@
void WebPaymentCoordinatorProxy::platformOpenPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler)
{
-#if PLATFORM(MAC)
- if (!PassKitLibrary()) {
- completionHandler(false);
- return;
- }
-#endif
-
- auto passLibrary = adoptNS([allocPKPassLibraryInstance() init]);
+ auto passLibrary = adoptNS([PAL::allocPKPassLibraryInstance() init]);
[passLibrary openPaymentSetupForMerchantIdentifier:merchantIdentifier domain:domainName completion:BlockPtr<void (BOOL)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL result) mutable {
RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler), result] {
completionHandler(result);
@@ -368,15 +300,15 @@
Vector<NSString *> result;
if (contactFields.postalAddress)
- result.append(getPKContactFieldPostalAddress());
+ result.append(PAL::get_PassKit_PKContactFieldPostalAddress());
if (contactFields.phone)
- result.append(getPKContactFieldPhoneNumber());
+ result.append(PAL::get_PassKit_PKContactFieldPhoneNumber());
if (contactFields.email)
- result.append(getPKContactFieldEmailAddress());
+ result.append(PAL::get_PassKit_PKContactFieldEmailAddress());
if (contactFields.name)
- result.append(getPKContactFieldName());
+ result.append(PAL::get_PassKit_PKContactFieldName());
if (contactFields.phoneticName)
- result.append(getPKContactFieldPhoneticName());
+ result.append(PAL::get_PassKit_PKContactFieldPhoneticName());
return adoptNS([[NSSet alloc] initWithObjects:result.data() count:result.size()]);
}
@@ -418,7 +350,7 @@
static RetainPtr<PKPaymentSummaryItem> toPKPaymentSummaryItem(const WebCore::ApplePaySessionPaymentRequest::LineItem& lineItem)
{
- return [getPKPaymentSummaryItemClass() summaryItemWithLabel:lineItem.label amount:toDecimalNumber(lineItem.amount) type:toPKPaymentSummaryItemType(lineItem.type)];
+ return [PAL::get_PassKit_PKPaymentSummaryItemClass() summaryItemWithLabel:lineItem.label amount:toDecimalNumber(lineItem.amount) type:toPKPaymentSummaryItemType(lineItem.type)];
}
static RetainPtr<NSArray> toPKPaymentSummaryItems(const WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems& totalAndLineItems)
@@ -477,7 +409,7 @@
static RetainPtr<PKShippingMethod> toPKShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod& shippingMethod)
{
- RetainPtr<PKShippingMethod> result = [getPKShippingMethodClass() summaryItemWithLabel:shippingMethod.label amount:toDecimalNumber(shippingMethod.amount)];
+ RetainPtr<PKShippingMethod> result = [PAL::get_PassKit_PKShippingMethodClass() summaryItemWithLabel:shippingMethod.label amount:toDecimalNumber(shippingMethod.amount)];
[result setIdentifier:shippingMethod.identifier];
[result setDetail:shippingMethod.detail];
@@ -512,7 +444,7 @@
RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy& webPageProxy, const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest& paymentRequest)
{
- auto result = adoptNS([allocPKPaymentRequestInstance() init]);
+ auto result = adoptNS([PAL::allocPKPaymentRequestInstance() init]);
[result setOriginatingURL:originatingURL];
@@ -632,69 +564,69 @@
switch (*error.contactField) {
case WebCore::PaymentError::ContactField::PhoneNumber:
- pkContactField = getPKContactFieldPhoneNumber();
+ pkContactField = PAL::get_PassKit_PKContactFieldPhoneNumber();
break;
case WebCore::PaymentError::ContactField::EmailAddress:
- pkContactField = getPKContactFieldEmailAddress();
+ pkContactField = PAL::get_PassKit_PKContactFieldEmailAddress();
break;
case WebCore::PaymentError::ContactField::Name:
- pkContactField = getPKContactFieldName();
+ pkContactField = PAL::get_PassKit_PKContactFieldName();
break;
case WebCore::PaymentError::ContactField::PhoneticName:
- pkContactField = getPKContactFieldPhoneticName();
+ pkContactField = PAL::get_PassKit_PKContactFieldPhoneticName();
break;
case WebCore::PaymentError::ContactField::PostalAddress:
- pkContactField = getPKContactFieldPostalAddress();
+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
break;
case WebCore::PaymentError::ContactField::AddressLines:
- pkContactField = getPKContactFieldPostalAddress();
+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
postalAddressKey = getCNPostalAddressStreetKey();
break;
case WebCore::PaymentError::ContactField::SubLocality:
- pkContactField = getPKContactFieldPostalAddress();
+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
postalAddressKey = getCNPostalAddressSubLocalityKey();
break;
case WebCore::PaymentError::ContactField::Locality:
- pkContactField = getPKContactFieldPostalAddress();
+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
postalAddressKey = getCNPostalAddressCityKey();
break;
case WebCore::PaymentError::ContactField::PostalCode:
- pkContactField = getPKContactFieldPostalAddress();
+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
postalAddressKey = getCNPostalAddressPostalCodeKey();
break;
case WebCore::PaymentError::ContactField::SubAdministrativeArea:
- pkContactField = getPKContactFieldPostalAddress();
+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
postalAddressKey = getCNPostalAddressSubAdministrativeAreaKey();
break;
case WebCore::PaymentError::ContactField::AdministrativeArea:
- pkContactField = getPKContactFieldPostalAddress();
+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
postalAddressKey = getCNPostalAddressStateKey();
break;
case WebCore::PaymentError::ContactField::Country:
- pkContactField = getPKContactFieldPostalAddress();
+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
postalAddressKey = getCNPostalAddressCountryKey();
break;
case WebCore::PaymentError::ContactField::CountryCode:
- pkContactField = getPKContactFieldPostalAddress();
+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
postalAddressKey = getCNPostalAddressISOCountryCodeKey();
break;
}
- [userInfo setObject:pkContactField forKey:getPKPaymentErrorContactFieldUserInfoKey()];
+ [userInfo setObject:pkContactField forKey:PAL::get_PassKit_PKPaymentErrorContactFieldUserInfoKey()];
if (postalAddressKey)
- [userInfo setObject:postalAddressKey forKey:getPKPaymentErrorPostalAddressUserInfoKey()];
+ [userInfo setObject:postalAddressKey forKey:PAL::get_PassKit_PKPaymentErrorPostalAddressUserInfoKey()];
}
return adoptNS([[NSError alloc] initWithDomain:getPKPaymentErrorDomain() code:toPKPaymentErrorCode(error.code) userInfo:userInfo.get()]);
@@ -761,7 +693,7 @@
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
auto status = result ? result->status : WebCore::PaymentAuthorizationStatus::Success;
- auto pkPaymentAuthorizationResult = adoptNS([allocPKPaymentAuthorizationResultInstance() initWithStatus:toPKPaymentAuthorizationStatus(status) errors:result ? toNSErrors(result->errors).get() : @[ ]]);
+ auto pkPaymentAuthorizationResult = adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:toPKPaymentAuthorizationStatus(status) errors:result ? toNSErrors(result->errors).get() : @[ ]]);
m_paymentAuthorizationViewControllerDelegate->_paymentAuthorizedCompletion(pkPaymentAuthorizationResult.get());
#else
m_paymentAuthorizationViewControllerDelegate->_paymentAuthorizedCompletion(toPKPaymentAuthorizationStatus(result));
@@ -787,7 +719,7 @@
m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = toPKPaymentSummaryItems(update->newTotalAndLineItems);
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
- auto pkShippingMethodUpdate = adoptNS([allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get()]);
+ auto pkShippingMethodUpdate = adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get()]);
m_paymentAuthorizationViewControllerDelegate->_didSelectShippingMethodCompletion(pkShippingMethodUpdate.get());
#else
m_paymentAuthorizationViewControllerDelegate->_didSelectShippingMethodCompletion(PKPaymentAuthorizationStatusSuccess, m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get());
@@ -839,7 +771,7 @@
}
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
- auto pkShippingContactUpdate = adoptNS([allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:update ? toNSErrors(update->errors).get() : @[ ] paymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get() shippingMethods:m_paymentAuthorizationViewControllerDelegate->_shippingMethods.get()]);
+ auto pkShippingContactUpdate = adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:update ? toNSErrors(update->errors).get() : @[ ] paymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get() shippingMethods:m_paymentAuthorizationViewControllerDelegate->_shippingMethods.get()]);
m_paymentAuthorizationViewControllerDelegate->_didSelectShippingContactCompletion(pkShippingContactUpdate.get());
#else
m_paymentAuthorizationViewControllerDelegate->_didSelectShippingContactCompletion(toPKPaymentAuthorizationStatus(update), m_paymentAuthorizationViewControllerDelegate->_shippingMethods.get(), m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get());
@@ -856,7 +788,7 @@
m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = toPKPaymentSummaryItems(update->newTotalAndLineItems);
#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
- auto pkPaymentMethodUpdate = adoptNS([allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get()]);
+ auto pkPaymentMethodUpdate = adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get()]);
m_paymentAuthorizationViewControllerDelegate->_didSelectPaymentMethodCompletion(pkPaymentMethodUpdate.get());
#else
m_paymentAuthorizationViewControllerDelegate->_didSelectPaymentMethodCompletion(m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get());
@@ -866,12 +798,7 @@
Vector<String> WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks()
{
-#if PLATFORM(MAC)
- if (!PassKitLibrary())
- return { };
-#endif
-
- NSArray<PKPaymentNetwork> *availableNetworks = [getPKPaymentRequestClass() availableNetworks];
+ NSArray<PKPaymentNetwork> *availableNetworks = [PAL::get_PassKit_PKPaymentRequestClass() availableNetworks];
Vector<String> result;
result.reserveInitialCapacity(availableNetworks.count);
for (PKPaymentNetwork network in availableNetworks)
Modified: trunk/Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm (238433 => 238434)
--- trunk/Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm 2018-11-22 02:12:04 UTC (rev 238434)
@@ -34,11 +34,8 @@
#import <PassKit/PassKit.h>
#import <UIKit/UIViewController.h>
#import <WebCore/PaymentAuthorizationStatus.h>
-#import <wtf/SoftLinking.h>
+#import <pal/cocoa/PassKitSoftLink.h>
-SOFT_LINK_FRAMEWORK(PassKit)
-SOFT_LINK_CLASS(PassKit, PKPaymentAuthorizationViewController);
-
namespace WebKit {
void WebPaymentCoordinatorProxy::platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, WTF::Function<void (bool)>&& completionHandler)
@@ -54,7 +51,7 @@
auto paymentRequest = toPKPaymentRequest(m_webPageProxy, originatingURL, linkIconURLStrings, request);
- m_paymentAuthorizationViewController = adoptNS([allocPKPaymentAuthorizationViewControllerInstance() initWithPaymentRequest:paymentRequest.get()]);
+ m_paymentAuthorizationViewController = adoptNS([PAL::allocPKPaymentAuthorizationViewControllerInstance() initWithPaymentRequest:paymentRequest.get()]);
if (!m_paymentAuthorizationViewController) {
completionHandler(false);
return;
Modified: trunk/Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm (238433 => 238434)
--- trunk/Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm 2018-11-22 02:12:04 UTC (rev 238434)
@@ -30,29 +30,18 @@
#import "WebPageProxy.h"
#import "WebPaymentCoordinatorProxyCocoa.h"
-#import <pal/spi/cocoa/PassKitSPI.h>
+#import <pal/cocoa/PassKitSoftLink.h>
#import <wtf/BlockPtr.h>
-#import <wtf/SoftLinking.h>
-SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(PassKit)
-
-SOFT_LINK_CLASS(PassKit, PKPaymentAuthorizationViewController);
-SOFT_LINK_CONSTANT(PassKit, PKExtensionPaymentAuthorizationUIExtensionPointName, NSString *);
-
namespace WebKit {
void WebPaymentCoordinatorProxy::platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, WTF::Function<void (bool)>&& completionHandler)
{
- if (!PassKitLibrary()) {
- completionHandler(false);
- return;
- }
-
auto paymentRequest = toPKPaymentRequest(m_webPageProxy, originatingURL, linkIconURLStrings, request);
auto showPaymentUIRequestSeed = m_showPaymentUIRequestSeed;
auto weakThis = makeWeakPtr(*this);
- [getPKPaymentAuthorizationViewControllerClass() requestViewControllerWithPaymentRequest:paymentRequest.get() completion:BlockPtr<void (PKPaymentAuthorizationViewController *, NSError *)>::fromCallable([paymentRequest, showPaymentUIRequestSeed, weakThis, completionHandler = WTFMove(completionHandler)](PKPaymentAuthorizationViewController *viewController, NSError *error) {
+ [PAL::get_PassKit_PKPaymentAuthorizationViewControllerClass() requestViewControllerWithPaymentRequest:paymentRequest.get() completion:BlockPtr<void(PKPaymentAuthorizationViewController *, NSError *)>::fromCallable([paymentRequest, showPaymentUIRequestSeed, weakThis, completionHandler = WTFMove(completionHandler)](PKPaymentAuthorizationViewController *viewController, NSError *error) {
auto paymentCoordinatorProxy = weakThis.get();
if (!paymentCoordinatorProxy)
return;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm (238433 => 238434)
--- trunk/Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm 2018-11-22 02:12:04 UTC (rev 238434)
@@ -28,6 +28,7 @@
#import "SafeBrowsingSPI.h"
#import <WebCore/LocalizedStrings.h>
+#import <pal/spi/cocoa/NSAttributedStringSPI.h>
#import <wtf/Language.h>
namespace WebKit {
Modified: trunk/Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm (238433 => 238434)
--- trunk/Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm 2018-11-22 02:12:04 UTC (rev 238434)
@@ -30,6 +30,7 @@
#if PLATFORM(MAC)
#import "WKFullKeyboardAccessWatcher.h"
+#import <wtf/ProcessPrivilege.h>
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
#import <Kernel/kern/cs_blobs.h>
Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (238433 => 238434)
--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2018-11-22 01:51:33 UTC (rev 238433)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2018-11-22 02:12:04 UTC (rev 238434)
@@ -684,8 +684,6 @@
2D92A795212B6AD400F493FD /* PluginProcessCreationParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2D90D11281C966001EB962 /* PluginProcessCreationParameters.cpp */; };
2D92A796212B6ADA00F493FD /* NetscapePluginModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4A9C5312B816CF008FE984 /* NetscapePluginModule.cpp */; };
2D92A797212B6ADA00F493FD /* PluginInformation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3F8C8E173AF52D007B7F39 /* PluginInformation.cpp */; };
- 2D92A79821348D8500F493FD /* WebPaymentCoordinatorProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F77D1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyMac.mm */; };
- 2D92A79F2134B07E00F493FD /* WebPaymentCoordinatorProxyIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F77B1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyIOS.mm */; };
2D931169212F61B200044BFE /* WKContentView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E3D18BBE044000FCFC9 /* WKContentView.mm */; };
2D93116A212F61B500044BFE /* WKContentViewInteraction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E6B18BBF26A000FCFC9 /* WKContentViewInteraction.mm */; };
2D9EA30D1A96CB59002D2807 /* WKPageInjectedBundleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D9EA30C1A96CB59002D2807 /* WKPageInjectedBundleClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -11006,8 +11004,6 @@
7CE9CE101FA0767A000177DE /* WebPageUpdatePreferences.cpp in Sources */,
7C4694C91A4B4EA100AD5845 /* WebPasteboardProxyMessageReceiver.cpp in Sources */,
1AB1F7961D1B3613007C9BD1 /* WebPaymentCoordinatorMessageReceiver.cpp in Sources */,
- 2D92A79F2134B07E00F493FD /* WebPaymentCoordinatorProxyIOS.mm in Sources */,
- 2D92A79821348D8500F493FD /* WebPaymentCoordinatorProxyMac.mm in Sources */,
1AB1F7981D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessageReceiver.cpp in Sources */,
2D92A78D212B6AB100F493FD /* WebPlatformTouchPoint.cpp in Sources */,
2D91344E212CF9F000128AFD /* WebPluginInfoProvider.cpp in Sources */,