Changeset 238434 in webkit
- Timestamp:
- Nov 21, 2018, 6:12:04 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 22 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/Platform.h (modified) (2 diffs)
-
WTF/wtf/cocoa/SoftLinking.h (modified) (11 diffs)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm (modified) (4 diffs)
-
WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm (modified) (3 diffs)
-
WebCore/PAL/ChangeLog (modified) (1 diff)
-
WebCore/PAL/PAL.xcodeproj/project.pbxproj (modified) (5 diffs)
-
WebCore/PAL/pal/PlatformMac.cmake (modified) (3 diffs)
-
WebCore/PAL/pal/cocoa/PassKitSoftLink.h (added)
-
WebCore/PAL/pal/cocoa/PassKitSoftLink.mm (added)
-
WebCore/PAL/pal/spi/cocoa/PassKitSPI.h (modified) (7 diffs)
-
WebCore/SourcesCocoa.txt (modified) (1 diff)
-
WebCore/WebCore.xcodeproj/project.pbxproj (modified) (2 diffs)
-
WebCore/rendering/RenderThemeCocoa.mm (modified) (2 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm (modified) (5 diffs)
-
WebKit/SourcesCocoa.txt (modified) (1 diff)
-
WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (modified) (21 diffs)
-
WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm (modified) (2 diffs)
-
WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm (modified) (2 diffs)
-
WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm (modified) (1 diff)
-
WebKit/UIProcess/mac/WebProcessProxyMac.mm (modified) (1 diff)
-
WebKit/WebKit.xcodeproj/project.pbxproj (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r238414 r238434 1 2018-11-21 Andy Estes <aestes@apple.com> 2 3 [Cocoa] Create a soft-linking file for PassKit 4 https://bugs.webkit.org/show_bug.cgi?id=191875 5 <rdar://problem/46203215> 6 7 Reviewed by Myles Maxfield. 8 9 * wtf/Platform.h: Defined USE_PASSKIT. 10 * wtf/cocoa/SoftLinking.h: Added _WITH_EXPORT variants of SOFT_LINK_FRAMEWORK_FOR_SOURCE, 11 SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE, SOFT_LINK_CLASS_FOR_SOURCE, 12 SOFT_LINK_FUNCTION_FOR_SOURCE, and SOFT_LINK_CONSTANT_FOR_SOURCE. 13 1 14 2018-11-21 Dominik Infuehr <dinfuehr@igalia.com> 2 15 -
trunk/Source/WTF/wtf/Platform.h
r238414 r238434 617 617 #if PLATFORM(MAC) 618 618 619 #define USE_APPKIT 1620 619 #define HAVE_RUNLOOP_TIMER 1 621 620 #define HAVE_SEC_KEYCHAIN 1 621 #define USE_APPKIT 1 622 #define USE_PASSKIT 1 622 623 623 624 #if CPU(X86_64) … … 1061 1062 1062 1063 #if PLATFORM(IOS) 1064 #define HAVE_APP_LINKS 1 1065 #define USE_PASSKIT 1 1063 1066 #define USE_QUICK_LOOK 1 1064 1067 #define USE_SYSTEM_PREVIEW 1 1065 #define HAVE_APP_LINKS 11066 1068 #endif 1067 1069 -
trunk/Source/WTF/wtf/cocoa/SoftLinking.h
r237620 r238434 1 1 /* 2 * Copyright (C) 2007 , 2008, 2011-2015Apple Inc. All rights reserved.2 * Copyright (C) 2007-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 341 341 } 342 342 343 #define SOFT_LINK_FRAMEWORK_FOR_SOURCE (functionNamespace, framework) \344 namespace functionNamespace { \ 345 void* framework##Library(bool isOptional = false); \343 #define SOFT_LINK_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, export) \ 344 namespace functionNamespace { \ 345 export void* framework##Library(bool isOptional = false); \ 346 346 void* framework##Library(bool isOptional) \ 347 347 { \ … … 357 357 } 358 358 359 #define SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(functionNamespace, framework) \ 360 namespace functionNamespace { \ 361 void* framework##Library(bool isOptional = false); \ 359 #define SOFT_LINK_FRAMEWORK_FOR_SOURCE(functionNamespace, framework) \ 360 SOFT_LINK_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, ) 361 362 #define SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, export) \ 363 namespace functionNamespace { \ 364 export void* framework##Library(bool isOptional = false); \ 362 365 void* framework##Library(bool isOptional) \ 363 366 { \ … … 373 376 } 374 377 378 #define SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(functionNamespace, framework) \ 379 SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, ) 380 375 381 #define SOFT_LINK_CLASS_FOR_HEADER(functionNamespace, framework, className) \ 376 382 @class className; \ … … 384 390 } 385 391 386 #define SOFT_LINK_CLASS_FOR_SOURCE (functionNamespace, framework, className) \392 #define SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, className, export) \ 387 393 @class className; \ 388 394 namespace functionNamespace { \ 389 395 static Class init##className(); \ 390 Class (*get_##framework##_##className##Class)() = init##className; \396 export Class (*get_##framework##_##className##Class)() = init##className; \ 391 397 static Class class##className; \ 392 398 \ … … 409 415 } 410 416 417 #define SOFT_LINK_CLASS_FOR_SOURCE(functionNamespace, framework, className) \ 418 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, className, ) 419 411 420 #define SOFT_LINK_CONSTANT_FOR_HEADER(functionNamespace, framework, variableName, variableType) \ 412 421 WTF_EXTERN_C_BEGIN \ … … 417 426 } 418 427 419 #define SOFT_LINK_CONSTANT_FOR_SOURCE (functionNamespace, framework, variableName, variableType) \428 #define SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, variableName, variableType, export) \ 420 429 WTF_EXTERN_C_BEGIN \ 421 430 extern const variableType variableName; \ 422 431 WTF_EXTERN_C_END \ 423 432 namespace functionNamespace { \ 424 variableType get_##framework##_##variableName(); \433 export variableType get_##framework##_##variableName(); \ 425 434 variableType get_##framework##_##variableName() \ 426 435 { \ … … 435 444 } \ 436 445 } 446 447 #define SOFT_LINK_CONSTANT_FOR_SOURCE(functionNamespace, framework, variableName, variableType) \ 448 SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, variableName, variableType, ) 437 449 438 450 #define SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(functionNamespace, framework, variableName, variableType) \ … … 490 502 } 491 503 492 #define SOFT_LINK_FUNCTION_FOR_SOURCE (functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \504 #define SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames, export) \ 493 505 WTF_EXTERN_C_BEGIN \ 494 506 resultType functionName parameterDeclarations; \ … … 496 508 namespace functionNamespace { \ 497 509 static resultType init##framework##functionName parameterDeclarations; \ 498 resultType(*softLink##framework##functionName) parameterDeclarations = init##framework##functionName; \510 export resultType(*softLink##framework##functionName) parameterDeclarations = init##framework##functionName; \ 499 511 static resultType init##framework##functionName parameterDeclarations \ 500 512 { \ … … 507 519 } \ 508 520 } 521 522 #define SOFT_LINK_FUNCTION_FOR_SOURCE(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \ 523 SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames, ) 509 524 510 525 #define SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \ -
trunk/Source/WebCore/ChangeLog
r238431 r238434 1 2018-11-21 Andy Estes <aestes@apple.com> 2 3 [Cocoa] Create a soft-linking file for PassKit 4 https://bugs.webkit.org/show_bug.cgi?id=191875 5 <rdar://problem/46203215> 6 7 Reviewed by Myles Maxfield. 8 9 * Modules/applepay/cocoa/PaymentContactCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead. 10 * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm: Ditto. 11 * SourcesCocoa.txt: Removed @no-unify from PaymentMerchantSessionCocoa.mm. 12 * WebCore.xcodeproj/project.pbxproj: Removed PaymentMerchantSessionCocoa.mm from the WebCore target. 13 * rendering/RenderThemeCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead. 14 1 15 2018-11-21 Zalan Bujtas <zalan@apple.com> 2 16 -
trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm
r237266 r238434 1 1 /* 2 * Copyright (C) 2016-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2016-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 #import "ApplePayPaymentContact.h" 32 32 #import <Contacts/Contacts.h> 33 #import <pal/ spi/cocoa/PassKitSPI.h>33 #import <pal/cocoa/PassKitSoftLink.h> 34 34 #import <wtf/SoftLinking.h> 35 35 #import <wtf/text/StringBuilder.h> … … 39 39 SOFT_LINK_CLASS(Contacts, CNPhoneNumber) 40 40 41 #if PLATFORM(MAC)42 SOFT_LINK_PRIVATE_FRAMEWORK(PassKit)43 #else44 SOFT_LINK_FRAMEWORK(PassKit)45 #endif46 47 SOFT_LINK_CLASS(PassKit, PKContact)48 49 41 namespace WebCore { 50 42 … … 107 99 static RetainPtr<PKContact> convert(unsigned version, const ApplePayPaymentContact& contact) 108 100 { 109 auto result = adoptNS([ allocPKContactInstance() init]);101 auto result = adoptNS([PAL::allocPKContactInstance() init]); 110 102 111 103 NSString *familyName = nil; -
trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm
r228218 r238434 1 1 /* 2 * Copyright (C) 2016 Apple Inc. All rights reserved.2 * Copyright (C) 2016-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 31 31 #import <JavaScriptCore/JSONObject.h> 32 #import <pal/spi/cocoa/PassKitSPI.h> 33 #import <wtf/SoftLinking.h> 34 35 #if PLATFORM(MAC) 36 SOFT_LINK_PRIVATE_FRAMEWORK(PassKit) 37 #else 38 SOFT_LINK_FRAMEWORK(PassKit) 39 #endif 40 41 SOFT_LINK_CLASS(PassKit, PKPaymentMerchantSession) 32 #import <pal/cocoa/PassKitSoftLink.h> 42 33 43 34 namespace WebCore { … … 54 45 return std::nullopt; 55 46 56 auto pkPaymentMerchantSession = adoptNS([ allocPKPaymentMerchantSessionInstance() initWithDictionary:dictionary]);47 auto pkPaymentMerchantSession = adoptNS([PAL::allocPKPaymentMerchantSessionInstance() initWithDictionary:dictionary]); 57 48 58 49 return PaymentMerchantSession(pkPaymentMerchantSession.get()); -
trunk/Source/WebCore/PAL/ChangeLog
r238360 r238434 1 2018-11-21 Andy Estes <aestes@apple.com> 2 3 [Cocoa] Create a soft-linking file for PassKit 4 https://bugs.webkit.org/show_bug.cgi?id=191875 5 <rdar://problem/46203215> 6 7 Reviewed by Myles Maxfield. 8 9 * PAL.xcodeproj/project.pbxproj: 10 * pal/PlatformMac.cmake: 11 * pal/cocoa/PassKitSoftLink.h: Added. 12 * pal/cocoa/PassKitSoftLink.mm: Added. Used _WITH_EXPORT soft-linking macros in order to 13 make the PAL soft-linking symbols visible to WebKit. 14 * pal/spi/cocoa/PassKitSPI.h: 15 1 16 2018-11-17 Wenson Hsieh <wenson_hsieh@apple.com> 2 17 -
trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
r238014 r238434 132 132 A1175B5A1F6B4A8400C4B9F0 /* NSScrollViewSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B591F6B4A8400C4B9F0 /* NSScrollViewSPI.h */; }; 133 133 A1F55DCF1F5528EC00EDB75F /* MetadataSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F55DCE1F5528EC00EDB75F /* MetadataSPI.h */; }; 134 A1F63C9F21A4DBF7006FB43B /* PassKitSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F63C9D21A4DBF7006FB43B /* PassKitSoftLink.h */; }; 135 A1F63CA021A4DBF7006FB43B /* PassKitSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1F63C9E21A4DBF7006FB43B /* PassKitSoftLink.mm */; }; 134 136 A30D41211F0DD0EA00B71954 /* KillRing.h in Headers */ = {isa = PBXBuildFile; fileRef = A30D411E1F0DD0EA00B71954 /* KillRing.h */; }; 135 137 A30D41221F0DD0EA00B71954 /* KillRing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A30D411F1F0DD0EA00B71954 /* KillRing.cpp */; }; … … 288 290 A1175B591F6B4A8400C4B9F0 /* NSScrollViewSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSScrollViewSPI.h; sourceTree = "<group>"; }; 289 291 A1F55DCE1F5528EC00EDB75F /* MetadataSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MetadataSPI.h; sourceTree = "<group>"; }; 292 A1F63C9D21A4DBF7006FB43B /* PassKitSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PassKitSoftLink.h; sourceTree = "<group>"; }; 293 A1F63C9E21A4DBF7006FB43B /* PassKitSoftLink.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PassKitSoftLink.mm; sourceTree = "<group>"; }; 290 294 A30D411E1F0DD0EA00B71954 /* KillRing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KillRing.h; sourceTree = "<group>"; }; 291 295 A30D411F1F0DD0EA00B71954 /* KillRing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KillRing.cpp; sourceTree = "<group>"; }; … … 561 565 children = ( 562 566 F44291661FA52705002CC93E /* FileSizeFormatterCocoa.mm */, 567 A1F63C9D21A4DBF7006FB43B /* PassKitSoftLink.h */, 568 A1F63C9E21A4DBF7006FB43B /* PassKitSoftLink.mm */, 563 569 ); 564 570 path = cocoa; … … 730 736 570AB8F920AF6E3D00B8BE87 /* NSXPCConnectionSPI.h in Headers */, 731 737 0C5AF91F1F43A4C7002EAC02 /* OpenGLESSPI.h in Headers */, 738 A1F63C9F21A4DBF7006FB43B /* PassKitSoftLink.h in Headers */, 732 739 0C2DA1551F3BEB4900DBC317 /* PassKitSPI.h in Headers */, 733 740 0C77859E1F45130F00F4EBB6 /* PIPSPI.h in Headers */, … … 855 862 1C4876D81F8D7F4E00CCEEBD /* Logging.cpp in Sources */, 856 863 0CF99CA41F736375007EE793 /* MediaTimeAVFoundation.cpp in Sources */, 864 A1F63CA021A4DBF7006FB43B /* PassKitSoftLink.mm in Sources */, 857 865 A1175B4F1F6B337300C4B9F0 /* PopupMenu.mm in Sources */, 858 866 A3C66CDC1F462D6A009E6EE9 /* SessionID.cpp in Sources */, -
trunk/Source/WebCore/PAL/pal/PlatformMac.cmake
r232660 r238434 3 3 4 4 cf/CoreMediaSoftLink.h 5 6 cocoa/PassKitSoftLink.h 5 7 6 8 spi/cf/CFLocaleSPI.h … … 97 99 cocoa/FileSizeFormatterCocoa.mm 98 100 cocoa/LoggingCocoa.mm 101 cocoa/PassKitSoftLink.mm 99 102 100 103 crypto/commoncrypto/CryptoDigestCommonCrypto.cpp … … 115 118 "${PAL_DIR}/pal/avfoundation" 116 119 "${PAL_DIR}/pal/cf" 120 "${PAL_DIR}/pal/cocoa" 117 121 "${PAL_DIR}/pal/spi/cf" 118 122 "${PAL_DIR}/pal/spi/cg" -
trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h
r237607 r238434 1 1 /* 2 * Copyright (C) 2016-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2016-2018 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 26 26 #pragma once 27 27 28 #if !PLATFORM(MAC) || USE(APPLE_INTERNAL_SDK) 29 30 // FIXME: PassKit does not declare its NSString constant symbols with C linkage, so we end up with 31 // linkage mismatches in the SOFT_LINK_CONSTANT macros used in PassKitSoftLink.mm unless we wrap 32 // these includes in an extern "C" block. 33 WTF_EXTERN_C_BEGIN 34 #import <PassKit/PKConstants.h> 35 #import <PassKit/PKError.h> 36 WTF_EXTERN_C_END 37 38 #endif 39 28 40 #if USE(APPLE_INTERNAL_SDK) 29 41 … … 40 52 #elif PLATFORM(MAC) 41 53 54 #import <AppKit/AppKit.h> 42 55 #import <Contacts/Contacts.h> 43 #import <Foundation/Foundation.h>44 56 45 57 NS_ASSUME_NONNULL_BEGIN … … 54 66 55 67 typedef NSString *PKContactField; 68 typedef NSString *PKPaymentErrorKey; 56 69 57 70 extern NSString * const PKPaymentErrorDomain; … … 226 239 NS_ASSUME_NONNULL_END 227 240 228 #endif 241 #endif // PLATFORM(MAC) 229 242 230 243 NS_ASSUME_NONNULL_BEGIN … … 262 275 NS_ASSUME_NONNULL_END 263 276 264 #endif 277 #endif // USE(APPLE_INTERNAL_SDK) 265 278 266 279 #if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK) … … 325 338 @end 326 339 340 typedef void(^PKCanMakePaymentsCompletion)(BOOL isValid, NSError *); 341 327 342 NS_ASSUME_NONNULL_END -
trunk/Source/WebCore/SourcesCocoa.txt
r238419 r238434 588 588 Modules/applepay/cocoa/PaymentCocoa.mm 589 589 Modules/applepay/cocoa/PaymentContactCocoa.mm 590 Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm @no-unify590 Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm 591 591 Modules/applepay/cocoa/PaymentMethodCocoa.mm 592 592 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r238419 r238434 4483 4483 DE5F860E1FA2386B006DB63A /* UnifiedSource479.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE5F85CF1FA23850006DB63A /* UnifiedSource479.cpp */; }; 4484 4484 DE5F860F1FA2386B006DB63A /* UnifiedSource480.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE5F85D31FA23859006DB63A /* UnifiedSource480.cpp */; }; 4485 DE5F86101FA238D9006DB63A /* PaymentMerchantSessionCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ADA4A1B1D22F2C0005A9A15 /* PaymentMerchantSessionCocoa.mm */; };4486 4485 DE5F86111FA239DA006DB63A /* InternalSettingsGenerated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53E29E5C167A8A1900586D3D /* InternalSettingsGenerated.cpp */; }; 4487 4486 DE5F86121FA239E7006DB63A /* JSGCObservation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51714EAE1CF6654A004723C4 /* JSGCObservation.cpp */; }; … … 32427 32426 31078CC71880AAB5008099DC /* OESTextureHalfFloatLinear.cpp in Sources */, 32428 32427 77A17A7112F28182004E02F6 /* OESVertexArrayObject.cpp in Sources */, 32429 DE5F86101FA238D9006DB63A /* PaymentMerchantSessionCocoa.mm in Sources */,32430 32428 CEA284662141E84900E407E8 /* PlatformEventFactoryIOS.mm in Sources */, 32431 32429 AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerIOS.mm in Sources */, -
trunk/Source/WebCore/rendering/RenderThemeCocoa.mm
r238078 r238434 33 33 #if ENABLE(APPLE_PAY) 34 34 35 #import <pal/spi/cocoa/PassKitSPI.h> 36 #import <wtf/SoftLinking.h> 37 38 #if PLATFORM(MAC) 39 SOFT_LINK_PRIVATE_FRAMEWORK(PassKit); 40 #else 41 SOFT_LINK_FRAMEWORK(PassKit); 42 #endif 43 44 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)); 35 #import <pal/cocoa/PassKitSoftLink.h> 45 36 46 37 #endif // ENABLE(APPLE_PAY) … … 109 100 bool RenderThemeCocoa::paintApplePayButton(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& paintRect) 110 101 { 111 if (!canLoadPKDrawApplePayButton())112 return false;113 114 102 GraphicsContextStateSaver stateSaver(paintInfo.context()); 115 103 -
trunk/Source/WebKit/ChangeLog
r238432 r238434 1 2018-11-21 Andy Estes <aestes@apple.com> 2 3 [Cocoa] Create a soft-linking file for PassKit 4 https://bugs.webkit.org/show_bug.cgi?id=191875 5 <rdar://problem/46203215> 6 7 Reviewed by Myles Maxfield. 8 9 * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead. 10 * SourcesCocoa.txt: Removed @no-unify from WebPaymentCoordinatorProxyIOS.mm and WebPaymentCoordinatorProxyMac.mm. 11 * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead. 12 * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Ditto. 13 * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Ditto. 14 * UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm: Included NSAttributedStringSPI.h. 15 * UIProcess/mac/WebProcessProxyMac.mm: Included ProcessPrivilege.h. 16 * WebKit.xcodeproj/project.pbxproj: Removed WebPaymentCoordinatorProxyIOS.mm and WebPaymentCoordinatorProxyMac.mm from the WebKit target. 17 1 18 2018-11-21 Fujii Hironori <Hironori.Fujii@sony.com> 2 19 -
trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
r235823 r238434 31 31 #import "DataReference.h" 32 32 #import <WebCore/PaymentAuthorizationStatus.h> 33 #import <pal/cocoa/PassKitSoftLink.h> 33 34 #import <pal/spi/cocoa/NSKeyedArchiverSPI.h> 34 #import <pal/spi/cocoa/PassKitSPI.h>35 #import <wtf/SoftLinking.h>36 37 #if PLATFORM(MAC)38 SOFT_LINK_PRIVATE_FRAMEWORK(PassKit)39 #else40 SOFT_LINK_FRAMEWORK(PassKit)41 #endif42 43 SOFT_LINK_CLASS(PassKit, PKContact);44 SOFT_LINK_CLASS(PassKit, PKPayment);45 SOFT_LINK_CLASS(PassKit, PKPaymentMethod);46 SOFT_LINK_CLASS(PassKit, PKPaymentMerchantSession);47 35 48 36 namespace IPC { … … 68 56 auto unarchiver = secureUnarchiverFromData(data.get()); 69 57 @try { 70 PKPayment *pkPayment = [unarchiver decodeObjectOfClass: getPKPaymentClass() forKey:NSKeyedArchiveRootObjectKey];58 PKPayment *pkPayment = [unarchiver decodeObjectOfClass:PAL::get_PassKit_PKPaymentClass() forKey:NSKeyedArchiveRootObjectKey]; 71 59 payment = Payment(pkPayment); 72 60 } @catch (NSException *exception) { … … 119 107 auto unarchiver = secureUnarchiverFromData(data.get()); 120 108 @try { 121 PKContact *pkContact = [unarchiver decodeObjectOfClass: getPKContactClass() forKey:NSKeyedArchiveRootObjectKey];109 PKContact *pkContact = [unarchiver decodeObjectOfClass:PAL::get_PassKit_PKContactClass() forKey:NSKeyedArchiveRootObjectKey]; 122 110 paymentContact = PaymentContact(pkContact); 123 111 } @catch (NSException *exception) { … … 176 164 auto unarchiver = secureUnarchiverFromData(data.get()); 177 165 @try { 178 PKPaymentMerchantSession *pkPaymentMerchantSession = [unarchiver decodeObjectOfClass: getPKPaymentMerchantSessionClass() forKey:NSKeyedArchiveRootObjectKey];166 PKPaymentMerchantSession *pkPaymentMerchantSession = [unarchiver decodeObjectOfClass:PAL::get_PassKit_PKPaymentMerchantSessionClass() forKey:NSKeyedArchiveRootObjectKey]; 179 167 paymentMerchantSession = PaymentMerchantSession(pkPaymentMerchantSession); 180 168 } @catch (NSException *exception) { … … 206 194 auto unarchiver = secureUnarchiverFromData(data.get()); 207 195 @try { 208 PKPaymentMethod *pkPaymentMethod = [unarchiver decodeObjectOfClass: getPKPaymentMethodClass() forKey:NSKeyedArchiveRootObjectKey];196 PKPaymentMethod *pkPaymentMethod = [unarchiver decodeObjectOfClass:PAL::get_PassKit_PKPaymentMethodClass() forKey:NSKeyedArchiveRootObjectKey]; 209 197 paymentMethod = PaymentMethod(pkPaymentMethod); 210 198 } @catch (NSException *exception) { -
trunk/Source/WebKit/SourcesCocoa.txt
r238350 r238434 295 295 UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm 296 296 297 UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm @no-unify298 299 UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm @no-unify297 UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm 298 299 UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm 300 300 301 301 UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm -
trunk/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
r237607 r238434 34 34 #import <WebCore/PaymentHeaders.h> 35 35 #import <WebCore/URL.h> 36 #import <pal/ spi/cocoa/PassKitSPI.h>36 #import <pal/cocoa/PassKitSoftLink.h> 37 37 #import <wtf/BlockPtr.h> 38 38 #import <wtf/RunLoop.h> 39 #import <wtf/SoftLinking.h> 40 41 #if PLATFORM(MAC) 42 SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(PassKit) 43 #else 44 SOFT_LINK_FRAMEWORK(PassKit) 45 #endif 46 47 SOFT_LINK_CLASS(PassKit, PKPassLibrary); 48 SOFT_LINK_CLASS(PassKit, PKPaymentAuthorizationViewController); 49 SOFT_LINK_CLASS(PassKit, PKPaymentMerchantSession); 50 SOFT_LINK_CLASS(PassKit, PKPaymentRequest); 51 SOFT_LINK_CLASS(PassKit, PKPaymentSummaryItem); 52 SOFT_LINK_CLASS(PassKit, PKShippingMethod); 53 54 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 39 40 #if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300) 55 41 SOFT_LINK_FRAMEWORK(Contacts) 56 42 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressStreetKey, NSString *); … … 62 48 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressCountryKey, NSString *); 63 49 SOFT_LINK_CONSTANT(Contacts, CNPostalAddressISOCountryCodeKey, NSString *); 64 SOFT_LINK_CLASS(PassKit, PKPaymentAuthorizationResult) 65 SOFT_LINK_CLASS(PassKit, PKPaymentRequestPaymentMethodUpdate) 66 SOFT_LINK_CLASS(PassKit, PKPaymentRequestShippingContactUpdate) 67 SOFT_LINK_CLASS(PassKit, PKPaymentRequestShippingMethodUpdate) 68 SOFT_LINK_CONSTANT(PassKit, PKPaymentErrorDomain, NSString *); 69 SOFT_LINK_CONSTANT(PassKit, PKContactFieldPostalAddress, NSString *); 70 SOFT_LINK_CONSTANT(PassKit, PKContactFieldEmailAddress, NSString *); 71 SOFT_LINK_CONSTANT(PassKit, PKContactFieldPhoneNumber, NSString *); 72 SOFT_LINK_CONSTANT(PassKit, PKContactFieldName, NSString *); 73 SOFT_LINK_CONSTANT(PassKit, PKContactFieldPhoneticName, NSString *); 74 SOFT_LINK_CONSTANT(PassKit, PKPaymentErrorContactFieldUserInfoKey, NSString *); 75 SOFT_LINK_CONSTANT(PassKit, PKPaymentErrorPostalAddressUserInfoKey, NSString *); 76 #endif 77 78 typedef void (^PKCanMakePaymentsCompletion)(BOOL isValid, NSError *error); 79 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 80 extern "C" void PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(NSString *identifier, NSString *domain, NSString *sourceApplicationSecondaryIdentifier, PKCanMakePaymentsCompletion completion); 81 SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebKit, PassKit, PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication, void, (NSString *identifier, NSString *domain, NSString *sourceApplicationSecondaryIdentifier, PKCanMakePaymentsCompletion completion), (identifier, domain, sourceApplicationSecondaryIdentifier, completion)); 82 #else 83 extern "C" void PKCanMakePaymentsWithMerchantIdentifierAndDomain(NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion); 84 SOFT_LINK_FUNCTION_MAY_FAIL_FOR_SOURCE(WebKit, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion)); 85 #endif 86 50 SOFT_LINK_CONSTANT(PAL::PassKit, PKPaymentErrorDomain, NSString *); 51 #endif 87 52 88 53 @implementation WKPaymentAuthorizationViewControllerDelegate … … 103 68 if (_paymentAuthorizedCompletion) { 104 69 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 105 _paymentAuthorizedCompletion(adoptNS([ allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get());70 _paymentAuthorizedCompletion(adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get()); 106 71 #else 107 72 _paymentAuthorizedCompletion(PKPaymentAuthorizationStatusFailure); … … 120 85 _sessionBlock = sessionBlock; 121 86 122 [ getPKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURL:^(NSURL *merchantURL, NSError *error) {87 [PAL::get_PassKit_PKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURL:^(NSURL *merchantURL, NSError *error) { 123 88 if (error) 124 89 LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error); … … 156 121 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 157 122 if (!_webPaymentCoordinatorProxy) { 158 completion(adoptNS([ allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get());123 completion(adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get()); 159 124 return; 160 125 } … … 171 136 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 172 137 if (!_webPaymentCoordinatorProxy) { 173 completion(adoptNS([ allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());138 completion(adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get()); 174 139 return; 175 140 } … … 184 149 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 185 150 if (!_webPaymentCoordinatorProxy) { 186 completion(adoptNS([ allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());151 completion(adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get()); 187 152 return; 188 153 } … … 198 163 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 199 164 if (!_webPaymentCoordinatorProxy) { 200 completion(adoptNS([ allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[ ] paymentSummaryItems:@[ ] shippingMethods:@[ ]]).get());165 completion(adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[ ] paymentSummaryItems:@[ ] shippingMethods:@[ ]]).get()); 201 166 return; 202 167 } … … 294 259 bool WebPaymentCoordinatorProxy::platformCanMakePayments() 295 260 { 296 #if PLATFORM(MAC) 297 if (!PassKitLibrary()) 298 return false; 299 #endif 300 301 return [getPKPaymentAuthorizationViewControllerClass() canMakePayments]; 261 return [PAL::get_PassKit_PKPaymentAuthorizationViewControllerClass() canMakePayments]; 302 262 } 303 263 304 264 void WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) 305 265 { 306 #if PLATFORM(MAC) 307 if (!PassKitLibrary()) { 308 completionHandler(false); 309 return; 310 } 311 #endif 312 313 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 314 if (!canLoad_PassKit_PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication()) { 315 RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler)] { 316 completionHandler(false); 317 }); 318 return; 319 } 320 321 softLink_PassKit_PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(merchantIdentifier, domainName, m_webPageProxy.process().processPool().configuration().sourceApplicationSecondaryIdentifier(), BlockPtr<void (BOOL, NSError *)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable { 266 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 267 PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(merchantIdentifier, domainName, m_webPageProxy.process().processPool().configuration().sourceApplicationSecondaryIdentifier(), BlockPtr<void(BOOL, NSError *)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable { 322 268 if (error) 323 269 LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error); … … 328 274 }).get()); 329 275 #else 330 if (!canLoad_PassKit_PKCanMakePaymentsWithMerchantIdentifierAndDomain()) { 331 RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler)] { 332 completionHandler(false); 333 }); 334 return; 335 } 336 337 softLink_PassKit_PKCanMakePaymentsWithMerchantIdentifierAndDomain(merchantIdentifier, domainName, BlockPtr<void (BOOL, NSError *)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable { 276 PKCanMakePaymentsWithMerchantIdentifierAndDomain(merchantIdentifier, domainName, BlockPtr<void(BOOL, NSError *)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable { 338 277 if (error) 339 278 LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error); … … 348 287 void WebPaymentCoordinatorProxy::platformOpenPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler) 349 288 { 350 #if PLATFORM(MAC) 351 if (!PassKitLibrary()) { 352 completionHandler(false); 353 return; 354 } 355 #endif 356 357 auto passLibrary = adoptNS([allocPKPassLibraryInstance() init]); 289 auto passLibrary = adoptNS([PAL::allocPKPassLibraryInstance() init]); 358 290 [passLibrary openPaymentSetupForMerchantIdentifier:merchantIdentifier domain:domainName completion:BlockPtr<void (BOOL)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL result) mutable { 359 291 RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler), result] { … … 369 301 370 302 if (contactFields.postalAddress) 371 result.append( getPKContactFieldPostalAddress());303 result.append(PAL::get_PassKit_PKContactFieldPostalAddress()); 372 304 if (contactFields.phone) 373 result.append( getPKContactFieldPhoneNumber());305 result.append(PAL::get_PassKit_PKContactFieldPhoneNumber()); 374 306 if (contactFields.email) 375 result.append( getPKContactFieldEmailAddress());307 result.append(PAL::get_PassKit_PKContactFieldEmailAddress()); 376 308 if (contactFields.name) 377 result.append( getPKContactFieldName());309 result.append(PAL::get_PassKit_PKContactFieldName()); 378 310 if (contactFields.phoneticName) 379 result.append( getPKContactFieldPhoneticName());311 result.append(PAL::get_PassKit_PKContactFieldPhoneticName()); 380 312 381 313 return adoptNS([[NSSet alloc] initWithObjects:result.data() count:result.size()]); … … 419 351 static RetainPtr<PKPaymentSummaryItem> toPKPaymentSummaryItem(const WebCore::ApplePaySessionPaymentRequest::LineItem& lineItem) 420 352 { 421 return [ getPKPaymentSummaryItemClass() summaryItemWithLabel:lineItem.label amount:toDecimalNumber(lineItem.amount) type:toPKPaymentSummaryItemType(lineItem.type)];353 return [PAL::get_PassKit_PKPaymentSummaryItemClass() summaryItemWithLabel:lineItem.label amount:toDecimalNumber(lineItem.amount) type:toPKPaymentSummaryItemType(lineItem.type)]; 422 354 } 423 355 … … 478 410 static RetainPtr<PKShippingMethod> toPKShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod& shippingMethod) 479 411 { 480 RetainPtr<PKShippingMethod> result = [ getPKShippingMethodClass() summaryItemWithLabel:shippingMethod.label amount:toDecimalNumber(shippingMethod.amount)];412 RetainPtr<PKShippingMethod> result = [PAL::get_PassKit_PKShippingMethodClass() summaryItemWithLabel:shippingMethod.label amount:toDecimalNumber(shippingMethod.amount)]; 481 413 [result setIdentifier:shippingMethod.identifier]; 482 414 [result setDetail:shippingMethod.detail]; … … 513 445 RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy& webPageProxy, const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest& paymentRequest) 514 446 { 515 auto result = adoptNS([ allocPKPaymentRequestInstance() init]);447 auto result = adoptNS([PAL::allocPKPaymentRequestInstance() init]); 516 448 517 449 [result setOriginatingURL:originatingURL]; … … 633 565 switch (*error.contactField) { 634 566 case WebCore::PaymentError::ContactField::PhoneNumber: 635 pkContactField = getPKContactFieldPhoneNumber();567 pkContactField = PAL::get_PassKit_PKContactFieldPhoneNumber(); 636 568 break; 637 569 638 570 case WebCore::PaymentError::ContactField::EmailAddress: 639 pkContactField = getPKContactFieldEmailAddress();571 pkContactField = PAL::get_PassKit_PKContactFieldEmailAddress(); 640 572 break; 641 573 642 574 case WebCore::PaymentError::ContactField::Name: 643 pkContactField = getPKContactFieldName();575 pkContactField = PAL::get_PassKit_PKContactFieldName(); 644 576 break; 645 577 646 578 case WebCore::PaymentError::ContactField::PhoneticName: 647 pkContactField = getPKContactFieldPhoneticName();579 pkContactField = PAL::get_PassKit_PKContactFieldPhoneticName(); 648 580 break; 649 581 650 582 case WebCore::PaymentError::ContactField::PostalAddress: 651 pkContactField = getPKContactFieldPostalAddress();583 pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); 652 584 break; 653 585 654 586 case WebCore::PaymentError::ContactField::AddressLines: 655 pkContactField = getPKContactFieldPostalAddress();587 pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); 656 588 postalAddressKey = getCNPostalAddressStreetKey(); 657 589 break; 658 590 659 591 case WebCore::PaymentError::ContactField::SubLocality: 660 pkContactField = getPKContactFieldPostalAddress();592 pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); 661 593 postalAddressKey = getCNPostalAddressSubLocalityKey(); 662 594 break; 663 595 664 596 case WebCore::PaymentError::ContactField::Locality: 665 pkContactField = getPKContactFieldPostalAddress();597 pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); 666 598 postalAddressKey = getCNPostalAddressCityKey(); 667 599 break; 668 600 669 601 case WebCore::PaymentError::ContactField::PostalCode: 670 pkContactField = getPKContactFieldPostalAddress();602 pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); 671 603 postalAddressKey = getCNPostalAddressPostalCodeKey(); 672 604 break; 673 605 674 606 case WebCore::PaymentError::ContactField::SubAdministrativeArea: 675 pkContactField = getPKContactFieldPostalAddress();607 pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); 676 608 postalAddressKey = getCNPostalAddressSubAdministrativeAreaKey(); 677 609 break; 678 610 679 611 case WebCore::PaymentError::ContactField::AdministrativeArea: 680 pkContactField = getPKContactFieldPostalAddress();612 pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); 681 613 postalAddressKey = getCNPostalAddressStateKey(); 682 614 break; 683 615 684 616 case WebCore::PaymentError::ContactField::Country: 685 pkContactField = getPKContactFieldPostalAddress();617 pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); 686 618 postalAddressKey = getCNPostalAddressCountryKey(); 687 619 break; 688 620 689 621 case WebCore::PaymentError::ContactField::CountryCode: 690 pkContactField = getPKContactFieldPostalAddress();622 pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); 691 623 postalAddressKey = getCNPostalAddressISOCountryCodeKey(); 692 624 break; 693 625 } 694 626 695 [userInfo setObject:pkContactField forKey: getPKPaymentErrorContactFieldUserInfoKey()];627 [userInfo setObject:pkContactField forKey:PAL::get_PassKit_PKPaymentErrorContactFieldUserInfoKey()]; 696 628 if (postalAddressKey) 697 [userInfo setObject:postalAddressKey forKey: getPKPaymentErrorPostalAddressUserInfoKey()];629 [userInfo setObject:postalAddressKey forKey:PAL::get_PassKit_PKPaymentErrorPostalAddressUserInfoKey()]; 698 630 } 699 631 … … 762 694 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 763 695 auto status = result ? result->status : WebCore::PaymentAuthorizationStatus::Success; 764 auto pkPaymentAuthorizationResult = adoptNS([ allocPKPaymentAuthorizationResultInstance() initWithStatus:toPKPaymentAuthorizationStatus(status) errors:result ? toNSErrors(result->errors).get() : @[ ]]);696 auto pkPaymentAuthorizationResult = adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:toPKPaymentAuthorizationStatus(status) errors:result ? toNSErrors(result->errors).get() : @[ ]]); 765 697 m_paymentAuthorizationViewControllerDelegate->_paymentAuthorizedCompletion(pkPaymentAuthorizationResult.get()); 766 698 #else … … 788 720 789 721 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 790 auto pkShippingMethodUpdate = adoptNS([ allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get()]);722 auto pkShippingMethodUpdate = adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get()]); 791 723 m_paymentAuthorizationViewControllerDelegate->_didSelectShippingMethodCompletion(pkShippingMethodUpdate.get()); 792 724 #else … … 840 772 841 773 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 842 auto pkShippingContactUpdate = adoptNS([ allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:update ? toNSErrors(update->errors).get() : @[ ] paymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get() shippingMethods:m_paymentAuthorizationViewControllerDelegate->_shippingMethods.get()]);774 auto pkShippingContactUpdate = adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:update ? toNSErrors(update->errors).get() : @[ ] paymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get() shippingMethods:m_paymentAuthorizationViewControllerDelegate->_shippingMethods.get()]); 843 775 m_paymentAuthorizationViewControllerDelegate->_didSelectShippingContactCompletion(pkShippingContactUpdate.get()); 844 776 #else … … 857 789 858 790 #if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) 859 auto pkPaymentMethodUpdate = adoptNS([ allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get()]);791 auto pkPaymentMethodUpdate = adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get()]); 860 792 m_paymentAuthorizationViewControllerDelegate->_didSelectPaymentMethodCompletion(pkPaymentMethodUpdate.get()); 861 793 #else … … 867 799 Vector<String> WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks() 868 800 { 869 #if PLATFORM(MAC) 870 if (!PassKitLibrary()) 871 return { }; 872 #endif 873 874 NSArray<PKPaymentNetwork> *availableNetworks = [getPKPaymentRequestClass() availableNetworks]; 801 NSArray<PKPaymentNetwork> *availableNetworks = [PAL::get_PassKit_PKPaymentRequestClass() availableNetworks]; 875 802 Vector<String> result; 876 803 result.reserveInitialCapacity(availableNetworks.count); -
trunk/Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm
r237266 r238434 35 35 #import <UIKit/UIViewController.h> 36 36 #import <WebCore/PaymentAuthorizationStatus.h> 37 #import <wtf/SoftLinking.h> 38 39 SOFT_LINK_FRAMEWORK(PassKit) 40 SOFT_LINK_CLASS(PassKit, PKPaymentAuthorizationViewController); 37 #import <pal/cocoa/PassKitSoftLink.h> 41 38 42 39 namespace WebKit { … … 55 52 auto paymentRequest = toPKPaymentRequest(m_webPageProxy, originatingURL, linkIconURLStrings, request); 56 53 57 m_paymentAuthorizationViewController = adoptNS([ allocPKPaymentAuthorizationViewControllerInstance() initWithPaymentRequest:paymentRequest.get()]);54 m_paymentAuthorizationViewController = adoptNS([PAL::allocPKPaymentAuthorizationViewControllerInstance() initWithPaymentRequest:paymentRequest.get()]); 58 55 if (!m_paymentAuthorizationViewController) { 59 56 completionHandler(false); -
trunk/Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm
r232613 r238434 31 31 #import "WebPageProxy.h" 32 32 #import "WebPaymentCoordinatorProxyCocoa.h" 33 #import <pal/ spi/cocoa/PassKitSPI.h>33 #import <pal/cocoa/PassKitSoftLink.h> 34 34 #import <wtf/BlockPtr.h> 35 #import <wtf/SoftLinking.h>36 37 SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(PassKit)38 39 SOFT_LINK_CLASS(PassKit, PKPaymentAuthorizationViewController);40 SOFT_LINK_CONSTANT(PassKit, PKExtensionPaymentAuthorizationUIExtensionPointName, NSString *);41 35 42 36 namespace WebKit { … … 44 38 void WebPaymentCoordinatorProxy::platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, WTF::Function<void (bool)>&& completionHandler) 45 39 { 46 if (!PassKitLibrary()) {47 completionHandler(false);48 return;49 }50 51 40 auto paymentRequest = toPKPaymentRequest(m_webPageProxy, originatingURL, linkIconURLStrings, request); 52 41 53 42 auto showPaymentUIRequestSeed = m_showPaymentUIRequestSeed; 54 43 auto weakThis = makeWeakPtr(*this); 55 [ getPKPaymentAuthorizationViewControllerClass() requestViewControllerWithPaymentRequest:paymentRequest.get() completion:BlockPtr<void(PKPaymentAuthorizationViewController *, NSError *)>::fromCallable([paymentRequest, showPaymentUIRequestSeed, weakThis, completionHandler = WTFMove(completionHandler)](PKPaymentAuthorizationViewController *viewController, NSError *error) {44 [PAL::get_PassKit_PKPaymentAuthorizationViewControllerClass() requestViewControllerWithPaymentRequest:paymentRequest.get() completion:BlockPtr<void(PKPaymentAuthorizationViewController *, NSError *)>::fromCallable([paymentRequest, showPaymentUIRequestSeed, weakThis, completionHandler = WTFMove(completionHandler)](PKPaymentAuthorizationViewController *viewController, NSError *error) { 56 45 auto paymentCoordinatorProxy = weakThis.get(); 57 46 if (!paymentCoordinatorProxy) -
trunk/Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm
r238190 r238434 29 29 #import "SafeBrowsingSPI.h" 30 30 #import <WebCore/LocalizedStrings.h> 31 #import <pal/spi/cocoa/NSAttributedStringSPI.h> 31 32 #import <wtf/Language.h> 32 33 -
trunk/Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm
r238184 r238434 31 31 32 32 #import "WKFullKeyboardAccessWatcher.h" 33 #import <wtf/ProcessPrivilege.h> 33 34 34 35 #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400 -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r238432 r238434 685 685 2D92A796212B6ADA00F493FD /* NetscapePluginModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4A9C5312B816CF008FE984 /* NetscapePluginModule.cpp */; }; 686 686 2D92A797212B6ADA00F493FD /* PluginInformation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7C3F8C8E173AF52D007B7F39 /* PluginInformation.cpp */; }; 687 2D92A79821348D8500F493FD /* WebPaymentCoordinatorProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F77D1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyMac.mm */; };688 2D92A79F2134B07E00F493FD /* WebPaymentCoordinatorProxyIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AB1F77B1D1B30A9007C9BD1 /* WebPaymentCoordinatorProxyIOS.mm */; };689 687 2D931169212F61B200044BFE /* WKContentView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E3D18BBE044000FCFC9 /* WKContentView.mm */; }; 690 688 2D93116A212F61B500044BFE /* WKContentViewInteraction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E6B18BBF26A000FCFC9 /* WKContentViewInteraction.mm */; }; … … 11007 11005 7C4694C91A4B4EA100AD5845 /* WebPasteboardProxyMessageReceiver.cpp in Sources */, 11008 11006 1AB1F7961D1B3613007C9BD1 /* WebPaymentCoordinatorMessageReceiver.cpp in Sources */, 11009 2D92A79F2134B07E00F493FD /* WebPaymentCoordinatorProxyIOS.mm in Sources */,11010 2D92A79821348D8500F493FD /* WebPaymentCoordinatorProxyMac.mm in Sources */,11011 11007 1AB1F7981D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessageReceiver.cpp in Sources */, 11012 11008 2D92A78D212B6AB100F493FD /* WebPlatformTouchPoint.cpp in Sources */,
Note:
See TracChangeset
for help on using the changeset viewer.