Changeset 242748 in webkit
- Timestamp:
- Mar 11, 2019, 3:42:09 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 36 edited
- 1 copied
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/FeatureDefines.h (modified) (2 diffs)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/Modules/applepay/PaymentCoordinatorClient.h (modified) (1 diff)
-
WebCore/PAL/ChangeLog (modified) (1 diff)
-
WebCore/PAL/pal/cocoa/PassKitSoftLink.h (modified) (2 diffs)
-
WebCore/PAL/pal/cocoa/PassKitSoftLink.mm (modified) (2 diffs)
-
WebCore/PAL/pal/spi/cocoa/PassKitSPI.h (modified) (3 diffs)
-
WebCore/page/Settings.yaml (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/Configurations/Network-iOS.entitlements (modified) (2 diffs)
-
WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (modified) (4 diffs)
-
WebKit/NetworkProcess/NetworkConnectionToWebProcess.h (modified) (4 diffs)
-
WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h (modified) (3 diffs)
-
WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm (modified) (5 diffs)
-
WebKit/NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm (added)
-
WebKit/Platform/ios/PaymentAuthorizationController.h (copied) (copied from trunk/Source/WebKit/Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm ) (2 diffs)
-
WebKit/Platform/ios/PaymentAuthorizationController.mm (added)
-
WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb (modified) (2 diffs)
-
WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.cpp (modified) (10 diffs)
-
WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h (modified) (6 diffs)
-
WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in (modified) (2 diffs)
-
WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (modified) (3 diffs)
-
WebKit/Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm (modified) (2 diffs)
-
WebKit/Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm (modified) (2 diffs)
-
WebKit/Shared/WebPreferences.yaml (modified) (1 diff)
-
WebKit/SourcesCocoa.txt (modified) (2 diffs)
-
WebKit/UIProcess/AuxiliaryProcessProxy.h (modified) (1 diff)
-
WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (modified) (3 diffs)
-
WebKit/UIProcess/WebPageProxy.cpp (modified) (1 diff)
-
WebKit/UIProcess/WebPageProxy.h (modified) (1 diff)
-
WebKit/UIProcess/ios/WebPageProxyIOS.mm (modified) (1 diff)
-
WebKit/WebKit.xcodeproj/project.pbxproj (modified) (6 diffs)
-
WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp (modified) (8 diffs)
-
WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h (modified) (5 diffs)
-
WebKit/WebProcess/Network/NetworkProcessConnection.cpp (modified) (5 diffs)
-
WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm (modified) (4 diffs)
-
WebKit/WebProcess/WebPage/WebPage.h (modified) (2 diffs)
-
WebKit/WebProcess/WebProcess.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r242747 r242748 1 2019-03-11 Andy Estes <aestes@apple.com> 2 3 [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS 4 https://bugs.webkit.org/show_bug.cgi?id=195530 5 <rdar://problem/48747164> 6 7 Reviewed by Alex Christensen. 8 9 * wtf/FeatureDefines.h: Defined ENABLE_APPLE_PAY_REMOTE_UI. 10 1 11 2019-03-11 Yusuke Suzuki <ysuzuki@apple.com> 2 12 -
trunk/Source/WTF/wtf/FeatureDefines.h
r242356 r242748 1 1 /* 2 * Copyright (C) 2006 , 2007, 2008, 2009, 2013Apple Inc. All rights reserved.2 * Copyright (C) 2006-2019 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2007-2009 Torch Mobile, Inc. 4 4 * Copyright (C) 2010, 2011 Research In Motion Limited. All rights reserved. … … 60 60 #endif 61 61 62 #if !defined(ENABLE_APPLE_PAY_REMOTE_UI) 63 #if !PLATFORM(APPLETV) && !PLATFORM(IOSMAC) && !PLATFORM(WATCHOS) 64 #define ENABLE_APPLE_PAY_REMOTE_UI 1 65 #endif 66 #endif 67 62 68 #if !defined(ENABLE_ASYNC_SCROLLING) 63 69 #define ENABLE_ASYNC_SCROLLING 1 -
trunk/Source/WebCore/ChangeLog
r242746 r242748 1 2019-03-11 Andy Estes <aestes@apple.com> 2 3 [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS 4 https://bugs.webkit.org/show_bug.cgi?id=195530 5 <rdar://problem/48747164> 6 7 Reviewed by Alex Christensen. 8 9 * Modules/applepay/PaymentCoordinatorClient.h: Defined isWebPaymentCoordinator. 10 * page/Settings.yaml: Defined the applePayRemoteUIEnabled setting and reordered the other 11 Apple Pay settings. 12 1 13 2019-03-11 Alex Christensen <achristensen@webkit.org> 2 14 -
trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h
r242681 r242748 64 64 65 65 virtual bool isMockPaymentCoordinator() const { return false; } 66 virtual bool isWebPaymentCoordinator() const { return false; } 66 67 67 68 protected: -
trunk/Source/WebCore/PAL/ChangeLog
r242746 r242748 1 2019-03-11 Andy Estes <aestes@apple.com> 2 3 [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS 4 https://bugs.webkit.org/show_bug.cgi?id=195530 5 <rdar://problem/48747164> 6 7 Reviewed by Alex Christensen. 8 9 * pal/cocoa/PassKitSoftLink.h: Soft-linked PKPaymentAuthorizationController on iOS. 10 * pal/cocoa/PassKitSoftLink.mm: Ditto. 11 * pal/spi/cocoa/PassKitSPI.h: Declared PKPaymentAuthorizationControllerPrivateDelegate and 12 related SPI. 13 1 14 2019-03-11 Alex Christensen <achristensen@webkit.org> 2 15 -
trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h
r242616 r242748 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 43 43 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKShippingMethod) 44 44 45 #if PLATFORM(IOS_FAMILY) 46 SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentAuthorizationController) 47 #endif 48 45 49 SOFT_LINK_FUNCTION_FOR_HEADER(PAL, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion)) 46 50 SOFT_LINK_FUNCTION_FOR_HEADER(PAL, PassKit, PKDrawApplePayButton, void, (CGContextRef context, CGRect drawRect, CGFloat scale, PKPaymentButtonType type, PKPaymentButtonStyle style, NSString *languageCode), (context, drawRect, scale, type, style, languageCode)) -
trunk/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm
r242616 r242748 1 1 /* 2 * Copyright (C) 2018 Apple Inc. All rights reserved.2 * Copyright (C) 2018-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 47 47 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKShippingMethod, PAL_EXPORT) 48 48 49 #if PLATFORM(IOS_FAMILY) 50 SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentAuthorizationController, PAL_EXPORT) 51 #endif 52 49 53 SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKCanMakePaymentsWithMerchantIdentifierAndDomain, void, (NSString *identifier, NSString *domain, PKCanMakePaymentsCompletion completion), (identifier, domain, completion), PAL_EXPORT) 50 54 SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, PassKit, PKDrawApplePayButton, void, (CGContextRef context, CGRect drawRect, CGFloat scale, PKPaymentButtonType type, PKPaymentButtonStyle style, NSString *languageCode), (context, drawRect, scale, type, style, languageCode)) -
trunk/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h
r238515 r242748 1 1 /* 2 * Copyright (C) 2016-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 44 44 #import <PassKit/PKPaymentRequest_Private.h> 45 45 46 #if PLATFORM(IOS_FAMILY) 47 #import <PassKit/PKPaymentAuthorizationController_Private.h> 48 #endif 49 46 50 #else 47 51 … … 49 53 50 54 #import <PassKit/PassKit.h> 55 56 @protocol PKPaymentAuthorizationControllerPrivateDelegate; 57 58 NS_ASSUME_NONNULL_BEGIN 59 60 @interface PKPaymentAuthorizationController () 61 @property (nonatomic, assign, nullable) id<PKPaymentAuthorizationControllerPrivateDelegate> privateDelegate; 62 @end 63 64 @class PKPaymentMerchantSession; 65 66 @protocol PKPaymentAuthorizationControllerPrivateDelegate <NSObject> 67 @optional 68 - (void)paymentAuthorizationController:(PKPaymentAuthorizationController *)controller willFinishWithError:(NSError *)error; 69 - (void)paymentAuthorizationController:(PKPaymentAuthorizationController *)controller didRequestMerchantSession:(void(^)(PKPaymentMerchantSession *, NSError *))sessionBlock; 70 @end 71 72 NS_ASSUME_NONNULL_END 51 73 52 74 #elif PLATFORM(MAC) -
trunk/Source/WebCore/page/Settings.yaml
r242664 r242748 653 653 initial: false 654 654 655 applePayCapabilityDisclosureAllowed: 656 conditional: APPLE_PAY 657 initial: true 658 applePayEnabled: 659 conditional: APPLE_PAY 660 initial: false 661 applePayRemoteUIEnabled: 662 conditional: APPLE_PAY_REMOTE_UI 663 initial: true 655 664 paymentRequestEnabled: 656 initial: false657 665 conditional: PAYMENT_REQUEST 658 applePayEnabled: 659 initial: false 660 conditional: APPLE_PAY 661 applePayCapabilityDisclosureAllowed: 662 initial: true 663 conditional: APPLE_PAY 666 initial: false 664 667 665 668 javaEnabled: -
trunk/Source/WebKit/ChangeLog
r242745 r242748 1 2019-03-11 Andy Estes <aestes@apple.com> 2 3 [Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS 4 https://bugs.webkit.org/show_bug.cgi?id=195530 5 <rdar://problem/48747164> 6 7 Reviewed by Alex Christensen. 8 9 * Configurations/Network-iOS.entitlements: Added the 'com.apple.payment.all-access' 10 entitlement and reordered the others. 11 12 * NetworkProcess/NetworkConnectionToWebProcess.cpp: 13 (WebKit::NetworkConnectionToWebProcess::didReceiveMessage): Forwarded 14 WebPaymentCoordinatorProxy messages to the payment coordinator. 15 (WebKit::NetworkConnectionToWebProcess::didReceiveSyncMessage): Ditto. 16 (WebKit::NetworkConnectionToWebProcess::didClose): Set m_paymentCoordinator to nullptr. 17 * NetworkProcess/NetworkConnectionToWebProcess.h: Inherited from 18 WebPaymentCoordinatorProxy::Client and added a unique_ptr<WebPaymentCoordinatorProxy> member. 19 20 * NetworkProcess/cocoa/NetworkSessionCocoa.h: Declared getters for source application bundle 21 and secondary identifiers, and CTDataConnectionServiceType on iOS. 22 * NetworkProcess/cocoa/NetworkSessionCocoa.mm: 23 (WebKit::NetworkSessionCocoa::sourceApplicationBundleIdentifier const): Defined getter. 24 (WebKit::NetworkSessionCocoa::sourceApplicationSecondaryIdentifier const): Ditto. 25 (WebKit::NetworkSessionCocoa::ctDataConnectionServiceType const): Ditto. 26 (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): Initialized 27 m_sourceApplicationBundleIdentifier and m_sourceApplicationSecondaryIdentifier with 28 corresponding NetworkSessionCreationParameters. 29 30 * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm: Added. 31 (WebKit::NetworkConnectionToWebProcess::paymentCoordinator): Added. Returns 32 m_paymentCoordinator after lazily initializing it. 33 (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorConnection): Added. Returns the 34 connection to the web process. 35 (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorPresentingViewController): Added. 36 Returns nil. 37 (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorCTDataConnectionServiceType): 38 Added. Returns the value from the network session identified by sessionID. 39 (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorSourceApplicationBundleIdentifier): 40 Ditto. 41 (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorSourceApplicationSecondaryIdentifier): 42 Ditto. 43 (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAuthorizationPresenter): Added. 44 Returns a new PaymentAuthorizationController. 45 (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAddMessageReceiver): Added empty 46 definition. NetworkConnectionToWebProcess explicitly forwards WebPaymentCoordinatorProxy 47 messages to its payment coordinator, so there's no need to register with a MessageReceiverMap. 48 (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorRemoveMessageReceiver): Ditto. 49 50 * Platform/ios/PaymentAuthorizationController.h: Added. Declares a 51 PaymentAuthorizationPresenter subclass based on PKPaymentAuthorizationController. 52 * Platform/ios/PaymentAuthorizationController.mm: Added. 53 (-[WKPaymentAuthorizationControllerDelegate initWithRequest:presenter:]): 54 Initialized WKPaymentAuthorizationDelegate with request and presenter. 55 (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationControllerDidFinish:]): 56 Forwarded call to WKPaymentAuthorizationDelegate. 57 (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didAuthorizePayment:handler:]): 58 Ditto. 59 (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didSelectShippingMethod:handler:]): 60 Ditto. 61 (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didSelectShippingContact:handler:]): 62 Ditto. 63 (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didSelectPaymentMethod:handler:]): 64 Ditto. 65 (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:willFinishWithError:]): 66 Ditto. 67 (-[WKPaymentAuthorizationControllerDelegate paymentAuthorizationController:didRequestMerchantSession:]): 68 Ditto. 69 (WebKit::PaymentAuthorizationController::PaymentAuthorizationController): 70 Initialized m_controller with a new PKPaymentAuthorizationController and m_delegate with a 71 new WKPaymentAuthorizationControllerDelegate. 72 (WebKit::PaymentAuthorizationController::platformDelegate): Returned m_delegate. 73 (WebKit::PaymentAuthorizationController::dismiss): Dismissed the controller, set its 74 delegates to nil, set m_controller to nil, invalidated the delegate, and set m_delegate to 75 nil. 76 (WebKit::PaymentAuthorizationController::present): Called -presentWithCompletion: on the 77 controller, forwarding the passed-in completion handler. 78 * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb: Allowed PassKit to look up 79 the "com.apple.passd.in-app-payment" and "com.apple.passd.library" service endpoints. 80 81 * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: 82 (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy): Changed to call 83 paymentCoordinatorAddMessageReceiver. 84 (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy): Changed to call 85 paymentCoordinatorRemoveMessageReceiver. 86 (WebKit::WebPaymentCoordinatorProxy::messageSenderDestinationID const): Deleted. 87 (WebKit::WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard): Passed sessionID to 88 platformCanMakePaymentsWithActiveCard. 89 (WebKit::WebPaymentCoordinatorProxy::showPaymentUI): Stored destinationID and passed 90 sessionID to platformShowPaymentUI. 91 (WebKit::WebPaymentCoordinatorProxy::cancelPaymentSession): Changed to account for new 92 behavior of didCancelPaymentSession. 93 (WebKit::WebPaymentCoordinatorProxy::didCancelPaymentSession): Changed to call hidePaymentUI. 94 (WebKit::WebPaymentCoordinatorProxy::presenterDidFinish): Changed to only call hidePaymentUI 95 when didReachFinalState is true, since didCancelPaymentSession is called otherwise. 96 (WebKit::WebPaymentCoordinatorProxy::didReachFinalState): Cleared m_destinationID. 97 * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Added m_destionationID member. 98 * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Changed 99 CanMakePaymentsWithActiveCard and ShowPaymentUI messages to take destinationID and sessionID 100 arguments. 101 102 * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: 103 (WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard): Passed 104 sessionID to paymentCoordinatorSourceApplicationSecondaryIdentifier. 105 (WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest): Passed sessionID to various 106 m_client call sites. 107 108 * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: 109 (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Passed sessionID to 110 platformPaymentRequest. 111 (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Null-checked m_authorizationPresenter 112 before calling dismiss. 113 114 * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: 115 (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI): Passed sessionID to 116 platformPaymentRequest. 117 (WebKit::WebPaymentCoordinatorProxy::hidePaymentUI): Null-checked m_authorizationPresenter 118 before calling dismiss. 119 120 * Shared/WebPreferences.yaml: Added ApplePayRemoteUIEnabled as an internal preference. 121 122 * SourcesCocoa.txt: Added NetworkConnectionToWebProcessIOS.mm and 123 PaymentAuthorizationController.mm. 124 125 * UIProcess/AuxiliaryProcessProxy.h: 126 (WebKit::AuxiliaryProcessProxy::messageReceiverMap): Deleted. 127 128 * UIProcess/Cocoa/WebPageProxyCocoa.mm: 129 (WebKit::WebPageProxy::paymentCoordinatorConnection): Moved from WebPageProxy.cpp. 130 (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto. 131 (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto. 132 (WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver): Ditto. 133 (WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver): Ditto. 134 135 * UIProcess/WebPageProxy.cpp: 136 (WebKit::WebPageProxy::paymentCoordinatorConnection): Moved to WebPageProxyCocoa.mm. 137 (WebKit::WebPageProxy::paymentCoordinatorMessageReceiver): Ditto. 138 (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier): Ditto. 139 (WebKit::WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier): Ditto. 140 (WebKit::WebPageProxy::paymentCoordinatorDestinationID): Ditto. 141 * UIProcess/WebPageProxy.h: 142 143 * UIProcess/ios/WebPageProxyIOS.mm: 144 (WebKit::WebPageProxy::paymentCoordinatorCTDataConnectionServiceType): Asserted that 145 sessionID equals the website data store's sessionID. 146 147 * WebKit.xcodeproj/project.pbxproj: 148 149 * WebProcess/ApplePay/WebPaymentCoordinator.cpp: 150 (WebKit::WebPaymentCoordinator::networkProcessConnectionClosed): Added. Cancels the current 151 session if Apple Pay Remote UI is enabled and the network process connection closes. 152 (WebKit::WebPaymentCoordinator::availablePaymentNetworks): Changed to account for 153 WebPaymentCoordinator being an IPC::MessageSender. 154 (WebKit::WebPaymentCoordinator::canMakePayments): Ditto. 155 (WebKit::WebPaymentCoordinator::canMakePaymentsWithActiveCard): Ditto. 156 (WebKit::WebPaymentCoordinator::openPaymentSetup): Ditto. 157 (WebKit::WebPaymentCoordinator::showPaymentUI): Ditto. 158 (WebKit::WebPaymentCoordinator::completeMerchantValidation): Ditto. 159 (WebKit::WebPaymentCoordinator::completeShippingMethodSelection): Ditto. 160 (WebKit::WebPaymentCoordinator::completeShippingContactSelection): Ditto. 161 (WebKit::WebPaymentCoordinator::completePaymentMethodSelection): Ditto. 162 (WebKit::WebPaymentCoordinator::completePaymentSession): Ditto. 163 (WebKit::WebPaymentCoordinator::abortPaymentSession): Ditto. 164 (WebKit::WebPaymentCoordinator::cancelPaymentSession): Ditto. 165 (WebKit::WebPaymentCoordinator::messageSenderConnection const): Added. Returns a connection 166 to the network process if Apple Pay Remote UI is enabled. Otherwise, returned the web 167 process's parent connection. 168 (WebKit::WebPaymentCoordinator::messageSenderDestinationID const): Added. Returns the web 169 page's ID. 170 (WebKit::WebPaymentCoordinator::remoteUIEnabled const): Added. Calls Settings::applePayRemoteUIEnabled. 171 * WebProcess/ApplePay/WebPaymentCoordinator.h: Inherited from IPC::MessageSender. 172 173 * WebProcess/Network/NetworkProcessConnection.cpp: 174 (WebKit::NetworkProcessConnection::didReceiveMessage): Forwarded WebPaymentCoordinator 175 messages to the payment coordinator of the web page matching the decoder's destination ID. 176 (WebKit::NetworkProcessConnection::didReceiveSyncMessage): Ditto for sync messages. 177 178 * WebProcess/WebPage/Cocoa/WebPageCocoa.mm: 179 (WebKit::WebPage::paymentCoordinator): Added a payment coordinator getter. 180 * WebProcess/WebPage/WebPage.h: Ditto. 181 182 * WebProcess/WebProcess.cpp: 183 (WebKit::WebProcess::networkProcessConnectionClosed): Called 184 WebPaymentCoordinator::networkProcessConnectionClosed when the network process connection 185 closes. 186 1 187 2019-03-11 Per Arne Vollan <pvollan@apple.com> 2 188 -
trunk/Source/WebKit/Configurations/Network-iOS.entitlements
r242680 r242748 3 3 <plist version="1.0"> 4 4 <dict> 5 <key>com.apple.multitasking.systemappassertions</key> 6 <true/> 7 <key>com.apple.payment.all-access</key> 8 <true/> 5 9 <key>com.apple.private.accounts.bundleidspoofing</key> 10 <true/> 11 <key>com.apple.private.memorystatus</key> 6 12 <true/> 7 13 <key>com.apple.private.network.socket-delegate</key> … … 11 17 <string>com.apple.WebKit.Networking</string> 12 18 </array> 13 <key>com.apple.multitasking.systemappassertions</key>14 <true/>15 <key>com.apple.private.memorystatus</key>16 <true/>17 19 </dict> 18 20 </plist> -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
r242738 r242748 63 63 #include <WebCore/SecurityPolicy.h> 64 64 65 #if ENABLE(APPLE_PAY_REMOTE_UI) 66 #include "WebPaymentCoordinatorProxyMessages.h" 67 #endif 68 65 69 namespace WebKit { 66 70 using namespace WebCore; … … 198 202 #endif 199 203 204 #if ENABLE(APPLE_PAY_REMOTE_UI) 205 if (decoder.messageReceiverName() == Messages::WebPaymentCoordinatorProxy::messageReceiverName()) 206 return paymentCoordinator().didReceiveMessage(connection, decoder); 207 #endif 208 200 209 ASSERT_NOT_REACHED(); 201 210 } … … 232 241 #endif 233 242 243 #if ENABLE(APPLE_PAY_REMOTE_UI) 244 if (decoder.messageReceiverName() == Messages::WebPaymentCoordinatorProxy::messageReceiverName()) 245 return paymentCoordinator().didReceiveSyncMessage(connection, decoder, reply); 246 #endif 247 234 248 ASSERT_NOT_REACHED(); 235 249 } … … 278 292 #if ENABLE(SERVICE_WORKER) 279 293 unregisterSWConnections(); 294 #endif 295 296 #if ENABLE(APPLE_PAY_REMOTE_UI) 297 m_paymentCoordinator = nullptr; 280 298 #endif 281 299 } -
trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h
r242738 r242748 33 33 #include "NetworkMDNSRegister.h" 34 34 #include "NetworkRTCProvider.h" 35 #include "WebPaymentCoordinatorProxy.h" 35 36 #include <WebCore/NetworkLoadInformation.h> 36 37 #include <WebCore/RegistrableDomain.h> … … 64 65 } 65 66 66 class NetworkConnectionToWebProcess : public RefCounted<NetworkConnectionToWebProcess>, IPC::Connection::Client { 67 class NetworkConnectionToWebProcess 68 : public RefCounted<NetworkConnectionToWebProcess> 69 #if ENABLE(APPLE_PAY_REMOTE_UI) 70 , public WebPaymentCoordinatorProxy::Client 71 #endif 72 , IPC::Connection::Client { 67 73 public: 68 74 using RegistrableDomain = WebCore::RegistrableDomain; … … 245 251 size_t findNetworkActivityTracker(ResourceLoadIdentifier resourceID); 246 252 253 #if ENABLE(APPLE_PAY_REMOTE_UI) 254 WebPaymentCoordinatorProxy& paymentCoordinator(); 255 256 // WebPaymentCoordinatorProxy::Client 257 IPC::Connection* paymentCoordinatorConnection(const WebPaymentCoordinatorProxy&) final; 258 UIViewController *paymentCoordinatorPresentingViewController(const WebPaymentCoordinatorProxy&) final; 259 const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&, PAL::SessionID) final; 260 const String& paymentCoordinatorSourceApplicationBundleIdentifier(const WebPaymentCoordinatorProxy&, PAL::SessionID) final; 261 const String& paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&, PAL::SessionID) final; 262 std::unique_ptr<PaymentAuthorizationPresenter> paymentCoordinatorAuthorizationPresenter(WebPaymentCoordinatorProxy&, PKPaymentRequest *) final; 263 void paymentCoordinatorAddMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference&, IPC::MessageReceiver&) final; 264 void paymentCoordinatorRemoveMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference&) final; 265 #endif 266 247 267 Ref<IPC::Connection> m_connection; 248 268 Ref<NetworkProcess> m_networkProcess; … … 270 290 HashMap<uint64_t, RefPtr<WebIDBConnectionToClient>> m_webIDBConnections; 271 291 #endif 272 292 273 293 #if ENABLE(SERVICE_WORKER) 274 294 HashMap<WebCore::SWServerConnectionIdentifier, WeakPtr<WebSWServerConnection>> m_swConnections; 275 295 #endif 296 297 #if ENABLE(APPLE_PAY_REMOTE_UI) 298 std::unique_ptr<WebPaymentCoordinatorProxy> m_paymentCoordinator; 299 #endif 276 300 }; 277 301 -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.h
r240689 r242748 1 1 /* 2 * Copyright (C) 2016-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 48 48 ~NetworkSessionCocoa(); 49 49 50 const String& sourceApplicationBundleIdentifier() const; 51 const String& sourceApplicationSecondaryIdentifier() const; 50 52 // Must be called before any NetworkSession has been created. 51 53 // FIXME: Move this to NetworkSessionCreationParameters. 52 54 #if PLATFORM(IOS_FAMILY) 55 const String& ctDataConnectionServiceType() const; 53 56 static void setCTDataConnectionServiceType(const String&); 54 57 #endif … … 83 86 84 87 String m_boundInterfaceIdentifier; 88 String m_sourceApplicationBundleIdentifier; 89 String m_sourceApplicationSecondaryIdentifier; 85 90 RetainPtr<CFDictionaryRef> m_proxyConfiguration; 86 91 bool m_shouldLogCookieInformation { false }; -
trunk/Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
r242723 r242748 1 1 /* 2 * Copyright (C) 2015-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2015-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 804 804 } 805 805 806 const String& NetworkSessionCocoa::sourceApplicationBundleIdentifier() const 807 { 808 return m_sourceApplicationBundleIdentifier; 809 } 810 811 const String& NetworkSessionCocoa::sourceApplicationSecondaryIdentifier() const 812 { 813 return m_sourceApplicationSecondaryIdentifier; 814 } 815 806 816 #if PLATFORM(IOS_FAMILY) 807 817 static String& globalCTDataConnectionServiceType() … … 810 820 return ctDataConnectionServiceType.get(); 811 821 } 812 #endif 813 814 #if PLATFORM(IOS_FAMILY) 822 823 const String& NetworkSessionCocoa::ctDataConnectionServiceType() const 824 { 825 return globalCTDataConnectionServiceType(); 826 } 827 815 828 void NetworkSessionCocoa::setCTDataConnectionServiceType(const String& type) 816 829 { … … 851 864 : NetworkSession(networkProcess, parameters.sessionID) 852 865 , m_boundInterfaceIdentifier(parameters.boundInterfaceIdentifier) 866 , m_sourceApplicationBundleIdentifier(parameters.sourceApplicationBundleIdentifier) 867 , m_sourceApplicationSecondaryIdentifier(parameters.sourceApplicationSecondaryIdentifier) 853 868 , m_proxyConfiguration(parameters.proxyConfiguration) 854 869 , m_shouldLogCookieInformation(parameters.shouldLogCookieInformation) … … 883 898 configuration._sourceApplicationAuditTokenData = (__bridge NSData *)data.get(); 884 899 885 if (! parameters.sourceApplicationBundleIdentifier.isEmpty()) {886 configuration._sourceApplicationBundleIdentifier = parameters.sourceApplicationBundleIdentifier;900 if (!m_sourceApplicationBundleIdentifier.isEmpty()) { 901 configuration._sourceApplicationBundleIdentifier = m_sourceApplicationBundleIdentifier; 887 902 configuration._sourceApplicationAuditTokenData = nil; 888 903 } 889 904 890 if (! parameters.sourceApplicationSecondaryIdentifier.isEmpty())891 configuration._sourceApplicationSecondaryIdentifier = parameters.sourceApplicationSecondaryIdentifier;905 if (!m_sourceApplicationSecondaryIdentifier.isEmpty()) 906 configuration._sourceApplicationSecondaryIdentifier = m_sourceApplicationSecondaryIdentifier; 892 907 893 908 configuration.connectionProxyDictionary = proxyDictionary(parameters.httpProxy, parameters.httpsProxy); -
trunk/Source/WebKit/Platform/ios/PaymentAuthorizationController.h
r242747 r242748 1 1 /* 2 * Copyright (C) 201 6-2019 Apple Inc. All rights reserved.2 * Copyright (C) 2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #import "config.h" 27 #import "WebPaymentCoordinatorProxy.h" 26 #pragma once 28 27 29 #if PLATFORM(IOS_FAMILY) && ENABLE(APPLE_PAY)28 #if USE(PASSKIT) && PLATFORM(IOS_FAMILY) 30 29 31 #i mport "APIUIClient.h"32 #i mport "PaymentAuthorizationPresenter.h"33 #import "WebPageProxy.h" 34 #import <PassKit/PassKit.h> 35 #import <UIKit/UIViewController.h> 36 #import <WebCore/PaymentAuthorizationStatus.h> 37 #import <pal/cocoa/PassKitSoftLink.h> 30 #include "PaymentAuthorizationPresenter.h" 31 #include <wtf/RetainPtr.h> 32 33 OBJC_CLASS PKPaymentAuthorizationController; 34 OBJC_CLASS PKPaymentRequest; 35 OBJC_CLASS WKPaymentAuthorizationControllerDelegate; 36 OBJC_CLASS WKPaymentAuthorizationDelegate; 38 37 39 38 namespace WebKit { 40 39 41 void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler) 42 { 43 auto paymentRequest = platformPaymentRequest(originatingURL, linkIconURLStrings, request);40 class PaymentAuthorizationController final : public PaymentAuthorizationPresenter { 41 public: 42 PaymentAuthorizationController(PaymentAuthorizationPresenter::Client&, PKPaymentRequest *); 44 43 45 ASSERT(!m_authorizationPresenter); 46 m_authorizationPresenter = m_client.paymentCoordinatorAuthorizationPresenter(*this, paymentRequest.get()); 47 if (!m_authorizationPresenter) 48 return completionHandler(false); 44 private: 45 // PaymentAuthorizationPresenter 46 WKPaymentAuthorizationDelegate *platformDelegate() final; 47 void dismiss() final; 48 void present(UIViewController *, CompletionHandler<void(bool)>&&) final; 49 49 50 m_authorizationPresenter->present(m_client.paymentCoordinatorPresentingViewController(*this), WTFMove(completionHandler)); 51 } 50 RetainPtr<PKPaymentAuthorizationController> m_controller; 51 RetainPtr<WKPaymentAuthorizationControllerDelegate> m_delegate; 52 }; 52 53 53 void WebPaymentCoordinatorProxy::hidePaymentUI() 54 { 55 m_authorizationPresenter->dismiss(); 56 m_authorizationPresenter = nullptr; 57 } 54 } // namespace WebKit 58 55 59 } 60 61 #endif 56 #endif // USE(PASSKIT) && PLATFORM(IOS_FAMILY) -
trunk/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb
r242680 r242748 1 ; Copyright (C) 2014-201 5Apple Inc. All rights reserved.1 ; Copyright (C) 2014-2019 Apple Inc. All rights reserved. 2 2 ; 3 3 ; Redistribution and use in source and binary forms, with or without … … 78 78 (global-name "com.apple.securityd")) 79 79 80 ;; PassKit framework 81 (allow mach-lookup 82 (global-name "com.apple.passd.in-app-payment") 83 (global-name "com.apple.passd.library")) 84 80 85 (deny file-write-create 81 86 (vnode-type SYMLINK)) -
trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.cpp
r242681 r242748 47 47 : m_client { client } 48 48 { 49 m_client.paymentCoordinator MessageReceiver(*this).addMessageReceiver(Messages::WebPaymentCoordinatorProxy::messageReceiverName(), m_client.paymentCoordinatorDestinationID(*this), *this);49 m_client.paymentCoordinatorAddMessageReceiver(*this, Messages::WebPaymentCoordinatorProxy::messageReceiverName(), *this); 50 50 finishConstruction(*this); 51 51 } … … 56 56 hidePaymentUI(); 57 57 58 m_client.paymentCoordinator MessageReceiver(*this).removeMessageReceiver(Messages::WebPaymentCoordinatorProxy::messageReceiverName(), m_client.paymentCoordinatorDestinationID(*this));58 m_client.paymentCoordinatorRemoveMessageReceiver(*this, Messages::WebPaymentCoordinatorProxy::messageReceiverName()); 59 59 } 60 60 … … 66 66 uint64_t WebPaymentCoordinatorProxy::messageSenderDestinationID() const 67 67 { 68 return m_client.paymentCoordinatorDestinationID(*this);68 return *m_destinationID; 69 69 } 70 70 … … 79 79 } 80 80 81 void WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, CompletionHandler<void(bool)>&& completionHandler)82 { 83 platformCanMakePaymentsWithActiveCard(merchantIdentifier, domainName, WTFMove(completionHandler));81 void WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, PAL::SessionID sessionID, CompletionHandler<void(bool)>&& completionHandler) 82 { 83 platformCanMakePaymentsWithActiveCard(merchantIdentifier, domainName, sessionID, WTFMove(completionHandler)); 84 84 } 85 85 … … 89 89 } 90 90 91 void WebPaymentCoordinatorProxy::showPaymentUI(const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& paymentRequest, CompletionHandler<void(bool)>&& completionHandler) 92 { 91 void WebPaymentCoordinatorProxy::showPaymentUI(uint64_t destinationID, PAL::SessionID sessionID, const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& paymentRequest, CompletionHandler<void(bool)>&& completionHandler) 92 { 93 if (auto& coordinator = activePaymentCoordinatorProxy()) 94 coordinator->didCancelPaymentSession(); 95 activePaymentCoordinatorProxy() = makeWeakPtr(this); 96 93 97 // FIXME: Make this a message check. 94 98 ASSERT(canBegin()); 95 96 if (auto& coordinator = activePaymentCoordinatorProxy()) { 97 coordinator->hidePaymentUI(); 98 coordinator->didCancelPaymentSession(); 99 } 100 101 activePaymentCoordinatorProxy() = makeWeakPtr(this); 102 99 ASSERT(!m_destinationID); 100 ASSERT(!m_authorizationPresenter); 101 102 m_destinationID = destinationID; 103 103 m_state = State::Activating; 104 104 … … 109 109 linkIconURLs.append(URL(URL(), linkIconURLString)); 110 110 111 platformShowPaymentUI(originatingURL, linkIconURLs, paymentRequest, [weakThis = makeWeakPtr(*this)](bool result) {111 platformShowPaymentUI(originatingURL, linkIconURLs, sessionID, paymentRequest, [weakThis = makeWeakPtr(*this)](bool result) { 112 112 if (!weakThis) 113 113 return; … … 125 125 } 126 126 127 128 127 void WebPaymentCoordinatorProxy::completeMerchantValidation(const WebCore::PaymentMerchantSession& paymentMerchantSession) 129 128 { … … 212 211 return; 213 212 213 didCancelPaymentSession(); 214 } 215 216 void WebPaymentCoordinatorProxy::didCancelPaymentSession() 217 { 218 ASSERT(canCancel()); 219 send(Messages::WebPaymentCoordinator::DidCancelPaymentSession()); 214 220 hidePaymentUI(); 215 didCancelPaymentSession();216 }217 218 void WebPaymentCoordinatorProxy::didCancelPaymentSession()219 {220 ASSERT(canCancel());221 222 send(Messages::WebPaymentCoordinator::DidCancelPaymentSession());223 224 221 didReachFinalState(); 225 222 } … … 243 240 if (!didReachFinalState) 244 241 didCancelPaymentSession(); 245 hidePaymentUI(); 242 else 243 hidePaymentUI(); 246 244 } 247 245 … … 336 334 void WebPaymentCoordinatorProxy::didReachFinalState() 337 335 { 336 m_destinationID = WTF::nullopt; 338 337 m_state = State::Idle; 339 338 m_merchantValidationState = MerchantValidationState::Idle; -
trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h
r242681 r242748 42 42 namespace IPC { 43 43 class Connection; 44 class MessageReceiverMap; 44 } 45 46 namespace PAL { 47 class SessionID; 45 48 } 46 49 … … 73 76 74 77 virtual IPC::Connection* paymentCoordinatorConnection(const WebPaymentCoordinatorProxy&) = 0; 75 virtual IPC::MessageReceiverMap& paymentCoordinatorMessageReceiver(const WebPaymentCoordinatorProxy&) = 0;76 virtual const String& paymentCoordinatorSourceApplication BundleIdentifier(const WebPaymentCoordinatorProxy&) = 0;77 virtual const String& paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&) = 0;78 virtual uint64_t paymentCoordinatorDestinationID(const WebPaymentCoordinatorProxy&) = 0;78 virtual const String& paymentCoordinatorSourceApplicationBundleIdentifier(const WebPaymentCoordinatorProxy&, PAL::SessionID) = 0; 79 virtual const String& paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&, PAL::SessionID) = 0; 80 virtual void paymentCoordinatorAddMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference&, IPC::MessageReceiver&) = 0; 81 virtual void paymentCoordinatorRemoveMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference&) = 0; 79 82 #if PLATFORM(IOS_FAMILY) 80 83 virtual UIViewController *paymentCoordinatorPresentingViewController(const WebPaymentCoordinatorProxy&) = 0; 81 virtual const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy& ) = 0;84 virtual const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&, PAL::SessionID) = 0; 82 85 virtual std::unique_ptr<PaymentAuthorizationPresenter> paymentCoordinatorAuthorizationPresenter(WebPaymentCoordinatorProxy&, PKPaymentRequest *) = 0; 83 86 #endif … … 87 90 }; 88 91 92 friend class NetworkConnectionToWebProcess; 89 93 explicit WebPaymentCoordinatorProxy(Client&); 90 94 ~WebPaymentCoordinatorProxy(); 91 92 void didCancelPaymentSession();93 void hidePaymentUI();94 95 95 96 private: … … 113 114 void availablePaymentNetworks(CompletionHandler<void(Vector<String>&&)>&&); 114 115 void canMakePayments(CompletionHandler<void(bool)>&&); 115 void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, CompletionHandler<void(bool)>&&);116 void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, PAL::SessionID, CompletionHandler<void(bool)>&&); 116 117 void openPaymentSetup(const String& merchantIdentifier, const String& domainName, CompletionHandler<void(bool)>&&); 117 void showPaymentUI( const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest&, CompletionHandler<void(bool)>&&);118 void showPaymentUI(uint64_t destinationID, PAL::SessionID, const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest&, CompletionHandler<void(bool)>&&); 118 119 void completeMerchantValidation(const WebCore::PaymentMerchantSession&); 119 120 void completeShippingMethodSelection(const Optional<WebCore::ShippingMethodUpdate>&); … … 129 130 bool canAbort() const; 130 131 132 void didCancelPaymentSession(); 131 133 void didReachFinalState(); 134 void hidePaymentUI(); 132 135 133 136 Vector<String> platformAvailablePaymentNetworks(); 134 137 bool platformCanMakePayments(); 135 void platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler);138 void platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, PAL::SessionID, WTF::Function<void(bool)>&& completionHandler); 136 139 void platformOpenPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler); 137 void platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&, CompletionHandler<void(bool)>&&);140 void platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLs, PAL::SessionID, const WebCore::ApplePaySessionPaymentRequest&, CompletionHandler<void(bool)>&&); 138 141 void platformCompleteMerchantValidation(const WebCore::PaymentMerchantSession&); 139 142 void platformCompleteShippingMethodSelection(const Optional<WebCore::ShippingMethodUpdate>&); … … 142 145 void platformCompletePaymentSession(const Optional<WebCore::PaymentAuthorizationResult>&); 143 146 #if PLATFORM(COCOA) 144 RetainPtr<PKPaymentRequest> platformPaymentRequest(const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&);147 RetainPtr<PKPaymentRequest> platformPaymentRequest(const URL& originatingURL, const Vector<URL>& linkIconURLs, PAL::SessionID, const WebCore::ApplePaySessionPaymentRequest&); 145 148 #endif 146 149 147 150 Client& m_client; 151 Optional<uint64_t> m_destinationID; 148 152 149 153 enum class State { -
trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in
r242681 r242748 1 # Copyright (C) 2015-201 8Apple Inc. All rights reserved.1 # Copyright (C) 2015-2019 Apple Inc. All rights reserved. 2 2 # 3 3 # Redistribution and use in source and binary forms, with or without … … 29 29 AvailablePaymentNetworks() -> (Vector<String> availablePaymentNetworks) Delayed 30 30 CanMakePayments() -> (bool result) Delayed 31 CanMakePaymentsWithActiveCard(String merchantIdentifier, String domainName ) -> (bool canMakePayments) Async31 CanMakePaymentsWithActiveCard(String merchantIdentifier, String domainName, PAL::SessionID sessionID) -> (bool canMakePayments) Async 32 32 OpenPaymentSetup(String merchantIdentifier, String domainName) -> (bool result) Async 33 33 34 ShowPaymentUI( String originatingURLString, Vector<String> linkIconURLStrings, WebCore::ApplePaySessionPaymentRequest paymentRequest) -> (bool result) Delayed34 ShowPaymentUI(uint64_t destinationID, PAL::SessionID sessionID, String originatingURLString, Vector<String> linkIconURLStrings, WebCore::ApplePaySessionPaymentRequest paymentRequest) -> (bool result) Delayed 35 35 CompleteMerchantValidation(WebCore::PaymentMerchantSession paymentMerchantSession) 36 36 CompleteShippingMethodSelection(Optional<WebCore::ShippingMethodUpdate> update) -
trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
r242616 r242748 58 58 } 59 59 60 void WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler)61 { 62 #if HAVE(PASSKIT_GRANULAR_ERRORS) 63 PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(merchantIdentifier, domainName, m_client.paymentCoordinatorSourceApplicationSecondaryIdentifier(*this ), makeBlockPtr([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable {60 void WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, PAL::SessionID sessionID, WTF::Function<void(bool)>&& completionHandler) 61 { 62 #if HAVE(PASSKIT_GRANULAR_ERRORS) 63 PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(merchantIdentifier, domainName, m_client.paymentCoordinatorSourceApplicationSecondaryIdentifier(*this, sessionID), makeBlockPtr([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable { 64 64 if (error) 65 65 LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error); … … 237 237 #endif 238 238 239 RetainPtr<PKPaymentRequest> WebPaymentCoordinatorProxy::platformPaymentRequest(const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest& paymentRequest)239 RetainPtr<PKPaymentRequest> WebPaymentCoordinatorProxy::platformPaymentRequest(const URL& originatingURL, const Vector<URL>& linkIconURLs, PAL::SessionID sessionID, const WebCore::ApplePaySessionPaymentRequest& paymentRequest) 240 240 { 241 241 auto result = adoptNS([PAL::allocPKPaymentRequestInstance() init]); … … 301 301 302 302 // FIXME: Instead of using respondsToSelector, this should use a proper #if version check. 303 auto& bundleIdentifier = m_client.paymentCoordinatorSourceApplicationBundleIdentifier(*this );303 auto& bundleIdentifier = m_client.paymentCoordinatorSourceApplicationBundleIdentifier(*this, sessionID); 304 304 if (!bundleIdentifier.isEmpty() && [result respondsToSelector:@selector(setSourceApplicationBundleIdentifier:)]) 305 305 [result setSourceApplicationBundleIdentifier:bundleIdentifier]; 306 306 307 auto& secondaryIdentifier = m_client.paymentCoordinatorSourceApplicationSecondaryIdentifier(*this );307 auto& secondaryIdentifier = m_client.paymentCoordinatorSourceApplicationSecondaryIdentifier(*this, sessionID); 308 308 if (!secondaryIdentifier.isEmpty() && [result respondsToSelector:@selector(setSourceApplicationSecondaryIdentifier:)]) 309 309 [result setSourceApplicationSecondaryIdentifier:secondaryIdentifier]; 310 310 311 311 #if PLATFORM(IOS_FAMILY) 312 auto& serviceType = m_client.paymentCoordinatorCTDataConnectionServiceType(*this );312 auto& serviceType = m_client.paymentCoordinatorCTDataConnectionServiceType(*this, sessionID); 313 313 if (!serviceType.isEmpty() && [result respondsToSelector:@selector(setCTDataConnectionServiceType:)]) 314 314 [result setCTDataConnectionServiceType:serviceType]; -
trunk/Source/WebKit/Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm
r242616 r242748 39 39 namespace WebKit { 40 40 41 void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler)41 void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, PAL::SessionID sessionID, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler) 42 42 { 43 auto paymentRequest = platformPaymentRequest(originatingURL, linkIconURLStrings, request);43 auto paymentRequest = platformPaymentRequest(originatingURL, linkIconURLStrings, sessionID, request); 44 44 45 45 ASSERT(!m_authorizationPresenter); … … 53 53 void WebPaymentCoordinatorProxy::hidePaymentUI() 54 54 { 55 m_authorizationPresenter->dismiss(); 55 if (m_authorizationPresenter) 56 m_authorizationPresenter->dismiss(); 56 57 m_authorizationPresenter = nullptr; 57 58 } -
trunk/Source/WebKit/Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm
r242616 r242748 36 36 namespace WebKit { 37 37 38 void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler)38 void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, PAL::SessionID sessionID, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler) 39 39 { 40 auto paymentRequest = platformPaymentRequest(originatingURL, linkIconURLStrings, request);40 auto paymentRequest = platformPaymentRequest(originatingURL, linkIconURLStrings, sessionID, request); 41 41 42 42 auto showPaymentUIRequestSeed = m_showPaymentUIRequestSeed; … … 98 98 99 99 [[m_sheetWindow sheetParent] endSheet:m_sheetWindow.get()]; 100 m_authorizationPresenter->dismiss(); 100 101 if (m_authorizationPresenter) 102 m_authorizationPresenter->dismiss(); 101 103 m_authorizationPresenter = nullptr; 102 104 -
trunk/Source/WebKit/Shared/WebPreferences.yaml
r242738 r242748 1581 1581 webcoreBinding: RuntimeEnabledFeatures 1582 1582 1583 ApplePayRemoteUIEnabled: 1584 category: internal 1585 condition: ENABLE(APPLE_PAY_REMOTE_UI) 1586 defaultValue: true 1587 humanReadableDescription: "Enable Apple Pay Remote UI" 1588 humanReadableName: "Apple Pay Remote UI" 1589 type: bool 1590 1583 1591 # Deprecated 1584 1592 -
trunk/Source/WebKit/SourcesCocoa.txt
r242696 r242748 44 44 NetworkProcess/EntryPoint/Cocoa/XPCService/NetworkServiceEntryPoint.mm 45 45 46 NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm 46 47 NetworkProcess/ios/NetworkProcessIOS.mm 47 48 … … 76 77 77 78 Platform/ios/AccessibilityIOS.mm 79 Platform/ios/PaymentAuthorizationController.mm 78 80 79 81 Platform/IPC/mac/ConnectionMac.mm -
trunk/Source/WebKit/UIProcess/AuxiliaryProcessProxy.h
r242332 r242748 87 87 void setProcessSuppressionEnabled(bool); 88 88 89 IPC::MessageReceiverMap& messageReceiverMap() { return m_messageReceiverMap; }90 91 89 protected: 92 90 // ProcessLauncher::Client -
trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm
r240491 r242748 1 1 /* 2 * Copyright (C) 2014 Apple Inc. All rights reserved.2 * Copyright (C) 2014-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 36 36 #import "WebPageMessages.h" 37 37 #import "WebProcessProxy.h" 38 #import "WebsiteDataStore.h" 38 39 #import <WebCore/DragItem.h> 39 40 #import <WebCore/NotImplemented.h> … … 207 208 process().send(Messages::WebPage::PerformDictionaryLookupOfCurrentSelection(), m_pageID); 208 209 } 210 211 #if ENABLE(APPLE_PAY) 212 213 IPC::Connection* WebPageProxy::paymentCoordinatorConnection(const WebPaymentCoordinatorProxy&) 214 { 215 return messageSenderConnection(); 216 } 217 218 const String& WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier(const WebPaymentCoordinatorProxy&, PAL::SessionID sessionID) 219 { 220 ASSERT_UNUSED(sessionID, sessionID == websiteDataStore().sessionID()); 221 return websiteDataStore().sourceApplicationBundleIdentifier(); 222 } 223 224 const String& WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&, PAL::SessionID sessionID) 225 { 226 ASSERT_UNUSED(sessionID, sessionID == websiteDataStore().sessionID()); 227 return websiteDataStore().sourceApplicationSecondaryIdentifier(); 228 } 229 230 void WebPageProxy::paymentCoordinatorAddMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference& messageReceiverName, IPC::MessageReceiver& messageReceiver) 231 { 232 process().addMessageReceiver(messageReceiverName, m_pageID, messageReceiver); 233 } 234 235 void WebPageProxy::paymentCoordinatorRemoveMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference& messageReceiverName) 236 { 237 process().removeMessageReceiver(messageReceiverName, m_pageID); 238 } 239 240 #endif 209 241 210 242 } // namespace WebKit -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r242713 r242748 8768 8768 } 8769 8769 8770 #if ENABLE(APPLE_PAY)8771 8772 IPC::Connection* WebPageProxy::paymentCoordinatorConnection(const WebPaymentCoordinatorProxy&)8773 {8774 return messageSenderConnection();8775 }8776 8777 IPC::MessageReceiverMap& WebPageProxy::paymentCoordinatorMessageReceiver(const WebPaymentCoordinatorProxy&)8778 {8779 return process().messageReceiverMap();8780 }8781 8782 const String& WebPageProxy::paymentCoordinatorSourceApplicationBundleIdentifier(const WebPaymentCoordinatorProxy&)8783 {8784 return websiteDataStore().sourceApplicationBundleIdentifier();8785 }8786 8787 const String& WebPageProxy::paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&)8788 {8789 return websiteDataStore().sourceApplicationSecondaryIdentifier();8790 }8791 8792 uint64_t WebPageProxy::paymentCoordinatorDestinationID(const WebPaymentCoordinatorProxy&)8793 {8794 return messageSenderDestinationID();8795 }8796 8797 #endif8798 8799 8770 void WebPageProxy::addObserver(WebViewDidMoveToWindowObserver& observer) 8800 8771 { -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r242705 r242748 1987 1987 #if ENABLE(APPLE_PAY) 1988 1988 IPC::Connection* paymentCoordinatorConnection(const WebPaymentCoordinatorProxy&) final; 1989 IPC::MessageReceiverMap& paymentCoordinatorMessageReceiver(const WebPaymentCoordinatorProxy&) final;1990 const String& paymentCoordinatorSourceApplication BundleIdentifier(const WebPaymentCoordinatorProxy&) final;1991 const String& paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&) final;1992 uint64_t paymentCoordinatorDestinationID(const WebPaymentCoordinatorProxy&) final;1989 const String& paymentCoordinatorSourceApplicationBundleIdentifier(const WebPaymentCoordinatorProxy&, PAL::SessionID) final; 1990 const String& paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&, PAL::SessionID) final; 1991 void paymentCoordinatorAddMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference&, IPC::MessageReceiver&) final; 1992 void paymentCoordinatorRemoveMessageReceiver(WebPaymentCoordinatorProxy&, const IPC::StringReference&) final; 1993 1993 #endif 1994 1994 #if ENABLE(APPLE_PAY) && PLATFORM(IOS_FAMILY) 1995 1995 UIViewController *paymentCoordinatorPresentingViewController(const WebPaymentCoordinatorProxy&) final; 1996 const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy& ) final;1996 const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&, PAL::SessionID) final; 1997 1997 std::unique_ptr<PaymentAuthorizationPresenter> paymentCoordinatorAuthorizationPresenter(WebPaymentCoordinatorProxy&, PKPaymentRequest *) final; 1998 1998 #endif -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r242616 r242748 1191 1191 } 1192 1192 1193 const String& WebPageProxy::paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&) 1194 { 1193 const String& WebPageProxy::paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&, PAL::SessionID sessionID) 1194 { 1195 ASSERT_UNUSED(sessionID, sessionID == websiteDataStore().sessionID()); 1195 1196 return process().processPool().configuration().ctDataConnectionServiceType(); 1196 1197 } -
trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj
r242696 r242748 1290 1290 A1798B49222E531D000764BD /* WKPaymentAuthorizationDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = A1798B47222E530A000764BD /* WKPaymentAuthorizationDelegate.h */; }; 1291 1291 A1798B4C222F1BD4000764BD /* WebPaymentCoordinatorProxyCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = A1798B4B222F1BD4000764BD /* WebPaymentCoordinatorProxyCocoa.h */; }; 1292 A1798B512230A10E000764BD /* PaymentAuthorizationController.h in Headers */ = {isa = PBXBuildFile; fileRef = A1798B4F2230A0FE000764BD /* PaymentAuthorizationController.h */; }; 1292 1293 A181A79821ACC74B0059A316 /* WebKitAdditions.mm in Sources */ = {isa = PBXBuildFile; fileRef = A181A79721ACAC610059A316 /* WebKitAdditions.mm */; }; 1293 1294 A182D5B51BE6BD250087A7CC /* AccessibilityIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A182D5B31BE6BD250087A7CC /* AccessibilityIOS.h */; }; … … 3870 3871 A1798B4A222F133A000764BD /* PaymentAuthorizationPresenter.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PaymentAuthorizationPresenter.mm; sourceTree = "<group>"; }; 3871 3872 A1798B4B222F1BD4000764BD /* WebPaymentCoordinatorProxyCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebPaymentCoordinatorProxyCocoa.h; sourceTree = "<group>"; }; 3873 A1798B4F2230A0FE000764BD /* PaymentAuthorizationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentAuthorizationController.h; sourceTree = "<group>"; }; 3874 A1798B502230A0FE000764BD /* PaymentAuthorizationController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PaymentAuthorizationController.mm; sourceTree = "<group>"; }; 3875 A1798B5722332203000764BD /* NetworkConnectionToWebProcessIOS.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkConnectionToWebProcessIOS.mm; sourceTree = "<group>"; }; 3872 3876 A181A79721ACAC610059A316 /* WebKitAdditions.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebKitAdditions.mm; sourceTree = "<group>"; }; 3873 3877 A182D5B21BE6BD250087A7CC /* AccessibilityIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityIOS.mm; sourceTree = "<group>"; }; … … 5928 5932 isa = PBXGroup; 5929 5933 children = ( 5934 A1798B5722332203000764BD /* NetworkConnectionToWebProcessIOS.mm */, 5930 5935 2DA944BC188511E700ED86DB /* NetworkProcessIOS.mm */, 5931 5936 ); … … 7150 7155 A182D5B31BE6BD250087A7CC /* AccessibilityIOS.h */, 7151 7156 A182D5B21BE6BD250087A7CC /* AccessibilityIOS.mm */, 7157 A1798B4F2230A0FE000764BD /* PaymentAuthorizationController.h */, 7158 A1798B502230A0FE000764BD /* PaymentAuthorizationController.mm */, 7152 7159 ); 7153 7160 path = ios; … … 9286 9293 1A8B66B01BC43C860082DF77 /* PageLoadStateObserver.h in Headers */, 9287 9294 C574A58112E66681002DFE98 /* PasteboardTypes.h in Headers */, 9295 A1798B512230A10E000764BD /* PaymentAuthorizationController.h in Headers */, 9288 9296 A1798B3E222D97A2000764BD /* PaymentAuthorizationPresenter.h in Headers */, 9289 9297 A1798B43222D98DF000764BD /* PaymentAuthorizationViewController.h in Headers */, … … 10228 10236 ProvisioningStyle = Automatic; 10229 10237 }; 10238 A1798B59223464C4000764BD = { 10239 CreatedOnToolsVersion = 10.2; 10240 }; 10230 10241 E1AC2E2720F7B94C00B0897D = { 10231 10242 CreatedOnToolsVersion = 9.3; -
trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp
r242681 r242748 52 52 } 53 53 54 void WebPaymentCoordinator::networkProcessConnectionClosed() 55 { 56 #if ENABLE(APPLE_PAY_REMOTE_UI) 57 if (remoteUIEnabled()) 58 didCancelPaymentSession(); 59 #endif 60 } 61 54 62 const WebPaymentCoordinator::AvailablePaymentNetworksSet& WebPaymentCoordinator::availablePaymentNetworks() 55 63 { … … 61 69 Vector<String> availablePaymentNetworks; 62 70 using AvailablePaymentNetworksMessage = Messages::WebPaymentCoordinatorProxy::AvailablePaymentNetworks; 63 if ( m_webPage.sendSync(AvailablePaymentNetworksMessage(), AvailablePaymentNetworksMessage::Reply(availablePaymentNetworks))) {71 if (sendSync(AvailablePaymentNetworksMessage(), AvailablePaymentNetworksMessage::Reply(availablePaymentNetworks))) { 64 72 for (auto& network : availablePaymentNetworks) 65 73 m_availablePaymentNetworks->add(network); … … 81 89 { 82 90 bool canMakePayments; 83 if (! m_webPage.sendSync(Messages::WebPaymentCoordinatorProxy::CanMakePayments(), Messages::WebPaymentCoordinatorProxy::CanMakePayments::Reply(canMakePayments)))91 if (!sendSync(Messages::WebPaymentCoordinatorProxy::CanMakePayments(), Messages::WebPaymentCoordinatorProxy::CanMakePayments::Reply(canMakePayments))) 84 92 return false; 85 93 … … 89 97 void WebPaymentCoordinator::canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, CompletionHandler<void(bool)>&& completionHandler) 90 98 { 91 m_webPage.sendWithAsyncReply(Messages::WebPaymentCoordinatorProxy::CanMakePaymentsWithActiveCard(merchantIdentifier, domainName), WTFMove(completionHandler));99 sendWithAsyncReply(Messages::WebPaymentCoordinatorProxy::CanMakePaymentsWithActiveCard(merchantIdentifier, domainName, m_webPage.sessionID()), WTFMove(completionHandler)); 92 100 } 93 101 94 102 void WebPaymentCoordinator::openPaymentSetup(const String& merchantIdentifier, const String& domainName, CompletionHandler<void(bool)>&& completionHandler) 95 103 { 96 m_webPage.sendWithAsyncReply(Messages::WebPaymentCoordinatorProxy::OpenPaymentSetup(merchantIdentifier, domainName), WTFMove(completionHandler));104 sendWithAsyncReply(Messages::WebPaymentCoordinatorProxy::OpenPaymentSetup(merchantIdentifier, domainName), WTFMove(completionHandler)); 97 105 } 98 106 … … 104 112 105 113 bool result; 106 if (! m_webPage.sendSync(Messages::WebPaymentCoordinatorProxy::ShowPaymentUI(originatingURL.string(), linkIconURLStrings, paymentRequest), Messages::WebPaymentCoordinatorProxy::ShowPaymentUI::Reply(result)))114 if (!sendSync(Messages::WebPaymentCoordinatorProxy::ShowPaymentUI(m_webPage.pageID(), m_webPage.sessionID(), originatingURL.string(), linkIconURLStrings, paymentRequest), Messages::WebPaymentCoordinatorProxy::ShowPaymentUI::Reply(result))) 107 115 return false; 108 116 … … 112 120 void WebPaymentCoordinator::completeMerchantValidation(const WebCore::PaymentMerchantSession& paymentMerchantSession) 113 121 { 114 m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteMerchantValidation(paymentMerchantSession));122 send(Messages::WebPaymentCoordinatorProxy::CompleteMerchantValidation(paymentMerchantSession)); 115 123 } 116 124 117 125 void WebPaymentCoordinator::completeShippingMethodSelection(Optional<WebCore::ShippingMethodUpdate>&& update) 118 126 { 119 m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteShippingMethodSelection(update));127 send(Messages::WebPaymentCoordinatorProxy::CompleteShippingMethodSelection(update)); 120 128 } 121 129 122 130 void WebPaymentCoordinator::completeShippingContactSelection(Optional<WebCore::ShippingContactUpdate>&& update) 123 131 { 124 m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteShippingContactSelection(update));132 send(Messages::WebPaymentCoordinatorProxy::CompleteShippingContactSelection(update)); 125 133 } 126 134 127 135 void WebPaymentCoordinator::completePaymentMethodSelection(Optional<WebCore::PaymentMethodUpdate>&& update) 128 136 { 129 m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompletePaymentMethodSelection(update));137 send(Messages::WebPaymentCoordinatorProxy::CompletePaymentMethodSelection(update)); 130 138 } 131 139 132 140 void WebPaymentCoordinator::completePaymentSession(Optional<WebCore::PaymentAuthorizationResult>&& result) 133 141 { 134 m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompletePaymentSession(result));142 send(Messages::WebPaymentCoordinatorProxy::CompletePaymentSession(result)); 135 143 } 136 144 137 145 void WebPaymentCoordinator::abortPaymentSession() 138 146 { 139 m_webPage.send(Messages::WebPaymentCoordinatorProxy::AbortPaymentSession());147 send(Messages::WebPaymentCoordinatorProxy::AbortPaymentSession()); 140 148 } 141 149 142 150 void WebPaymentCoordinator::cancelPaymentSession() 143 151 { 144 m_webPage.send(Messages::WebPaymentCoordinatorProxy::CancelPaymentSession());152 send(Messages::WebPaymentCoordinatorProxy::CancelPaymentSession()); 145 153 } 146 154 … … 150 158 } 151 159 160 IPC::Connection* WebPaymentCoordinator::messageSenderConnection() const 161 { 162 #if ENABLE(APPLE_PAY_REMOTE_UI) 163 if (remoteUIEnabled()) 164 return &WebProcess::singleton().ensureNetworkProcessConnection().connection(); 165 #endif 166 return WebProcess::singleton().parentProcessConnection(); 167 } 168 169 uint64_t WebPaymentCoordinator::messageSenderDestinationID() const 170 { 171 return m_webPage.pageID(); 172 } 173 152 174 void WebPaymentCoordinator::validateMerchant(const String& validationURLString) 153 175 { … … 185 207 } 186 208 187 } 188 189 #endif 209 #if ENABLE(APPLE_PAY_REMOTE_UI) 210 bool WebPaymentCoordinator::remoteUIEnabled() const 211 { 212 if (auto page = m_webPage.corePage()) 213 return page->settings().applePayRemoteUIEnabled(); 214 return false; 215 } 216 #endif 217 218 } 219 220 #endif -
trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h
r242681 r242748 29 29 30 30 #include "MessageReceiver.h" 31 #include "MessageSender.h" 31 32 #include <WebCore/PaymentCoordinatorClient.h> 32 33 #include <WebCore/PaymentHeaders.h> … … 47 48 namespace WebKit { 48 49 50 class NetworkProcessConnection; 49 51 class WebPage; 50 52 51 class WebPaymentCoordinator final : public WebCore::PaymentCoordinatorClient, private IPC::MessageReceiver {53 class WebPaymentCoordinator final : public WebCore::PaymentCoordinatorClient, private IPC::MessageReceiver, private IPC::MessageSender { 52 54 public: 55 friend class NetworkProcessConnection; 53 56 explicit WebPaymentCoordinator(WebPage&); 54 57 ~WebPaymentCoordinator(); 58 59 void networkProcessConnectionClosed(); 55 60 56 61 private: … … 72 77 void paymentCoordinatorDestroyed() override; 73 78 79 bool isWebPaymentCoordinator() const override { return true; } 80 74 81 // IPC::MessageReceiver. 75 82 void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; 83 84 // IPC::MessageSender. 85 IPC::Connection* messageSenderConnection() const final; 86 uint64_t messageSenderDestinationID() const final; 76 87 77 88 // Message handlers. … … 84 95 85 96 WebCore::PaymentCoordinator& paymentCoordinator(); 86 97 98 #if ENABLE(APPLE_PAY_REMOTE_UI) 99 bool remoteUIEnabled() const; 100 #endif 101 87 102 using AvailablePaymentNetworksSet = HashSet<String, ASCIICaseInsensitiveHash>; 88 103 const AvailablePaymentNetworksSet& availablePaymentNetworks(); … … 97 112 }; 98 113 99 } 114 } // namespace WebKit 115 116 SPECIALIZE_TYPE_TRAITS_BEGIN(WebKit::WebPaymentCoordinator) 117 static bool isType(const WebCore::PaymentCoordinatorClient& paymentCoordinatorClient) { return paymentCoordinatorClient.isWebPaymentCoordinator(); } 118 SPECIALIZE_TYPE_TRAITS_END() 119 100 120 #endif -
trunk/Source/WebKit/WebProcess/Network/NetworkProcessConnection.cpp
r238655 r242748 1 1 /* 2 * Copyright (C) 2010 , 2011, 2012Apple Inc. All rights reserved.2 * Copyright (C) 2010-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 40 40 #include "WebPage.h" 41 41 #include "WebPageMessages.h" 42 #include "WebPaymentCoordinator.h" 42 43 #include "WebProcess.h" 43 44 #include "WebRTCMonitor.h" … … 58 59 #include <pal/SessionID.h> 59 60 61 #if ENABLE(APPLE_PAY_REMOTE_UI) 62 #include "WebPaymentCoordinatorMessages.h" 63 #endif 64 60 65 namespace WebKit { 61 66 using namespace WebCore; … … 142 147 #endif 143 148 149 #if ENABLE(APPLE_PAY_REMOTE_UI) 150 if (decoder.messageReceiverName() == Messages::WebPaymentCoordinator::messageReceiverName()) { 151 if (auto webPage = WebProcess::singleton().webPage(decoder.destinationID())) 152 webPage->paymentCoordinator()->didReceiveMessage(connection, decoder); 153 return; 154 } 155 #endif 156 144 157 didReceiveNetworkProcessConnectionMessage(connection, decoder); 145 158 } … … 152 165 if (auto* contextManagerConnection = SWContextManager::singleton().connection()) 153 166 static_cast<WebSWContextManagerConnection&>(*contextManagerConnection).didReceiveSyncMessage(connection, decoder, replyEncoder); 167 return; 168 } 169 #endif 170 171 #if ENABLE(APPLE_PAY_REMOTE_UI) 172 if (decoder.messageReceiverName() == Messages::WebPaymentCoordinator::messageReceiverName()) { 173 if (auto webPage = WebProcess::singleton().webPage(decoder.destinationID())) 174 webPage->paymentCoordinator()->didReceiveSyncMessage(connection, decoder, replyEncoder); 154 175 return; 155 176 } -
trunk/Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
r241721 r242748 1 1 /* 2 * Copyright (C) 2016-201 7Apple Inc. All rights reserved.2 * Copyright (C) 2016-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 31 31 #import "PluginView.h" 32 32 #import "WebPageProxyMessages.h" 33 #import "WebPaymentCoordinator.h" 33 34 #import <WebCore/DictionaryLookup.h> 34 35 #import <WebCore/Editor.h> … … 38 39 #import <WebCore/HitTestResult.h> 39 40 #import <WebCore/NodeRenderStyle.h> 41 #import <WebCore/PaymentCoordinator.h> 40 42 #import <WebCore/PlatformMediaSessionManager.h> 41 43 #import <WebCore/RenderElement.h> … … 190 192 } 191 193 194 #if ENABLE(APPLE_PAY) 195 WebPaymentCoordinator* WebPage::paymentCoordinator() 196 { 197 if (!m_page) 198 return nullptr; 199 auto& client = m_page->paymentCoordinator().client(); 200 return is<WebPaymentCoordinator>(client) ? downcast<WebPaymentCoordinator>(&client) : nullptr; 201 } 202 #endif 203 192 204 } // namespace WebKit 193 205 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r242714 r242748 233 233 class WebPageInspectorTargetController; 234 234 class WebPageOverlay; 235 class WebPaymentCoordinator; 235 236 class WebPopupMenu; 236 237 class WebTouchEvent; … … 1161 1162 void resumeAllMediaBuffering(); 1162 1163 1164 #if ENABLE(APPLE_PAY) 1165 WebPaymentCoordinator* paymentCoordinator(); 1166 #endif 1167 1163 1168 private: 1164 1169 WebPage(uint64_t pageID, WebPageCreationParameters&&); -
trunk/Source/WebKit/WebProcess/WebProcess.cpp
r242230 r242748 1 1 /* 2 * Copyright (C) 2009-201 8Apple Inc. All rights reserved.2 * Copyright (C) 2009-2019 Apple Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 58 58 #include "WebPage.h" 59 59 #include "WebPageGroupProxy.h" 60 #include "WebPaymentCoordinator.h" 60 61 #include "WebPlatformStrategies.h" 61 62 #include "WebPluginInfoProvider.h" … … 1287 1288 WebSocketStream::networkProcessCrashed(); 1288 1289 1289 for (auto& page : m_pageMap.values()) 1290 for (auto& page : m_pageMap.values()) { 1290 1291 page->stopAllURLSchemeTasks(); 1292 #if ENABLE(APPLE_PAY) 1293 if (auto paymentCoordinator = page->paymentCoordinator()) 1294 paymentCoordinator->networkProcessConnectionClosed(); 1295 #endif 1296 } 1291 1297 } 1292 1298
Note:
See TracChangeset
for help on using the changeset viewer.