⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 238434 in webkit


Ignore:
Timestamp:
Nov 21, 2018, 6:12:04 PM (8 years ago)
Author:
aestes@apple.com
Message:

[Cocoa] Create a soft-linking file for PassKit
https://bugs.webkit.org/show_bug.cgi?id=191875
<rdar://problem/46203215>

Reviewed by Myles Maxfield.

Source/WebCore:

  • 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.

Source/WebCore/PAL:

  • 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:

Source/WebKit:

  • 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.

Source/WTF:

  • 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.

Location:
trunk/Source
Files:
2 added
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r238414 r238434  
     12018-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
    1142018-11-21  Dominik Infuehr  <dinfuehr@igalia.com>
    215
  • trunk/Source/WTF/wtf/Platform.h

    r238414 r238434  
    617617#if PLATFORM(MAC)
    618618
    619 #define USE_APPKIT 1
    620619#define HAVE_RUNLOOP_TIMER 1
    621620#define HAVE_SEC_KEYCHAIN 1
     621#define USE_APPKIT 1
     622#define USE_PASSKIT 1
    622623
    623624#if CPU(X86_64)
     
    10611062
    10621063#if PLATFORM(IOS)
     1064#define HAVE_APP_LINKS 1
     1065#define USE_PASSKIT 1
    10631066#define USE_QUICK_LOOK 1
    10641067#define USE_SYSTEM_PREVIEW 1
    1065 #define HAVE_APP_LINKS 1
    10661068#endif
    10671069
  • trunk/Source/WTF/wtf/cocoa/SoftLinking.h

    r237620 r238434  
    11/*
    2  * Copyright (C) 2007, 2008, 2011-2015 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    341341    }
    342342
    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); \
    346346    void* framework##Library(bool isOptional) \
    347347    { \
     
    357357    }
    358358
    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); \
    362365    void* framework##Library(bool isOptional) \
    363366    { \
     
    373376    }
    374377
     378#define SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(functionNamespace, framework) \
     379    SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, )
     380
    375381#define SOFT_LINK_CLASS_FOR_HEADER(functionNamespace, framework, className) \
    376382    @class className; \
     
    384390    }
    385391
    386 #define SOFT_LINK_CLASS_FOR_SOURCE(functionNamespace, framework, className) \
     392#define SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, className, export) \
    387393    @class className; \
    388394    namespace functionNamespace { \
    389395    static Class init##className(); \
    390     Class (*get_##framework##_##className##Class)() = init##className; \
     396    export Class (*get_##framework##_##className##Class)() = init##className; \
    391397    static Class class##className; \
    392398    \
     
    409415    }
    410416
     417#define SOFT_LINK_CLASS_FOR_SOURCE(functionNamespace, framework, className) \
     418    SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, className, )
     419
    411420#define SOFT_LINK_CONSTANT_FOR_HEADER(functionNamespace, framework, variableName, variableType) \
    412421    WTF_EXTERN_C_BEGIN \
     
    417426    }
    418427
    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) \
    420429    WTF_EXTERN_C_BEGIN \
    421430    extern const variableType variableName; \
    422431    WTF_EXTERN_C_END \
    423432    namespace functionNamespace { \
    424     variableType get_##framework##_##variableName(); \
     433    export variableType get_##framework##_##variableName(); \
    425434    variableType get_##framework##_##variableName() \
    426435    { \
     
    435444    } \
    436445    }
     446
     447#define SOFT_LINK_CONSTANT_FOR_SOURCE(functionNamespace, framework, variableName, variableType) \
     448    SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, variableName, variableType, )
    437449
    438450#define SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(functionNamespace, framework, variableName, variableType) \
     
    490502    }
    491503
    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) \
    493505    WTF_EXTERN_C_BEGIN \
    494506    resultType functionName parameterDeclarations; \
     
    496508    namespace functionNamespace { \
    497509    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; \
    499511    static resultType init##framework##functionName parameterDeclarations \
    500512    { \
     
    507519    } \
    508520    }
     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, )
    509524
    510525#define SOFT_LINK_FUNCTION_MAY_FAIL_FOR_HEADER(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \
  • trunk/Source/WebCore/ChangeLog

    r238431 r238434  
     12018-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
    1152018-11-21  Zalan Bujtas  <zalan@apple.com>
    216
  • trunk/Source/WebCore/Modules/applepay/cocoa/PaymentContactCocoa.mm

    r237266 r238434  
    11/*
    2  * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3131#import "ApplePayPaymentContact.h"
    3232#import <Contacts/Contacts.h>
    33 #import <pal/spi/cocoa/PassKitSPI.h>
     33#import <pal/cocoa/PassKitSoftLink.h>
    3434#import <wtf/SoftLinking.h>
    3535#import <wtf/text/StringBuilder.h>
     
    3939SOFT_LINK_CLASS(Contacts, CNPhoneNumber)
    4040
    41 #if PLATFORM(MAC)
    42 SOFT_LINK_PRIVATE_FRAMEWORK(PassKit)
    43 #else
    44 SOFT_LINK_FRAMEWORK(PassKit)
    45 #endif
    46 
    47 SOFT_LINK_CLASS(PassKit, PKContact)
    48 
    4941namespace WebCore {
    5042
     
    10799static RetainPtr<PKContact> convert(unsigned version, const ApplePayPaymentContact& contact)
    108100{
    109     auto result = adoptNS([allocPKContactInstance() init]);
     101    auto result = adoptNS([PAL::allocPKContactInstance() init]);
    110102
    111103    NSString *familyName = nil;
  • trunk/Source/WebCore/Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm

    r228218 r238434  
    11/*
    2  * Copyright (C) 2016 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3030
    3131#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>
    4233
    4334namespace WebCore {
     
    5445        return std::nullopt;
    5546
    56     auto pkPaymentMerchantSession = adoptNS([allocPKPaymentMerchantSessionInstance() initWithDictionary:dictionary]);
     47    auto pkPaymentMerchantSession = adoptNS([PAL::allocPKPaymentMerchantSessionInstance() initWithDictionary:dictionary]);
    5748
    5849    return PaymentMerchantSession(pkPaymentMerchantSession.get());
  • trunk/Source/WebCore/PAL/ChangeLog

    r238360 r238434  
     12018-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
    1162018-11-17  Wenson Hsieh  <wenson_hsieh@apple.com>
    217
  • trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj

    r238014 r238434  
    132132                A1175B5A1F6B4A8400C4B9F0 /* NSScrollViewSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B591F6B4A8400C4B9F0 /* NSScrollViewSPI.h */; };
    133133                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 */; };
    134136                A30D41211F0DD0EA00B71954 /* KillRing.h in Headers */ = {isa = PBXBuildFile; fileRef = A30D411E1F0DD0EA00B71954 /* KillRing.h */; };
    135137                A30D41221F0DD0EA00B71954 /* KillRing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A30D411F1F0DD0EA00B71954 /* KillRing.cpp */; };
     
    288290                A1175B591F6B4A8400C4B9F0 /* NSScrollViewSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSScrollViewSPI.h; sourceTree = "<group>"; };
    289291                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>"; };
    290294                A30D411E1F0DD0EA00B71954 /* KillRing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KillRing.h; sourceTree = "<group>"; };
    291295                A30D411F1F0DD0EA00B71954 /* KillRing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KillRing.cpp; sourceTree = "<group>"; };
     
    561565                        children = (
    562566                                F44291661FA52705002CC93E /* FileSizeFormatterCocoa.mm */,
     567                                A1F63C9D21A4DBF7006FB43B /* PassKitSoftLink.h */,
     568                                A1F63C9E21A4DBF7006FB43B /* PassKitSoftLink.mm */,
    563569                        );
    564570                        path = cocoa;
     
    730736                                570AB8F920AF6E3D00B8BE87 /* NSXPCConnectionSPI.h in Headers */,
    731737                                0C5AF91F1F43A4C7002EAC02 /* OpenGLESSPI.h in Headers */,
     738                                A1F63C9F21A4DBF7006FB43B /* PassKitSoftLink.h in Headers */,
    732739                                0C2DA1551F3BEB4900DBC317 /* PassKitSPI.h in Headers */,
    733740                                0C77859E1F45130F00F4EBB6 /* PIPSPI.h in Headers */,
     
    855862                                1C4876D81F8D7F4E00CCEEBD /* Logging.cpp in Sources */,
    856863                                0CF99CA41F736375007EE793 /* MediaTimeAVFoundation.cpp in Sources */,
     864                                A1F63CA021A4DBF7006FB43B /* PassKitSoftLink.mm in Sources */,
    857865                                A1175B4F1F6B337300C4B9F0 /* PopupMenu.mm in Sources */,
    858866                                A3C66CDC1F462D6A009E6EE9 /* SessionID.cpp in Sources */,
  • trunk/Source/WebCore/PAL/pal/PlatformMac.cmake

    r232660 r238434  
    33
    44    cf/CoreMediaSoftLink.h
     5
     6    cocoa/PassKitSoftLink.h
    57
    68    spi/cf/CFLocaleSPI.h
     
    9799    cocoa/FileSizeFormatterCocoa.mm
    98100    cocoa/LoggingCocoa.mm
     101    cocoa/PassKitSoftLink.mm
    99102
    100103    crypto/commoncrypto/CryptoDigestCommonCrypto.cpp
     
    115118    "${PAL_DIR}/pal/avfoundation"
    116119    "${PAL_DIR}/pal/cf"
     120    "${PAL_DIR}/pal/cocoa"
    117121    "${PAL_DIR}/pal/spi/cf"
    118122    "${PAL_DIR}/pal/spi/cg"
  • trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h

    r237607 r238434  
    11/*
    2  * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
     2 * Copyright (C) 2016-2018 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2626#pragma once
    2727
     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.
     33WTF_EXTERN_C_BEGIN
     34#import <PassKit/PKConstants.h>
     35#import <PassKit/PKError.h>
     36WTF_EXTERN_C_END
     37
     38#endif
     39
    2840#if USE(APPLE_INTERNAL_SDK)
    2941
     
    4052#elif PLATFORM(MAC)
    4153
     54#import <AppKit/AppKit.h>
    4255#import <Contacts/Contacts.h>
    43 #import <Foundation/Foundation.h>
    4456
    4557NS_ASSUME_NONNULL_BEGIN
     
    5466
    5567typedef NSString *PKContactField;
     68typedef NSString *PKPaymentErrorKey;
    5669
    5770extern NSString * const PKPaymentErrorDomain;
     
    226239NS_ASSUME_NONNULL_END
    227240
    228 #endif
     241#endif // PLATFORM(MAC)
    229242
    230243NS_ASSUME_NONNULL_BEGIN
     
    262275NS_ASSUME_NONNULL_END
    263276
    264 #endif
     277#endif // USE(APPLE_INTERNAL_SDK)
    265278
    266279#if PLATFORM(MAC) && !USE(APPLE_INTERNAL_SDK)
     
    325338@end
    326339
     340typedef void(^PKCanMakePaymentsCompletion)(BOOL isValid, NSError *);
     341
    327342NS_ASSUME_NONNULL_END
  • trunk/Source/WebCore/SourcesCocoa.txt

    r238419 r238434  
    588588    Modules/applepay/cocoa/PaymentCocoa.mm
    589589    Modules/applepay/cocoa/PaymentContactCocoa.mm
    590     Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm @no-unify
     590    Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm
    591591    Modules/applepay/cocoa/PaymentMethodCocoa.mm
    592592
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r238419 r238434  
    44834483                DE5F860E1FA2386B006DB63A /* UnifiedSource479.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE5F85CF1FA23850006DB63A /* UnifiedSource479.cpp */; };
    44844484                DE5F860F1FA2386B006DB63A /* UnifiedSource480.cpp in Sources */ = {isa = PBXBuildFile; fileRef = DE5F85D31FA23859006DB63A /* UnifiedSource480.cpp */; };
    4485                 DE5F86101FA238D9006DB63A /* PaymentMerchantSessionCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1ADA4A1B1D22F2C0005A9A15 /* PaymentMerchantSessionCocoa.mm */; };
    44864485                DE5F86111FA239DA006DB63A /* InternalSettingsGenerated.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 53E29E5C167A8A1900586D3D /* InternalSettingsGenerated.cpp */; };
    44874486                DE5F86121FA239E7006DB63A /* JSGCObservation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51714EAE1CF6654A004723C4 /* JSGCObservation.cpp */; };
     
    3242732426                                31078CC71880AAB5008099DC /* OESTextureHalfFloatLinear.cpp in Sources */,
    3242832427                                77A17A7112F28182004E02F6 /* OESVertexArrayObject.cpp in Sources */,
    32429                                 DE5F86101FA238D9006DB63A /* PaymentMerchantSessionCocoa.mm in Sources */,
    3243032428                                CEA284662141E84900E407E8 /* PlatformEventFactoryIOS.mm in Sources */,
    3243132429                                AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerIOS.mm in Sources */,
  • trunk/Source/WebCore/rendering/RenderThemeCocoa.mm

    r238078 r238434  
    3333#if ENABLE(APPLE_PAY)
    3434
    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>
    4536
    4637#endif // ENABLE(APPLE_PAY)
     
    109100bool RenderThemeCocoa::paintApplePayButton(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& paintRect)
    110101{
    111     if (!canLoadPKDrawApplePayButton())
    112         return false;
    113 
    114102    GraphicsContextStateSaver stateSaver(paintInfo.context());
    115103
  • trunk/Source/WebKit/ChangeLog

    r238432 r238434  
     12018-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
    1182018-11-21  Fujii Hironori  <Hironori.Fujii@sony.com>
    219
  • trunk/Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm

    r235823 r238434  
    3131#import "DataReference.h"
    3232#import <WebCore/PaymentAuthorizationStatus.h>
     33#import <pal/cocoa/PassKitSoftLink.h>
    3334#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 #else
    40 SOFT_LINK_FRAMEWORK(PassKit)
    41 #endif
    42 
    43 SOFT_LINK_CLASS(PassKit, PKContact);
    44 SOFT_LINK_CLASS(PassKit, PKPayment);
    45 SOFT_LINK_CLASS(PassKit, PKPaymentMethod);
    46 SOFT_LINK_CLASS(PassKit, PKPaymentMerchantSession);
    4735
    4836namespace IPC {
     
    6856    auto unarchiver = secureUnarchiverFromData(data.get());
    6957    @try {
    70         PKPayment *pkPayment = [unarchiver decodeObjectOfClass:getPKPaymentClass() forKey:NSKeyedArchiveRootObjectKey];
     58        PKPayment *pkPayment = [unarchiver decodeObjectOfClass:PAL::get_PassKit_PKPaymentClass() forKey:NSKeyedArchiveRootObjectKey];
    7159        payment = Payment(pkPayment);
    7260    } @catch (NSException *exception) {
     
    119107    auto unarchiver = secureUnarchiverFromData(data.get());
    120108    @try {
    121         PKContact *pkContact = [unarchiver decodeObjectOfClass:getPKContactClass() forKey:NSKeyedArchiveRootObjectKey];
     109        PKContact *pkContact = [unarchiver decodeObjectOfClass:PAL::get_PassKit_PKContactClass() forKey:NSKeyedArchiveRootObjectKey];
    122110        paymentContact = PaymentContact(pkContact);
    123111    } @catch (NSException *exception) {
     
    176164    auto unarchiver = secureUnarchiverFromData(data.get());
    177165    @try {
    178         PKPaymentMerchantSession *pkPaymentMerchantSession = [unarchiver decodeObjectOfClass:getPKPaymentMerchantSessionClass() forKey:NSKeyedArchiveRootObjectKey];
     166        PKPaymentMerchantSession *pkPaymentMerchantSession = [unarchiver decodeObjectOfClass:PAL::get_PassKit_PKPaymentMerchantSessionClass() forKey:NSKeyedArchiveRootObjectKey];
    179167        paymentMerchantSession = PaymentMerchantSession(pkPaymentMerchantSession);
    180168    } @catch (NSException *exception) {
     
    206194    auto unarchiver = secureUnarchiverFromData(data.get());
    207195    @try {
    208         PKPaymentMethod *pkPaymentMethod = [unarchiver decodeObjectOfClass:getPKPaymentMethodClass() forKey:NSKeyedArchiveRootObjectKey];
     196        PKPaymentMethod *pkPaymentMethod = [unarchiver decodeObjectOfClass:PAL::get_PassKit_PKPaymentMethodClass() forKey:NSKeyedArchiveRootObjectKey];
    209197        paymentMethod = PaymentMethod(pkPaymentMethod);
    210198    } @catch (NSException *exception) {
  • trunk/Source/WebKit/SourcesCocoa.txt

    r238350 r238434  
    295295UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
    296296
    297 UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm @no-unify
    298 
    299 UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm @no-unify
     297UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm
     298
     299UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm
    300300
    301301UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm
  • trunk/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm

    r237607 r238434  
    3434#import <WebCore/PaymentHeaders.h>
    3535#import <WebCore/URL.h>
    36 #import <pal/spi/cocoa/PassKitSPI.h>
     36#import <pal/cocoa/PassKitSoftLink.h>
    3737#import <wtf/BlockPtr.h>
    3838#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)
    5541SOFT_LINK_FRAMEWORK(Contacts)
    5642SOFT_LINK_CONSTANT(Contacts, CNPostalAddressStreetKey, NSString *);
     
    6248SOFT_LINK_CONSTANT(Contacts, CNPostalAddressCountryKey, NSString *);
    6349SOFT_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 
     50SOFT_LINK_CONSTANT(PAL::PassKit, PKPaymentErrorDomain, NSString *);
     51#endif
    8752
    8853@implementation WKPaymentAuthorizationViewControllerDelegate
     
    10368    if (_paymentAuthorizedCompletion) {
    10469#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());
    10671#else
    10772        _paymentAuthorizedCompletion(PKPaymentAuthorizationStatusFailure);
     
    12085    _sessionBlock = sessionBlock;
    12186
    122     [getPKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURL:^(NSURL *merchantURL, NSError *error) {
     87    [PAL::get_PassKit_PKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURL:^(NSURL *merchantURL, NSError *error) {
    12388        if (error)
    12489            LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error);
     
    156121#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
    157122    if (!_webPaymentCoordinatorProxy) {
    158         completion(adoptNS([allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get());
     123        completion(adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get());
    159124        return;
    160125    }
     
    171136#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
    172137    if (!_webPaymentCoordinatorProxy) {
    173         completion(adoptNS([allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());
     138        completion(adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());
    174139        return;
    175140    }
     
    184149#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
    185150    if (!_webPaymentCoordinatorProxy) {
    186         completion(adoptNS([allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());
     151        completion(adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());
    187152        return;
    188153    }
     
    198163#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
    199164    if (!_webPaymentCoordinatorProxy) {
    200         completion(adoptNS([allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[ ] paymentSummaryItems:@[ ] shippingMethods:@[ ]]).get());
     165        completion(adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[ ] paymentSummaryItems:@[ ] shippingMethods:@[ ]]).get());
    201166        return;
    202167    }
     
    294259bool WebPaymentCoordinatorProxy::platformCanMakePayments()
    295260{
    296 #if PLATFORM(MAC)
    297     if (!PassKitLibrary())
    298         return false;
    299 #endif
    300 
    301     return [getPKPaymentAuthorizationViewControllerClass() canMakePayments];
     261    return [PAL::get_PassKit_PKPaymentAuthorizationViewControllerClass() canMakePayments];
    302262}
    303263
    304264void WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler)
    305265{
    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 {
    322268        if (error)
    323269            LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error);
     
    328274    }).get());
    329275#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 {
    338277        if (error)
    339278            LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error);
     
    348287void WebPaymentCoordinatorProxy::platformOpenPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void (bool)>&& completionHandler)
    349288{
    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]);
    358290    [passLibrary openPaymentSetupForMerchantIdentifier:merchantIdentifier domain:domainName completion:BlockPtr<void (BOOL)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL result) mutable {
    359291        RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler), result] {
     
    369301
    370302    if (contactFields.postalAddress)
    371         result.append(getPKContactFieldPostalAddress());
     303        result.append(PAL::get_PassKit_PKContactFieldPostalAddress());
    372304    if (contactFields.phone)
    373         result.append(getPKContactFieldPhoneNumber());
     305        result.append(PAL::get_PassKit_PKContactFieldPhoneNumber());
    374306    if (contactFields.email)
    375         result.append(getPKContactFieldEmailAddress());
     307        result.append(PAL::get_PassKit_PKContactFieldEmailAddress());
    376308    if (contactFields.name)
    377         result.append(getPKContactFieldName());
     309        result.append(PAL::get_PassKit_PKContactFieldName());
    378310    if (contactFields.phoneticName)
    379         result.append(getPKContactFieldPhoneticName());
     311        result.append(PAL::get_PassKit_PKContactFieldPhoneticName());
    380312
    381313    return adoptNS([[NSSet alloc] initWithObjects:result.data() count:result.size()]);
     
    419351static RetainPtr<PKPaymentSummaryItem> toPKPaymentSummaryItem(const WebCore::ApplePaySessionPaymentRequest::LineItem& lineItem)
    420352{
    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)];
    422354}
    423355
     
    478410static RetainPtr<PKShippingMethod> toPKShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod& shippingMethod)
    479411{
    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)];
    481413    [result setIdentifier:shippingMethod.identifier];
    482414    [result setDetail:shippingMethod.detail];
     
    513445RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy& webPageProxy, const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest& paymentRequest)
    514446{
    515     auto result = adoptNS([allocPKPaymentRequestInstance() init]);
     447    auto result = adoptNS([PAL::allocPKPaymentRequestInstance() init]);
    516448
    517449    [result setOriginatingURL:originatingURL];
     
    633565        switch (*error.contactField) {
    634566        case WebCore::PaymentError::ContactField::PhoneNumber:
    635             pkContactField = getPKContactFieldPhoneNumber();
     567            pkContactField = PAL::get_PassKit_PKContactFieldPhoneNumber();
    636568            break;
    637569
    638570        case WebCore::PaymentError::ContactField::EmailAddress:
    639             pkContactField = getPKContactFieldEmailAddress();
     571            pkContactField = PAL::get_PassKit_PKContactFieldEmailAddress();
    640572            break;
    641573
    642574        case WebCore::PaymentError::ContactField::Name:
    643             pkContactField = getPKContactFieldName();
     575            pkContactField = PAL::get_PassKit_PKContactFieldName();
    644576            break;
    645577
    646578        case WebCore::PaymentError::ContactField::PhoneticName:
    647             pkContactField = getPKContactFieldPhoneticName();
     579            pkContactField = PAL::get_PassKit_PKContactFieldPhoneticName();
    648580            break;
    649581
    650582        case WebCore::PaymentError::ContactField::PostalAddress:
    651             pkContactField = getPKContactFieldPostalAddress();
     583            pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
    652584            break;
    653585
    654586        case WebCore::PaymentError::ContactField::AddressLines:
    655             pkContactField = getPKContactFieldPostalAddress();
     587            pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
    656588            postalAddressKey = getCNPostalAddressStreetKey();
    657589            break;
    658590
    659591        case WebCore::PaymentError::ContactField::SubLocality:
    660             pkContactField = getPKContactFieldPostalAddress();
     592            pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
    661593            postalAddressKey = getCNPostalAddressSubLocalityKey();
    662594            break;
    663595
    664596        case WebCore::PaymentError::ContactField::Locality:
    665             pkContactField = getPKContactFieldPostalAddress();
     597            pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
    666598            postalAddressKey = getCNPostalAddressCityKey();
    667599            break;
    668600
    669601        case WebCore::PaymentError::ContactField::PostalCode:
    670             pkContactField = getPKContactFieldPostalAddress();
     602            pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
    671603            postalAddressKey = getCNPostalAddressPostalCodeKey();
    672604            break;
    673605
    674606        case WebCore::PaymentError::ContactField::SubAdministrativeArea:
    675             pkContactField = getPKContactFieldPostalAddress();
     607            pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
    676608            postalAddressKey = getCNPostalAddressSubAdministrativeAreaKey();
    677609            break;
    678610
    679611        case WebCore::PaymentError::ContactField::AdministrativeArea:
    680             pkContactField = getPKContactFieldPostalAddress();
     612            pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
    681613            postalAddressKey = getCNPostalAddressStateKey();
    682614            break;
    683615
    684616        case WebCore::PaymentError::ContactField::Country:
    685             pkContactField = getPKContactFieldPostalAddress();
     617            pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
    686618            postalAddressKey = getCNPostalAddressCountryKey();
    687619            break;
    688620
    689621        case WebCore::PaymentError::ContactField::CountryCode:
    690             pkContactField = getPKContactFieldPostalAddress();
     622            pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress();
    691623            postalAddressKey = getCNPostalAddressISOCountryCodeKey();
    692624            break;
    693625        }
    694626
    695         [userInfo setObject:pkContactField forKey:getPKPaymentErrorContactFieldUserInfoKey()];
     627        [userInfo setObject:pkContactField forKey:PAL::get_PassKit_PKPaymentErrorContactFieldUserInfoKey()];
    696628        if (postalAddressKey)
    697             [userInfo setObject:postalAddressKey forKey:getPKPaymentErrorPostalAddressUserInfoKey()];
     629            [userInfo setObject:postalAddressKey forKey:PAL::get_PassKit_PKPaymentErrorPostalAddressUserInfoKey()];
    698630    }
    699631
     
    762694#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000)
    763695    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() : @[ ]]);
    765697    m_paymentAuthorizationViewControllerDelegate->_paymentAuthorizedCompletion(pkPaymentAuthorizationResult.get());
    766698#else
     
    788720
    789721#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()]);
    791723    m_paymentAuthorizationViewControllerDelegate->_didSelectShippingMethodCompletion(pkShippingMethodUpdate.get());
    792724#else
     
    840772
    841773#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()]);
    843775    m_paymentAuthorizationViewControllerDelegate->_didSelectShippingContactCompletion(pkShippingContactUpdate.get());
    844776#else
     
    857789
    858790#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()]);
    860792    m_paymentAuthorizationViewControllerDelegate->_didSelectPaymentMethodCompletion(pkPaymentMethodUpdate.get());
    861793#else
     
    867799Vector<String> WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks()
    868800{
    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];
    875802    Vector<String> result;
    876803    result.reserveInitialCapacity(availableNetworks.count);
  • trunk/Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm

    r237266 r238434  
    3535#import <UIKit/UIViewController.h>
    3636#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>
    4138
    4239namespace WebKit {
     
    5552    auto paymentRequest = toPKPaymentRequest(m_webPageProxy, originatingURL, linkIconURLStrings, request);
    5653
    57     m_paymentAuthorizationViewController = adoptNS([allocPKPaymentAuthorizationViewControllerInstance() initWithPaymentRequest:paymentRequest.get()]);
     54    m_paymentAuthorizationViewController = adoptNS([PAL::allocPKPaymentAuthorizationViewControllerInstance() initWithPaymentRequest:paymentRequest.get()]);
    5855    if (!m_paymentAuthorizationViewController) {
    5956        completionHandler(false);
  • trunk/Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm

    r232613 r238434  
    3131#import "WebPageProxy.h"
    3232#import "WebPaymentCoordinatorProxyCocoa.h"
    33 #import <pal/spi/cocoa/PassKitSPI.h>
     33#import <pal/cocoa/PassKitSoftLink.h>
    3434#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 *);
    4135
    4236namespace WebKit {
     
    4438void WebPaymentCoordinatorProxy::platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, WTF::Function<void (bool)>&& completionHandler)
    4539{
    46     if (!PassKitLibrary()) {
    47         completionHandler(false);
    48         return;
    49     }
    50 
    5140    auto paymentRequest = toPKPaymentRequest(m_webPageProxy, originatingURL, linkIconURLStrings, request);
    5241
    5342    auto showPaymentUIRequestSeed = m_showPaymentUIRequestSeed;
    5443    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) {
    5645        auto paymentCoordinatorProxy = weakThis.get();
    5746        if (!paymentCoordinatorProxy)
  • trunk/Source/WebKit/UIProcess/Cocoa/SafeBrowsingWarningCocoa.mm

    r238190 r238434  
    2929#import "SafeBrowsingSPI.h"
    3030#import <WebCore/LocalizedStrings.h>
     31#import <pal/spi/cocoa/NSAttributedStringSPI.h>
    3132#import <wtf/Language.h>
    3233
  • trunk/Source/WebKit/UIProcess/mac/WebProcessProxyMac.mm

    r238184 r238434  
    3131
    3232#import "WKFullKeyboardAccessWatcher.h"
     33#import <wtf/ProcessPrivilege.h>
    3334
    3435#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
  • trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj

    r238432 r238434  
    685685                2D92A796212B6ADA00F493FD /* NetscapePluginModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A4A9C5312B816CF008FE984 /* NetscapePluginModule.cpp */; };
    686686                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 */; };
    689687                2D931169212F61B200044BFE /* WKContentView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E3D18BBE044000FCFC9 /* WKContentView.mm */; };
    690688                2D93116A212F61B500044BFE /* WKContentViewInteraction.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E6B18BBF26A000FCFC9 /* WKContentViewInteraction.mm */; };
     
    1100711005                                7C4694C91A4B4EA100AD5845 /* WebPasteboardProxyMessageReceiver.cpp in Sources */,
    1100811006                                1AB1F7961D1B3613007C9BD1 /* WebPaymentCoordinatorMessageReceiver.cpp in Sources */,
    11009                                 2D92A79F2134B07E00F493FD /* WebPaymentCoordinatorProxyIOS.mm in Sources */,
    11010                                 2D92A79821348D8500F493FD /* WebPaymentCoordinatorProxyMac.mm in Sources */,
    1101111007                                1AB1F7981D1B3613007C9BD1 /* WebPaymentCoordinatorProxyMessageReceiver.cpp in Sources */,
    1101211008                                2D92A78D212B6AB100F493FD /* WebPlatformTouchPoint.cpp in Sources */,
Note: See TracChangeset for help on using the changeset viewer.