WebKit Bugzilla
Attachment 357829 Details for
Bug 191298
: Payment process stub with feature flag
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch 2
bug-191298-20181220101157.patch (text/plain), 272.76 KB, created by
Zamiul Haque
on 2018-12-20 10:12:00 PST
(
hide
)
Description:
Patch 2
Filename:
MIME Type:
Creator:
Zamiul Haque
Created:
2018-12-20 10:12:00 PST
Size:
272.76 KB
patch
obsolete
>Subversion Revision: 239387 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 061d90bf7ea8e8524f26e5d24178db7123fed7be..fd43faaecfcdb622f37e3bc925b994eb73018975 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,21 @@ >+2018-11-14 Zamiul Haque <zhaque@apple.com> >+ >+ Payment process stub with feature flag >+ https://bugs.webkit.org/show_bug.cgi?id=191298 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Configurations/FeatureDefines.xcconfig: >+ >+2018-11-27 Zamiul Haque <zhaque@apple.com> >+ >+ Payment process stub with feature flag >+ https://bugs.webkit.org/show_bug.cgi?id=191298 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Configurations/FeatureDefines.xcconfig: >+ > 2018-12-19 Caio Lima <ticaiolima@gmail.com> > > [BigInt] We should enable CSE into arithmetic operations that speculate BigIntUse >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index dd94ab16122226fd52f58b0c90625d45e6fd1a0d..f3027157f28a841bbe66ee03dc29582c5e83e14b 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-11-14 Zamiul Haque <zhaque@apple.com> >+ >+ Payment process stub with feature flag >+ https://bugs.webkit.org/show_bug.cgi?id=191298 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Configurations/FeatureDefines.xcconfig: >+ * en.lproj/Localizable.strings: >+ >+2018-11-27 Zamiul Haque <zhaque@apple.com> >+ >+ Payment process stub with feature flag >+ https://bugs.webkit.org/show_bug.cgi?id=191298 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Configurations/FeatureDefines.xcconfig: >+ * en.lproj/Localizable.strings: >+ > 2018-12-19 Jer Noble <jer.noble@apple.com> > > Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync() >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index ca7b06235f926b985ad14bb7e313b8586562c89a..86585aa43b81828ccecfe4b504ebaaa182e616d0 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -1,3 +1,21 @@ >+2018-11-14 Zamiul Haque <zhaque@apple.com> >+ >+ Payment process stub with feature flag >+ https://bugs.webkit.org/show_bug.cgi?id=191298 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Configurations/FeatureDefines.xcconfig: >+ >+2018-11-27 Zamiul Haque <zhaque@apple.com> >+ >+ Payment process stub with feature flag >+ https://bugs.webkit.org/show_bug.cgi?id=191298 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Configurations/FeatureDefines.xcconfig: >+ > 2018-12-17 Saam barati <sbarati@apple.com> > > Enable HTTP and HTTPS proxies on iOS and make it a property of the NSURLSession >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index e116f47f9961f4aa606d5910ca34e40df60df6be..9b7d696b7d1985e178a277cdb9bce4ec8b49dcc1 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,341 @@ >+2018-11-14 Zamiul Haque <zhaque@apple.com> >+ >+ Payment process stub with feature flag >+ https://bugs.webkit.org/show_bug.cgi?id=191298 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * CMakeLists.txt: >+ * Configurations/BaseTarget.xcconfig: >+ * Configurations/FeatureDefines.xcconfig: >+ * Configurations/PaymentService.xcconfig: Added. >+ * DerivedSources.make: >+ * PaymentProcess/PaymentProcess.cpp: Copied from Source/WebKit/UIProcess/WebContextClient.cpp. >+ (WebKit::PaymentProcess::singleton): >+ (WebKit::PaymentProcess::PaymentProcess): >+ (WebKit::PaymentProcess::~PaymentProcess): >+ (WebKit::PaymentProcess::initializeConnection): >+ (WebKit::PaymentProcess::shouldTerminate): >+ (WebKit::PaymentProcess::didReceiveMessage): >+ (WebKit::PaymentProcess::createPaymentToWebProcessConnection): >+ * PaymentProcess/PaymentProcess.h: Copied from Source/WebKit/UIProcess/WebContextSupplement.h. >+ * PaymentProcess/PaymentProcess.messages.in: Added. >+ * PaymentProcess/PaymentToWebProcessConnection.cpp: Added. >+ (WebKit::PaymentToWebProcessConnection::create): >+ (WebKit::PaymentToWebProcessConnection::PaymentToWebProcessConnection): >+ (WebKit::PaymentToWebProcessConnection::~PaymentToWebProcessConnection): >+ (WebKit::PaymentToWebProcessConnection::didReceiveMessage): >+ (WebKit::PaymentToWebProcessConnection::didReceiveSyncMessage): >+ (WebKit::PaymentToWebProcessConnection::didClose): >+ (WebKit::PaymentToWebProcessConnection::didReceiveInvalidMessage): >+ * PaymentProcess/PaymentToWebProcessConnection.h: Added. >+ (WebKit::PaymentToWebProcessConnection::connection): >+ * PaymentProcess/PaymentToWebProcessConnection.messages.in: Added. >+ * PaymentProcess/ios/PaymentProcessIOS.mm: Copied from Source/WebKit/UIProcess/WebContextClient.cpp. >+ (WebKit::PaymentProcess::initializeProcess): >+ (WebKit::PaymentProcess::initializeProcessName): >+ (WebKit::PaymentProcess::initializeSandbox): >+ * Resources/SandboxProfiles/ios/com.apple.WebKit.Payments.sb: Added. >+ * Shared/ChildProcess.h: >+ * Shared/Payment/PaymentProcessCreationParameters.cpp: Copied from Source/WebKit/UIProcess/WebContextClient.cpp. >+ (WebKit::PaymentProcessCreationParameters::PaymentProcessCreationParameters): >+ (WebKit::PaymentProcessCreationParameters::encode const): >+ (WebKit::PaymentProcessCreationParameters::decode): >+ * Shared/Payment/PaymentProcessCreationParameters.h: Copied from Source/WebKit/Shared/ProcessExecutablePath.h. >+ * Shared/ProcessExecutablePath.h: >+ * Sources.txt: >+ * SourcesCocoa.txt: >+ * UIProcess/API/C/WKContext.cpp: >+ (WKContextTerminatePaymentProcess): >+ (WKContextGetPaymentProcessIdentifier): >+ * UIProcess/API/C/WKContextPrivate.h: >+ * UIProcess/API/Cocoa/WKProcessPool.mm: >+ (-[WKProcessPool _terminatePaymentProcess]): >+ (-[WKProcessPool _paymentProcessIdentifier]): >+ * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: >+ * UIProcess/Launcher/ProcessLauncher.h: >+ * UIProcess/Launcher/mac/ProcessLauncherMac.mm: >+ (WebKit::serviceName): >+ * UIProcess/Payments/PaymentProcessProxy.cpp: Added. >+ (WebKit::generatePaymentProcessCallbackID): >+ (WebKit::PaymentProcessProxy::PaymentProcessProxy): >+ (WebKit::PaymentProcessProxy::~PaymentProcessProxy): >+ (WebKit::PaymentProcessProxy::terminateForTesting): >+ (WebKit::PaymentProcessProxy::getLaunchOptions): >+ (WebKit::PaymentProcessProxy::processWillShutDown): >+ (WebKit::PaymentProcessProxy::didReceiveMessage): >+ (WebKit::PaymentProcessProxy::getPaymentProcessConnection): >+ (WebKit::PaymentProcessProxy::didClose): >+ (WebKit::PaymentProcessProxy::didReceiveInvalidMessage): >+ (WebKit::PaymentProcessProxy::didCreatePaymentToWebProcessConnection): >+ (WebKit::PaymentProcessProxy::didFinishLaunching): >+ * UIProcess/Payments/PaymentProcessProxy.h: Added. >+ * UIProcess/Payments/PaymentProcessProxy.messages.in: Added. >+ * UIProcess/WebContextClient.cpp: >+ (WebKit::WebContextClient::paymentProcessDidCrash): >+ * UIProcess/WebContextClient.h: >+ * UIProcess/WebContextSupplement.h: >+ (WebKit::WebContextSupplement::processDidClose): >+ * UIProcess/WebProcessPool.cpp: >+ (WebKit::WebProcessPool::sendMemoryPressureEvent): >+ (WebKit::WebProcessPool::ensurePaymentProcess): >+ (WebKit::WebProcessPool::getPaymentProcessConnection): >+ (WebKit::WebProcessPool::paymentProcessCrashed): >+ (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): >+ (WebKit::WebProcessPool::paymentProcessIdentifier): >+ (WebKit::WebProcessPool::terminatePaymentProcessForTesting): >+ * UIProcess/WebProcessPool.h: >+ (WebKit::WebProcessPool::sendToPaymentProcess): >+ (WebKit::WebProcessPool::sendToPaymentProcessRelaunchingIfNecessary): >+ * UIProcess/WebProcessProxy.cpp: >+ (WebKit::WebProcessProxy::getPaymentProcessConnection): >+ * UIProcess/WebProcessProxy.h: >+ * UIProcess/WebProcessProxy.messages.in: >+ * UIProcess/WebsiteData/WebsiteDataStore.cpp: >+ (WebKit::WebsiteDataStore::~WebsiteDataStore): >+ (WebKit::WebsiteDataStore::paymentProcessParameters): >+ * UIProcess/WebsiteData/WebsiteDataStore.h: >+ * WebKit.xcodeproj/project.pbxproj: >+ * WebProcess/Payments/WebToPaymentProcessConnection.cpp: Added. >+ (WebKit::WebToPaymentProcessConnection::WebToPaymentProcessConnection): >+ (WebKit::WebToPaymentProcessConnection::~WebToPaymentProcessConnection): >+ (WebKit::WebToPaymentProcessConnection::didReceiveMessage): >+ (WebKit::WebToPaymentProcessConnection::didReceiveSyncMessage): >+ (WebKit::WebToPaymentProcessConnection::didClose): >+ (WebKit::WebToPaymentProcessConnection::didReceiveInvalidMessage): >+ * WebProcess/Payments/WebToPaymentProcessConnection.h: Added. >+ (WebKit::WebToPaymentProcessConnection::create): >+ (WebKit::WebToPaymentProcessConnection::connection): >+ * WebProcess/Storage/WebSWClientConnection.h: >+ * WebProcess/WebProcess.cpp: >+ (WebKit::WebProcess::webToPaymentProcessConnectionClosed): >+ (WebKit::WebProcess::ensureWebToPaymentProcessConnection): >+ (WebKit::WebProcess::setEnhancedAccessibility): Deleted. >+ (WebKit::WebProcess::startMemorySampler): Deleted. >+ (WebKit::WebProcess::stopMemorySampler): Deleted. >+ (WebKit::WebProcess::setTextCheckerState): Deleted. >+ (WebKit::WebProcess::releasePageCache): Deleted. >+ (WebKit::WebProcess::fetchWebsiteData): Deleted. >+ (WebKit::WebProcess::deleteWebsiteData): Deleted. >+ (WebKit::WebProcess::deleteWebsiteDataForOrigins): Deleted. >+ (WebKit::WebProcess::setHiddenPageDOMTimerThrottlingIncreaseLimit): Deleted. >+ (WebKit::WebProcess::initializeProcessName): Deleted. >+ (WebKit::WebProcess::initializeSandbox): Deleted. >+ (WebKit::WebProcess::platformInitializeProcess): Deleted. >+ (WebKit::WebProcess::updateActivePages): Deleted. >+ (WebKit::WebProcess::getActivePagesOriginsForTesting): Deleted. >+ (WebKit::WebProcess::updateCPULimit): Deleted. >+ (WebKit::WebProcess::updateCPUMonitorState): Deleted. >+ (WebKit::WebProcess::pageActivityStateDidChange): Deleted. >+ (WebKit::WebProcess::resetAllGeolocationPermissions): Deleted. >+ (WebKit::WebProcess::actualPrepareToSuspend): Deleted. >+ (WebKit::WebProcess::processWillSuspendImminently): Deleted. >+ (WebKit::WebProcess::prepareToSuspend): Deleted. >+ (WebKit::WebProcess::cancelPrepareToSuspend): Deleted. >+ (WebKit::WebProcess::markAllLayersVolatile): Deleted. >+ (WebKit::WebProcess::cancelMarkAllLayersVolatile): Deleted. >+ (WebKit::WebProcess::setAllLayerTreeStatesFrozen): Deleted. >+ (WebKit::WebProcess::processDidResume): Deleted. >+ (WebKit::WebProcess::sendPrewarmInformation): Deleted. >+ (WebKit::WebProcess::pageDidEnterWindow): Deleted. >+ (WebKit::WebProcess::pageWillLeaveWindow): Deleted. >+ (WebKit::WebProcess::nonVisibleProcessCleanupTimerFired): Deleted. >+ (WebKit::WebProcess::setResourceLoadStatisticsEnabled): Deleted. >+ (WebKit::WebProcess::clearResourceLoadStatistics): Deleted. >+ (WebKit::WebProcess::transformHandlesToObjects): Deleted. >+ (WebKit::WebProcess::transformObjectsToHandles): Deleted. >+ (WebKit::WebProcess::setMemoryCacheDisabled): Deleted. >+ (WebKit::WebProcess::setEnabledServices): Deleted. >+ (WebKit::WebProcess::ensureAutomationSessionProxy): Deleted. >+ (WebKit::WebProcess::destroyAutomationSessionProxy): Deleted. >+ (WebKit::WebProcess::prefetchDNS): Deleted. >+ (WebKit::WebProcess::hasVisibleWebPage const): Deleted. >+ (WebKit::WebProcess::libWebRTCNetwork): Deleted. >+ (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess): Deleted. >+ (WebKit::WebProcess::registerServiceWorkerClients): Deleted. >+ (WebKit::WebProcess::setScreenProperties): Deleted. >+ (WebKit::WebProcess::addMockMediaDevice): Deleted. >+ (WebKit::WebProcess::clearMockMediaDevices): Deleted. >+ (WebKit::WebProcess::removeMockMediaDevice): Deleted. >+ (WebKit::WebProcess::resetMockMediaDevices): Deleted. >+ * WebProcess/WebProcess.h: >+ >+2018-11-27 Zamiul Haque <zhaque@apple.com> >+ >+ Payment process stub with feature flag >+ https://bugs.webkit.org/show_bug.cgi?id=191298 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * CMakeLists.txt: >+ * Configurations/BaseTarget.xcconfig: >+ * Configurations/FeatureDefines.xcconfig: >+ * Configurations/PaymentService.xcconfig: Added. >+ * DerivedSources.make: >+ * PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist: Added. >+ * PaymentProcess/EntryPoint/ios/XPCService/PaymentServiceEntryPoint.mm: Copied from Source/WebKit/UIProcess/WebContextSupplement.h. >+ (WebKit::PaymentServiceInitializerDelegate::PaymentServiceInitializerDelegate): >+ (PaymentServiceInitializer): >+ * PaymentProcess/PaymentProcess.cpp: Copied from Source/WebKit/UIProcess/WebContextClient.cpp. >+ (WebKit::PaymentProcess::singleton): >+ (WebKit::PaymentProcess::PaymentProcess): >+ (WebKit::PaymentProcess::~PaymentProcess): >+ (WebKit::PaymentProcess::initializeConnection): >+ (WebKit::PaymentProcess::shouldTerminate): >+ (WebKit::PaymentProcess::didReceiveMessage): >+ (WebKit::PaymentProcess::createPaymentToWebProcessConnection): >+ * PaymentProcess/PaymentProcess.h: Copied from Source/WebKit/UIProcess/WebContextSupplement.h. >+ * PaymentProcess/PaymentProcess.messages.in: Added. >+ * PaymentProcess/PaymentToWebProcessConnection.cpp: Added. >+ (WebKit::PaymentToWebProcessConnection::create): >+ (WebKit::PaymentToWebProcessConnection::PaymentToWebProcessConnection): >+ (WebKit::PaymentToWebProcessConnection::~PaymentToWebProcessConnection): >+ (WebKit::PaymentToWebProcessConnection::didReceiveMessage): >+ (WebKit::PaymentToWebProcessConnection::didReceiveSyncMessage): >+ (WebKit::PaymentToWebProcessConnection::didClose): >+ (WebKit::PaymentToWebProcessConnection::didReceiveInvalidMessage): >+ * PaymentProcess/PaymentToWebProcessConnection.h: Added. >+ (WebKit::PaymentToWebProcessConnection::connection): >+ * PaymentProcess/PaymentToWebProcessConnection.messages.in: Added. >+ * PaymentProcess/ios/PaymentProcessIOS.mm: Copied from Source/WebKit/UIProcess/WebContextClient.cpp. >+ (WebKit::PaymentProcess::initializeProcess): >+ (WebKit::PaymentProcess::initializeProcessName): >+ (WebKit::PaymentProcess::initializeSandbox): >+ * Resources/SandboxProfiles/ios/com.apple.WebKit.Payments.sb: Added. >+ * Shared/ChildProcess.h: >+ * Shared/Payment/PaymentProcessCreationParameters.cpp: Copied from Source/WebKit/UIProcess/WebContextClient.cpp. >+ (WebKit::PaymentProcessCreationParameters::PaymentProcessCreationParameters): >+ (WebKit::PaymentProcessCreationParameters::encode const): >+ (WebKit::PaymentProcessCreationParameters::decode): >+ * Shared/Payment/PaymentProcessCreationParameters.h: Copied from Source/WebKit/Shared/ProcessExecutablePath.h. >+ * Shared/ProcessExecutablePath.h: >+ * Sources.txt: >+ * SourcesCocoa.txt: >+ * UIProcess/API/C/WKContext.cpp: >+ (WKContextTerminatePaymentProcess): >+ (WKContextGetPaymentProcessIdentifier): >+ * UIProcess/API/C/WKContext.h: >+ * UIProcess/API/C/WKContextPrivate.h: >+ * UIProcess/API/Cocoa/WKProcessPool.mm: >+ (-[WKProcessPool _terminatePaymentProcess]): >+ (-[WKProcessPool _paymentProcessIdentifier]): >+ * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: >+ * UIProcess/Launcher/ProcessLauncher.h: >+ * UIProcess/Launcher/mac/ProcessLauncherMac.mm: >+ (WebKit::serviceName): >+ * UIProcess/Payments/PaymentProcessProxy.cpp: Added. >+ (WebKit::PaymentProcessProxy::PaymentProcessProxy): >+ (WebKit::PaymentProcessProxy::~PaymentProcessProxy): >+ (WebKit::PaymentProcessProxy::terminateForTesting): >+ (WebKit::PaymentProcessProxy::getPaymentProcessConnection): >+ (WebKit::PaymentProcessProxy::getLaunchOptions): >+ (WebKit::PaymentProcessProxy::processWillShutDown): >+ (WebKit::PaymentProcessProxy::didReceiveMessage): >+ (WebKit::PaymentProcessProxy::didClose): >+ (WebKit::PaymentProcessProxy::didReceiveInvalidMessage): >+ (WebKit::didReceivePaymentProcessProxyMessage): >+ (WebKit::PaymentProcessProxy::didCreatePaymentToWebProcessConnection): >+ (WebKit::PaymentProcessProxy::didFinishLaunching): >+ * UIProcess/Payments/PaymentProcessProxy.h: Added. >+ * UIProcess/Payments/PaymentProcessProxy.messages.in: Added. >+ * UIProcess/WebContextClient.cpp: >+ (WebKit::WebContextClient::paymentProcessDidCrash): >+ * UIProcess/WebContextClient.h: >+ * UIProcess/WebContextSupplement.h: >+ (WebKit::WebContextSupplement::processDidClose): >+ * UIProcess/WebInspectorProxy.cpp: >+ (WebKit::WebInspectorProxy::platformShowCertificate): >+ * UIProcess/WebProcessPool.cpp: >+ (WebKit::WebProcessPool::sendMemoryPressureEvent): >+ (WebKit::WebProcessPool::ensurePaymentProcess): >+ (WebKit::WebProcessPool::getPaymentProcessConnection): >+ (WebKit::WebProcessPool::paymentProcessCrashed): >+ (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled): >+ (WebKit::WebProcessPool::paymentProcessIdentifier): >+ (WebKit::WebProcessPool::terminatePaymentProcessForTesting): >+ * UIProcess/WebProcessPool.h: >+ (WebKit::WebProcessPool::sendToPaymentProcess): >+ (WebKit::WebProcessPool::sendToPaymentProcessRelaunchingIfNecessary): >+ * UIProcess/WebProcessProxy.cpp: >+ (WebKit::WebProcessProxy::getPaymentProcessConnection): >+ * UIProcess/WebProcessProxy.h: >+ * UIProcess/WebProcessProxy.messages.in: >+ * UIProcess/WebsiteData/WebsiteDataStore.cpp: >+ (WebKit::WebsiteDataStore::~WebsiteDataStore): >+ (WebKit::WebsiteDataStore::destroyPaymentProcessSession): >+ (WebKit::WebsiteDataStore::paymentProcessParameters): >+ * UIProcess/WebsiteData/WebsiteDataStore.h: >+ * UIProcess/wpe/WebInspectorProxyWPE.cpp: >+ (WebKit::WebInspectorProxy::platformShowCertificate): >+ * WebKit.xcodeproj/project.pbxproj: >+ * WebProcess/Payments/WebToPaymentProcessConnection.cpp: Added. >+ (WebKit::WebToPaymentProcessConnection::WebToPaymentProcessConnection): >+ (WebKit::WebToPaymentProcessConnection::~WebToPaymentProcessConnection): >+ (WebKit::WebToPaymentProcessConnection::didReceiveMessage): >+ (WebKit::WebToPaymentProcessConnection::didReceiveSyncMessage): >+ (WebKit::WebToPaymentProcessConnection::didClose): >+ (WebKit::WebToPaymentProcessConnection::didReceiveInvalidMessage): >+ * WebProcess/Payments/WebToPaymentProcessConnection.h: Added. >+ (WebKit::WebToPaymentProcessConnection::create): >+ (WebKit::WebToPaymentProcessConnection::connection): >+ * WebProcess/WebPage/WebPageInspectorTargetController.cpp: >+ (WebKit::WebPageInspectorTargetController::connectInspector): >+ (WebKit::WebPageInspectorTargetController::disconnectInspector): >+ (WebKit::WebPageInspectorTargetController::sendMessageToTargetBackend): >+ * WebProcess/WebProcess.cpp: >+ (WebKit::WebProcess::webToPaymentProcessConnectionClosed): >+ (WebKit::WebProcess::ensureWebToPaymentProcessConnection): >+ (WebKit::WebProcess::setEnhancedAccessibility): Deleted. >+ (WebKit::WebProcess::startMemorySampler): Deleted. >+ (WebKit::WebProcess::stopMemorySampler): Deleted. >+ (WebKit::WebProcess::setTextCheckerState): Deleted. >+ (WebKit::WebProcess::releasePageCache): Deleted. >+ (WebKit::WebProcess::fetchWebsiteData): Deleted. >+ (WebKit::WebProcess::deleteWebsiteData): Deleted. >+ (WebKit::WebProcess::deleteWebsiteDataForOrigins): Deleted. >+ (WebKit::WebProcess::setHiddenPageDOMTimerThrottlingIncreaseLimit): Deleted. >+ (WebKit::WebProcess::initializeProcessName): Deleted. >+ (WebKit::WebProcess::initializeSandbox): Deleted. >+ (WebKit::WebProcess::platformInitializeProcess): Deleted. >+ (WebKit::WebProcess::updateActivePages): Deleted. >+ (WebKit::WebProcess::getActivePagesOriginsForTesting): Deleted. >+ (WebKit::WebProcess::updateCPULimit): Deleted. >+ (WebKit::WebProcess::updateCPUMonitorState): Deleted. >+ (WebKit::WebProcess::pageActivityStateDidChange): Deleted. >+ (WebKit::WebProcess::resetAllGeolocationPermissions): Deleted. >+ (WebKit::WebProcess::actualPrepareToSuspend): Deleted. >+ (WebKit::WebProcess::processWillSuspendImminently): Deleted. >+ (WebKit::WebProcess::prepareToSuspend): Deleted. >+ (WebKit::WebProcess::cancelPrepareToSuspend): Deleted. >+ (WebKit::WebProcess::markAllLayersVolatile): Deleted. >+ (WebKit::WebProcess::cancelMarkAllLayersVolatile): Deleted. >+ (WebKit::WebProcess::freezeAllLayerTrees): Deleted. >+ (WebKit::WebProcess::unfreezeAllLayerTrees): Deleted. >+ (WebKit::WebProcess::processDidResume): Deleted. >+ (WebKit::WebProcess::sendPrewarmInformation): Deleted. >+ (WebKit::WebProcess::pageDidEnterWindow): Deleted. >+ (WebKit::WebProcess::pageWillLeaveWindow): Deleted. >+ (WebKit::WebProcess::nonVisibleProcessCleanupTimerFired): Deleted. >+ (WebKit::WebProcess::setResourceLoadStatisticsEnabled): Deleted. >+ (WebKit::WebProcess::clearResourceLoadStatistics): Deleted. >+ (WebKit::WebProcess::transformHandlesToObjects): Deleted. >+ (WebKit::WebProcess::transformObjectsToHandles): Deleted. >+ (WebKit::WebProcess::setMemoryCacheDisabled): Deleted. >+ (WebKit::WebProcess::setEnabledServices): Deleted. >+ (WebKit::WebProcess::ensureAutomationSessionProxy): Deleted. >+ (WebKit::WebProcess::destroyAutomationSessionProxy): Deleted. >+ (WebKit::WebProcess::prefetchDNS): Deleted. >+ (WebKit::WebProcess::hasVisibleWebPage const): Deleted. >+ (WebKit::WebProcess::libWebRTCNetwork): Deleted. >+ (WebKit::WebProcess::establishWorkerContextConnectionToNetworkProcess): Deleted. >+ (WebKit::WebProcess::registerServiceWorkerClients): Deleted. >+ (WebKit::WebProcess::setScreenProperties): Deleted. >+ (WebKit::WebProcess::addMockMediaDevice): Deleted. >+ (WebKit::WebProcess::clearMockMediaDevices): Deleted. >+ (WebKit::WebProcess::removeMockMediaDevice): Deleted. >+ (WebKit::WebProcess::resetMockMediaDevices): Deleted. >+ * WebProcess/WebProcess.h: >+ > 2018-12-19 Megan Gardner <megan_gardner@apple.com> > > Allow clients to set the navigator platform >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index acb13344f5f116b698e706daac8c34cff8985465..0f1affe425df877f2e0dc8ec8ef750a9cbc051f5 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,12 @@ >+2018-11-27 Zamiul Haque <zhaque@apple.com> >+ >+ Payment process stub with feature flag >+ https://bugs.webkit.org/show_bug.cgi?id=191298 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Configurations/FeatureDefines.xcconfig: >+ > 2018-12-19 Megan Gardner <megan_gardner@apple.com> > > Allow clients to set the navigator platform >diff --git a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig >index 2e9a04d01bdd1421c4b457114bf89c3c784ef9c0..ad6b5f389e374afd7c050841107879efa82a7ae5 100644 >--- a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig >+++ b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig >@@ -292,6 +292,7 @@ ENABLE_NAVIGATOR_STANDALONE_cocoatouch = ENABLE_NAVIGATOR_STANDALONE; > ENABLE_NOTIFICATIONS = $(ENABLE_NOTIFICATIONS_$(WK_PLATFORM_NAME)); > ENABLE_NOTIFICATIONS_macosx = ENABLE_NOTIFICATIONS; > >+ENABLE_PAYMENT_PROCESS = ENABLE_PAYMENT_PROCESS; > ENABLE_PAYMENT_REQUEST = ENABLE_PAYMENT_REQUEST; > > ENABLE_PDFKIT_PLUGIN = $(ENABLE_PDFKIT_PLUGIN_$(WK_PLATFORM_NAME)); >diff --git a/Source/WebCore/Configurations/FeatureDefines.xcconfig b/Source/WebCore/Configurations/FeatureDefines.xcconfig >index 2e9a04d01bdd1421c4b457114bf89c3c784ef9c0..ad6b5f389e374afd7c050841107879efa82a7ae5 100644 >--- a/Source/WebCore/Configurations/FeatureDefines.xcconfig >+++ b/Source/WebCore/Configurations/FeatureDefines.xcconfig >@@ -292,6 +292,7 @@ ENABLE_NAVIGATOR_STANDALONE_cocoatouch = ENABLE_NAVIGATOR_STANDALONE; > ENABLE_NOTIFICATIONS = $(ENABLE_NOTIFICATIONS_$(WK_PLATFORM_NAME)); > ENABLE_NOTIFICATIONS_macosx = ENABLE_NOTIFICATIONS; > >+ENABLE_PAYMENT_PROCESS = ENABLE_PAYMENT_PROCESS; > ENABLE_PAYMENT_REQUEST = ENABLE_PAYMENT_REQUEST; > > ENABLE_PDFKIT_PLUGIN = $(ENABLE_PDFKIT_PLUGIN_$(WK_PLATFORM_NAME)); >diff --git a/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig b/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig >index 2e9a04d01bdd1421c4b457114bf89c3c784ef9c0..ad6b5f389e374afd7c050841107879efa82a7ae5 100644 >--- a/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig >+++ b/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig >@@ -292,6 +292,7 @@ ENABLE_NAVIGATOR_STANDALONE_cocoatouch = ENABLE_NAVIGATOR_STANDALONE; > ENABLE_NOTIFICATIONS = $(ENABLE_NOTIFICATIONS_$(WK_PLATFORM_NAME)); > ENABLE_NOTIFICATIONS_macosx = ENABLE_NOTIFICATIONS; > >+ENABLE_PAYMENT_PROCESS = ENABLE_PAYMENT_PROCESS; > ENABLE_PAYMENT_REQUEST = ENABLE_PAYMENT_REQUEST; > > ENABLE_PDFKIT_PLUGIN = $(ENABLE_PDFKIT_PLUGIN_$(WK_PLATFORM_NAME)); >diff --git a/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h b/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h >index c08748955651d9cc3b7f3153df5529e1633d3ea1..53a372d04044898008304b906cef9b2549373a4e 100644 >--- a/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h >+++ b/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.h >@@ -36,6 +36,7 @@ SOFT_LINK_CLASS_FOR_HEADER(PAL, PKContact) > SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPassLibrary) > SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPayment) > SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentAuthorizationViewController) >+SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentAuthorizationController) > SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentMethod) > SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentMerchantSession) > SOFT_LINK_CLASS_FOR_HEADER(PAL, PKPaymentRequest) >diff --git a/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm b/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm >index 32f7be09caac56f0f06f2d8773e77c0b84de8f93..086452babd9837adde19b4f4f8c49e0b02d878b9 100644 >--- a/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm >+++ b/Source/WebCore/PAL/pal/cocoa/PassKitSoftLink.mm >@@ -39,6 +39,7 @@ SOFT_LINK_FRAMEWORK_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PAL_EXPORT) > SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKContact, PAL_EXPORT) > SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPassLibrary, PAL_EXPORT) > SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPayment, PAL_EXPORT) >+SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentAuthorizationController, PAL_EXPORT) > SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentAuthorizationViewController, PAL_EXPORT) > SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentMerchantSession, PAL_EXPORT) > SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT(PAL, PassKit, PKPaymentMethod, PAL_EXPORT) >diff --git a/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h b/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h >index 18958e92614c1e3b6a4f04a68ad1433ab1971817..8b8baea6971c9863139e2a5129660b5ee06363af 100644 >--- a/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h >+++ b/Source/WebCore/PAL/pal/spi/cocoa/PassKitSPI.h >@@ -40,6 +40,7 @@ WTF_EXTERN_C_END > #if USE(APPLE_INTERNAL_SDK) > > #import <PassKit/PassKit.h> >+#import <PassKit/PKPaymentAuthorizationController_Private.h> > #import <PassKit/PKPaymentAuthorizationViewController_Private.h> > #import <PassKit/PKPaymentRequest_Private.h> > >diff --git a/Source/WebCore/en.lproj/Localizable.strings b/Source/WebCore/en.lproj/Localizable.strings >index 553e5620dfee6f9bdaf009bae0c2fcae2f2baa5d..7bdae93fdbf2305baaafb7d58435d4c7f3a136e3 100644 >--- a/Source/WebCore/en.lproj/Localizable.strings >+++ b/Source/WebCore/en.lproj/Localizable.strings >@@ -43,6 +43,9 @@ > /* Visible name of Service Worker process. The argument is the application name. */ > "%@ Service Worker (%@)" = "%@ Service Worker (%@)"; > >+/* visible name of the payment process. The argument is the application name. */ >+"%@ Payments" = "%@ Payments"; >+ > /* Visible name of the web process. The argument is the application name. */ > "%@ Web Content" = "%@ Web Content"; > >diff --git a/Source/WebKit/CMakeLists.txt b/Source/WebKit/CMakeLists.txt >index 6db1e9118a6994f945f38f1af2dfaca20b8c3d84..c62ffae1f3cfe8c4b9501d9535270ab7798053a1 100644 >--- a/Source/WebKit/CMakeLists.txt >+++ b/Source/WebKit/CMakeLists.txt >@@ -14,6 +14,7 @@ set(WebKit_INCLUDE_DIRECTORIES > "${WEBKIT_DIR}/NetworkProcess/cache" > "${WEBKIT_DIR}/NetworkProcess/watchos" > "${WEBKIT_DIR}/NetworkProcess/webrtc" >+ "${WEBKIT_DIR}/PaymentProcess" > "${WEBKIT_DIR}/Platform" > "${WEBKIT_DIR}/Platform/IPC" > "${WEBKIT_DIR}/PluginProcess" >@@ -26,6 +27,7 @@ set(WebKit_INCLUDE_DIRECTORIES > "${WEBKIT_DIR}/Shared/Databases/IndexedDB" > "${WEBKIT_DIR}/Shared/FileAPI" > "${WEBKIT_DIR}/Shared/Gamepad" >+ "${WEBKIT_DIR}/Shared/Payment" > "${WEBKIT_DIR}/Shared/Plugins" > "${WEBKIT_DIR}/Shared/Plugins/Netscape" > "${WEBKIT_DIR}/Shared/Plugins/Netscape/x11" >@@ -44,6 +46,7 @@ set(WebKit_INCLUDE_DIRECTORIES > "${WEBKIT_DIR}/UIProcess/Network" > "${WEBKIT_DIR}/UIProcess/Network/CustomProtocols" > "${WEBKIT_DIR}/UIProcess/Notifications" >+ "${WEBKIT_DIR}/UIProcess/Payment" > "${WEBKIT_DIR}/UIProcess/Plugins" > "${WEBKIT_DIR}/UIProcess/RemoteLayerTree" > "${WEBKIT_DIR}/UIProcess/UserContent" >@@ -120,6 +123,9 @@ set(WebKit_MESSAGES_IN_FILES > NetworkProcess/webrtc/NetworkRTCProvider.messages.in > NetworkProcess/webrtc/NetworkRTCSocket.messages.in > >+ PaymentProcess/PaymentProcess.messages.in >+ PaymentProcess/PaymentToWebProcessConnection.messages.in >+ > PluginProcess/PluginControllerProxy.messages.in > PluginProcess/PluginProcess.messages.in > PluginProcess/WebProcessConnection.messages.in >@@ -150,6 +156,8 @@ set(WebKit_MESSAGES_IN_FILES > > UIProcess/Network/NetworkProcessProxy.messages.in > >+ UIProcess/Payments/PaymentProcessProxy.messages.in >+ > UIProcess/Plugins/PluginProcessProxy.messages.in > > UIProcess/UserContent/WebUserContentControllerProxy.messages.in >@@ -220,6 +228,10 @@ set(NetworkProcess_LIBRARIES > WebKit > ) > >+set(PaymentProcess_LIBRARIES >+ WebKit >+) >+ > set(PluginProcess_LIBRARIES > WebKit > ) >diff --git a/Source/WebKit/Configurations/BaseTarget.xcconfig b/Source/WebKit/Configurations/BaseTarget.xcconfig >index 405d63bbb012a39e65da8ba8b8908358a258bd6c..eeb7a26ada1463d2ad5a8dcfdb206a4d63cf3e25 100644 >--- a/Source/WebKit/Configurations/BaseTarget.xcconfig >+++ b/Source/WebKit/Configurations/BaseTarget.xcconfig >@@ -111,6 +111,8 @@ WK_HAVE_CORE_PREDICTION[sdk=macosx*][arch=i386] = NO; > WK_CORE_PREDICTION_DEFINES = $(WK_CORE_PREDICTION_DEFINES_$(WK_HAVE_CORE_PREDICTION)); > WK_CORE_PREDICTION_DEFINES_YES = HAVE_CORE_PREDICTION; > >+WK_PAYMENT_SERVICE_PRODUCT_NAME = com.apple.WebKit.Payments; >+ > WK_STORAGE_SERVICE_PRODUCT_NAME = $(WK_STORAGE_SERVICE_PRODUCT_NAME_$(WK_USE_LEGACY_STORAGE_SERVICE_NAME)); > WK_STORAGE_SERVICE_PRODUCT_NAME_ = $(WK_STORAGE_SERVICE_PRODUCT_NAME_NO); > WK_STORAGE_SERVICE_PRODUCT_NAME_NO = com.apple.WebKit.Storage; >diff --git a/Source/WebKit/Configurations/FeatureDefines.xcconfig b/Source/WebKit/Configurations/FeatureDefines.xcconfig >index 2e9a04d01bdd1421c4b457114bf89c3c784ef9c0..ad6b5f389e374afd7c050841107879efa82a7ae5 100644 >--- a/Source/WebKit/Configurations/FeatureDefines.xcconfig >+++ b/Source/WebKit/Configurations/FeatureDefines.xcconfig >@@ -292,6 +292,7 @@ ENABLE_NAVIGATOR_STANDALONE_cocoatouch = ENABLE_NAVIGATOR_STANDALONE; > ENABLE_NOTIFICATIONS = $(ENABLE_NOTIFICATIONS_$(WK_PLATFORM_NAME)); > ENABLE_NOTIFICATIONS_macosx = ENABLE_NOTIFICATIONS; > >+ENABLE_PAYMENT_PROCESS = ENABLE_PAYMENT_PROCESS; > ENABLE_PAYMENT_REQUEST = ENABLE_PAYMENT_REQUEST; > > ENABLE_PDFKIT_PLUGIN = $(ENABLE_PDFKIT_PLUGIN_$(WK_PLATFORM_NAME)); >diff --git a/Source/WebKit/Configurations/PaymentService.xcconfig b/Source/WebKit/Configurations/PaymentService.xcconfig >new file mode 100644 >index 0000000000000000000000000000000000000000..acb5c3d8bbf6e16332cb8a2660510feb41573657 >--- /dev/null >+++ b/Source/WebKit/Configurations/PaymentService.xcconfig >@@ -0,0 +1,38 @@ >+// Copyright (C) 2018 Apple Inc. All rights reserved. >+// >+// Redistribution and use in source and binary forms, with or without >+// modification, are permitted provided that the following conditions >+// are met: >+// 1. Redistributions of source code must retain the above copyright >+// notice, this list of conditions and the following disclaimer. >+// 2. Redistributions in binary form must reproduce the above copyright >+// notice, this list of conditions and the following disclaimer in the >+// documentation and/or other materials provided with the distribution. >+// >+// THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >+// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ >+#include "BaseXPCService.xcconfig" >+ >+WK_PAYMENT_ENTITLEMENTS_RESTRICTED_NO = ; >+ >+WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE = $(WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_$(WK_PLATFORM_NAME)); >+WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_iphoneos = Payments-iOS; >+WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_iphonesimulator = Payments-iOS; >+ >+CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO = $(WK_PAYMENT_ENTITLEMENTS_RESTRICTED_$(WK_USE_RESTRICTED_ENTITLEMENTS)); >+CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO = $(WK_PAYMENT_ENTITLEMENTS_RESTRICTED_$(WK_USE_RESTRICTED_ENTITLEMENTS)); >+OTHER_CODE_SIGN_FLAGS = $(WK_LIBRARY_VALIDATION_CODE_SIGN_FLAGS); >+ >+PRODUCT_NAME = com.apple.WebKit.Payments; >+PRODUCT_BUNDLE_IDENTIFIER = $(PRODUCT_NAME); >+INFOPLIST_FILE[sdk=iphone*] = PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist; >diff --git a/Source/WebKit/Configurations/Payments-iOS-minimalsimulator.entitlements b/Source/WebKit/Configurations/Payments-iOS-minimalsimulator.entitlements >new file mode 100644 >index 0000000000000000000000000000000000000000..2d7aa325e8989090e7d942e4f0aead288c3e6c3f >--- /dev/null >+++ b/Source/WebKit/Configurations/Payments-iOS-minimalsimulator.entitlements >@@ -0,0 +1,10 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> >+<plist version="1.0"> >+<dict> >+ <key>seatbelt-profiles</key> >+ <array> >+ <string>com.apple.WebKit.Payments</string> >+ </array> >+</dict> >+</plist> >diff --git a/Source/WebKit/Configurations/Payments-iOS.entitlements b/Source/WebKit/Configurations/Payments-iOS.entitlements >new file mode 100644 >index 0000000000000000000000000000000000000000..0ea40bbdc68b26f04c44a19dac8a15c3d5fcad52 >--- /dev/null >+++ b/Source/WebKit/Configurations/Payments-iOS.entitlements >@@ -0,0 +1,14 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> >+<plist version="1.0"> >+<dict> >+ <key>com.apple.payment.all-access</key> >+ <true/> >+ <key>com.apple.private.in-app-payments</key> >+ <true/> >+ <key>seatbelt-profiles</key> >+ <array> >+ <string>com.apple.WebKit.Payments</string> >+ </array> >+</dict> >+</plist> >diff --git a/Source/WebKit/DerivedSources.make b/Source/WebKit/DerivedSources.make >index 2fde5550cf4d70adc09def357a98782273e55472..920c089ab9e4056404d3ea1ec6a839863f23eea3 100644 >--- a/Source/WebKit/DerivedSources.make >+++ b/Source/WebKit/DerivedSources.make >@@ -30,6 +30,7 @@ VPATH = \ > $(WebKit2)/NetworkProcess/webrtc \ > $(WebKit2)/NetworkProcess/IndexedDB \ > $(WebKit2)/NetworkProcess/ServiceWorker \ >+ $(WebKit2)/PaymentProcess \ > $(WebKit2)/PluginProcess \ > $(WebKit2)/PluginProcess/mac \ > $(WebKit2)/Shared/Plugins \ >@@ -51,6 +52,7 @@ VPATH = \ > $(WebKit2)/WebProcess/Network/webrtc \ > $(WebKit2)/WebProcess/Notifications \ > $(WebKit2)/WebProcess/OriginData \ >+ $(WebKit2)/WebProcess/Payments \ > $(WebKit2)/WebProcess/Plugins \ > $(WebKit2)/WebProcess/ResourceCache \ > $(WebKit2)/WebProcess/Storage \ >@@ -73,6 +75,7 @@ VPATH = \ > $(WebKit2)/UIProcess/Network \ > $(WebKit2)/UIProcess/Network/CustomProtocols \ > $(WebKit2)/UIProcess/Notifications \ >+ $(WebKit2)/UIProcess/Payments \ > $(WebKit2)/UIProcess/Plugins \ > $(WebKit2)/UIProcess/RemoteLayerTree \ > $(WebKit2)/UIProcess/Storage \ >@@ -118,6 +121,11 @@ MESSAGE_RECEIVERS = \ > NetworkSocketStream \ > PlaybackSessionManager \ > PlaybackSessionManagerProxy \ >+ PaymentProcess \ >+ PaymentProcessProxy \ >+ PaymentProcessCoordinator \ >+ PaymentProcessCoordinatorProxy \ >+ PaymentToWebProcessConnection \ > PluginControllerProxy \ > PluginProcess \ > PluginProcessConnection \ >@@ -182,6 +190,7 @@ MESSAGE_RECEIVERS = \ > WebSWServerConnection \ > WebSWServerToContextConnection \ > WebSocketStream \ >+ WebToPaymentProcessConnection \ > WebUserContentController \ > WebUserContentControllerProxy \ > # >diff --git a/Source/WebKit/PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist b/Source/WebKit/PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist >new file mode 100644 >index 0000000000000000000000000000000000000000..7669a6359ba4e0f31f282efeec60241674445881 >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist >@@ -0,0 +1,43 @@ >+<?xml version="1.0" encoding="UTF-8"?> >+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> >+<plist version="1.0"> >+<dict> >+ <key>CFBundleGetInfoString</key> >+ <string>${BUNDLE_VERSION}, Copyright 2003-2018 Apple Inc.</string> >+ <key>CFBundleDevelopmentRegion</key> >+ <string>English</string> >+ <key>CFBundleExecutable</key> >+ <string>${EXECUTABLE_NAME}</string> >+ <key>CFBundleIdentifier</key> >+ <string>${PRODUCT_BUNDLE_IDENTIFIER}</string> >+ <key>CFBundleInfoDictionaryVersion</key> >+ <string>6.0</string> >+ <key>CFBundleName</key> >+ <string>${PRODUCT_NAME}</string> >+ <key>CFBundlePackageType</key> >+ <string>XPC!</string> >+ <key>CFBundleShortVersionString</key> >+ <string>${SHORT_VERSION_STRING}</string> >+ <key>CFBundleSignature</key> >+ <string>????</string> >+ <key>CFBundleVersion</key> >+ <string>${BUNDLE_VERSION}</string> >+ <key>LSFileQuarantineEnabled</key> >+ <true/> >+ <key>NSPrincipalClass</key> >+ <string>NSApplication</string> >+ <key>WebKitEntryPoint</key> >+ <string>PaymentServiceInitializer</string> >+ <key>LSUIElement</key> >+ <true/> >+ <key>XPCService</key> >+ <dict> >+ <key>ServiceType</key> >+ <string>Application</string> >+ <key>RunLoopType</key> >+ <string>NSRunLoop</string> >+ <key>_MultipleInstances</key> >+ <true/> >+ </dict> >+</dict> >+</plist> >diff --git a/Source/WebKit/PaymentProcess/EntryPoint/ios/XPCService/PaymentServiceEntryPoint.mm b/Source/WebKit/PaymentProcess/EntryPoint/ios/XPCService/PaymentServiceEntryPoint.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..c7925ed3c285ed671e8085b646a9647c459e2e58 >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/EntryPoint/ios/XPCService/PaymentServiceEntryPoint.mm >@@ -0,0 +1,55 @@ >+/* >+ * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+ >+#import "EnvironmentUtilities.h" >+#import "PaymentProcess.h" >+#import "WKBase.h" >+#import "XPCServiceEntryPoint.h" >+ >+namespace WebKit { >+ >+class PaymentServiceInitializerDelegate : public XPCServiceInitializerDelegate { >+public: >+ PaymentServiceInitializerDelegate(OSObjectPtr<xpc_connection_t> connection, xpc_object_t initializerMessage) >+ : XPCServiceInitializerDelegate(WTFMove(connection), initializerMessage) >+ { >+ } >+}; >+ >+} // namespace WebKit >+ >+using namespace WebKit; >+ >+extern "C" WK_EXPORT void PaymentServiceInitializer(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage); >+ >+void PaymentServiceInitializer(xpc_connection_t connection, xpc_object_t initializerMessage, xpc_object_t priorityBoostMessage) >+{ >+ // Remove the SecItemShim from the DYLD_INSERT_LIBRARIES environment variable so any processes spawned by >+ // the this process don't try to insert the shim and crash. >+ EnvironmentUtilities::stripValuesEndingWithString("DYLD_INSERT_LIBRARIES", "/SecItemShim.dylib"); >+ XPCServiceInitializer<PaymentProcess, PaymentServiceInitializerDelegate>(adoptOSObject(connection), initializerMessage, priorityBoostMessage); >+} >diff --git a/Source/WebKit/PaymentProcess/PaymentProcess.cpp b/Source/WebKit/PaymentProcess/PaymentProcess.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..5b8c6fbff4721df77be12a998e6ff86c7e28d36b >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/PaymentProcess.cpp >@@ -0,0 +1,113 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "PaymentProcess.h" >+ >+#if ENABLE(PAYMENT_PROCESS) >+ >+#include "ChildProcessMessages.h" >+#include "Logging.h" >+#include "PaymentProcessCoordinatorProxy.h" >+#include "PaymentProcessCoordinatorProxyMessages.h" >+#include "PaymentProcessMessages.h" >+#include "PaymentProcessProxyMessages.h" >+#include "PaymentToWebProcessConnection.h" >+#include <WebCore/NotImplemented.h> >+#include <wtf/Ref.h> >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+PaymentProcess& PaymentProcess::singleton() >+{ >+ static NeverDestroyed<PaymentProcess> process; >+ return process; >+} >+ >+PaymentProcess::PaymentProcess() >+ : m_paymentCoordinator(std::make_unique<PaymentProcessCoordinatorProxy>(*this)) >+ , m_connection(nullptr) >+{ >+} >+ >+PaymentProcess::~PaymentProcess() >+{ >+} >+ >+void PaymentProcess::initializeConnection(IPC::Connection* connection) >+{ >+ ChildProcess::initializeConnection(connection); >+} >+ >+bool PaymentProcess::shouldTerminate() >+{ >+ return true; >+} >+ >+void PaymentProcess::didReceiveSyncMessage(IPC::Connection& connection, IPC::Decoder& decoder, std::unique_ptr<IPC::Encoder>& replyEncoder) >+{ >+ if (decoder.messageReceiverName() == Messages::PaymentProcessCoordinatorProxy::messageReceiverName()) { >+ m_paymentCoordinator->didReceiveSyncMessage(connection, decoder, replyEncoder); >+ return; >+ } >+ >+ if (decoder.messageReceiverName() == Messages::ChildProcess::messageReceiverName()) { >+ ChildProcess::didReceiveMessage(connection, decoder); >+ return; >+ } >+ >+} >+ >+void PaymentProcess::createPaymentToWebProcessConnection() >+{ >+ // Create the listening port. >+ mach_port_t listeningPort = MACH_PORT_NULL; >+ auto kr = mach_port_allocate(mach_task_self(), MACH_PORT_RIGHT_RECEIVE, &listeningPort); >+ if (kr != KERN_SUCCESS) { >+ RELEASE_LOG_ERROR(Process, "PaymentProcess::createPaymentToWebProcessConnection: Could not allocate mach port, error %x", kr); >+ CRASH(); >+ } >+ if (!MACH_PORT_VALID(listeningPort)) { >+ RELEASE_LOG_ERROR(Process, "PaymentProcess::createPaymentToWebProcessConnection: Could not allocate mach port, returned port was invalid"); >+ CRASH(); >+ } >+ >+ // Create a listening connection. >+ m_connection = PaymentToWebProcessConnection::create(IPC::Connection::Identifier(listeningPort)); >+ >+ IPC::Attachment clientPort(listeningPort, MACH_MSG_TYPE_MAKE_SEND); >+ parentProcessConnection()->send(Messages::PaymentProcessProxy::DidCreatePaymentToWebProcessConnection(clientPort), 0); >+} >+ >+void PaymentProcess::destroySession() >+{ >+ // TODO: delete coordinator proxy >+} >+ >+} // namespace WebKit >+ >+#endif // PAYMENT(PAYMENT_PROCESS) >diff --git a/Source/WebKit/PaymentProcess/PaymentProcess.h b/Source/WebKit/PaymentProcess/PaymentProcess.h >new file mode 100644 >index 0000000000000000000000000000000000000000..42eeefa114ced0b5d66b021c4283abc9b9aaa824 >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/PaymentProcess.h >@@ -0,0 +1,76 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(PAYMENT_PROCESS) >+ >+#include "ChildProcess.h" >+#include <WebCore/SecurityOriginData.h> >+#include <pal/SessionID.h> >+#include <wtf/CrossThreadTask.h> >+#include <wtf/Function.h> >+ >+namespace WebKit { >+ >+class PaymentToWebProcessConnection; >+class PaymentProcessCoordinatorProxy; >+ >+class PaymentProcess : public ChildProcess { >+ WTF_MAKE_NONCOPYABLE(PaymentProcess); >+ friend NeverDestroyed<PaymentProcess>; >+public: >+ static PaymentProcess& singleton(); >+ static constexpr ProcessType processType = ProcessType::Payment; >+ >+ ~PaymentProcess(); >+ >+ void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; >+ void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override; >+ >+ void initializeProcess(const ChildProcessInitializationParameters&) override; >+ void initializeProcessName(const ChildProcessInitializationParameters&) override; >+ void initializeSandbox(const ChildProcessInitializationParameters&, SandboxInitializationParameters&) override; >+ >+ std::unique_ptr<PaymentProcessCoordinatorProxy> m_paymentCoordinator; >+ RefPtr<PaymentToWebProcessConnection> m_connection; >+ >+private: >+ PaymentProcess(); >+ >+ // ChildProcess >+ void initializeConnection(IPC::Connection*) override; >+ bool shouldTerminate() override; >+ >+ // Message Handlers >+ void createPaymentToWebProcessConnection(); >+ void destroySession(); >+ >+ >+}; >+ >+} // namespace WebKit >+ >+#endif // PAYMENT(PAYMENT_PROCESS) >diff --git a/Source/WebKit/PaymentProcess/PaymentProcess.messages.in b/Source/WebKit/PaymentProcess/PaymentProcess.messages.in >new file mode 100644 >index 0000000000000000000000000000000000000000..694e6e63d3c18f560d1c8b4b7eaccb8e9f8cba2d >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/PaymentProcess.messages.in >@@ -0,0 +1,30 @@ >+# Copyright (C) 2018 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR >+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ >+#if ENABLE(PAYMENT_PROCESS) >+ >+messages -> PaymentProcess { >+ >+ CreatePaymentToWebProcessConnection() >+ DestroySession() >+} >+#endif // ENABLE(PAYMENT_PROCESS) >diff --git a/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxy.cpp b/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxy.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..b93b30b7e0c5823291fc6f2c6232700c73b6096f >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxy.cpp >@@ -0,0 +1,343 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "PaymentProcessCoordinatorProxy.h" >+ >+#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_PROCESS) >+ >+#include "PaymentProcess.h" >+#include "PaymentProcessCoordinatorMessages.h" >+#include "PaymentProcessCoordinatorProxyMessages.h" >+#include "WebCoreArgumentCoders.h" >+#include "WebToPaymentProcessConnectionMessages.h" >+ >+#include <WebCore/PaymentAuthorizationStatus.h> >+ >+namespace WebKit { >+ >+static PaymentProcessCoordinatorProxy* activePaymentCoordinatorProxy; >+ >+PaymentProcessCoordinatorProxy::PaymentProcessCoordinatorProxy(PaymentProcess& paymentProcess) >+ : m_paymentProcess(paymentProcess) >+ , m_state(State::Idle) >+ , m_merchantValidationState(MerchantValidationState::Idle) >+{ >+ m_paymentProcess.addMessageReceiver(Messages::PaymentProcessCoordinatorProxy::messageReceiverName(), *this); >+} >+ >+PaymentProcessCoordinatorProxy::~PaymentProcessCoordinatorProxy() >+{ >+ if (activePaymentCoordinatorProxy == this) >+ activePaymentCoordinatorProxy = nullptr; >+ >+ if (m_state != State::Idle) >+ hidePaymentUI(); >+ >+ m_paymentProcess.removeMessageReceiver(Messages::PaymentProcessCoordinatorProxy::messageReceiverName()); >+} >+ >+void PaymentProcessCoordinatorProxy::availablePaymentNetworks(Vector<String>& networks) >+{ >+ networks = platformAvailablePaymentNetworks(); >+} >+ >+void PaymentProcessCoordinatorProxy::canMakePayments(bool& reply) >+{ >+ reply = platformCanMakePayments(); >+} >+ >+void PaymentProcessCoordinatorProxy::canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, uint64_t requestID) >+{ >+ auto weakThis = makeWeakPtr(*this); >+ platformCanMakePaymentsWithActiveCard(merchantIdentifier, domainName, [weakThis, requestID](bool canMakePayments) { >+ auto paymentCoordinatorProxy = weakThis.get(); >+ if (!paymentCoordinatorProxy) >+ return; >+ >+ paymentCoordinatorProxy->m_paymentProcess.m_connection->canMakePaymentsWithActiveCardReply(requestID, canMakePayments); >+ }); >+} >+ >+void PaymentProcessCoordinatorProxy::openPaymentSetup(const String& merchantIdentifier, const String& domainName, uint64_t requestID) >+{ >+ auto weakThis = makeWeakPtr(*this); >+ platformOpenPaymentSetup(merchantIdentifier, domainName, [weakThis, requestID](bool result) { >+ auto paymentCoordinatorProxy = weakThis.get(); >+ if (!paymentCoordinatorProxy) >+ return; >+ >+ paymentCoordinatorProxy->m_paymentProcess.m_connection->openPaymentSetupReply(requestID, result); >+ }); >+} >+ >+void PaymentProcessCoordinatorProxy::showPaymentUI(const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& paymentRequest, bool& result) >+{ >+ // FIXME: Make this a message check. >+ ASSERT(canBegin()); >+ >+ if (activePaymentCoordinatorProxy) { >+ activePaymentCoordinatorProxy->hidePaymentUI(); >+ activePaymentCoordinatorProxy->didCancelPaymentSession(); >+ } >+ >+ activePaymentCoordinatorProxy = this; >+ >+ m_state = State::Activating; >+ >+ WebCore::URL originatingURL(WebCore::URL(), originatingURLString); >+ >+ Vector<WebCore::URL> linkIconURLs; >+ for (const auto& linkIconURLString : linkIconURLStrings) >+ linkIconURLs.append(WebCore::URL(WebCore::URL(), linkIconURLString)); >+ >+ platformShowPaymentUI(originatingURL, linkIconURLs, paymentRequest, [this](bool result) { >+ ASSERT(m_state == State::Activating); >+ if (!result) { >+ didCancelPaymentSession(); >+ return; >+ } >+ >+ m_state = State::Active; >+ }); >+ >+ result = true; >+} >+ >+void PaymentProcessCoordinatorProxy::completeMerchantValidation(const WebCore::PaymentMerchantSession& paymentMerchantSession) >+{ >+ // It's possible that the payment has been canceled already. >+ if (m_state == State::Idle) >+ return; >+ >+ // FIXME: This should be a MESSAGE_CHECK. >+ ASSERT(m_merchantValidationState == MerchantValidationState::Validating); >+ >+ platformCompleteMerchantValidation(paymentMerchantSession); >+ m_merchantValidationState = MerchantValidationState::ValidationComplete; >+} >+ >+void PaymentProcessCoordinatorProxy::completeShippingMethodSelection(const std::optional<WebCore::ShippingMethodUpdate>& update) >+{ >+ // It's possible that the payment has been canceled already. >+ if (m_state == State::Idle) >+ return; >+ >+ // FIXME: This should be a MESSAGE_CHECK. >+ ASSERT(m_state == State::ShippingMethodSelected); >+ >+ platformCompleteShippingMethodSelection(update); >+ m_state = State::Active; >+} >+ >+void PaymentProcessCoordinatorProxy::completeShippingContactSelection(const std::optional<WebCore::ShippingContactUpdate>& update) >+{ >+ // It's possible that the payment has been canceled already. >+ if (m_state == State::Idle) >+ return; >+ >+ // FIXME: This should be a MESSAGE_CHECK. >+ ASSERT(m_state == State::ShippingContactSelected); >+ >+ platformCompleteShippingContactSelection(update); >+ m_state = State::Active; >+} >+ >+void PaymentProcessCoordinatorProxy::completePaymentMethodSelection(const std::optional<WebCore::PaymentMethodUpdate>& update) >+{ >+ // It's possible that the payment has been canceled already. >+ if (m_state == State::Idle) >+ return; >+ >+ // FIXME: This should be a MESSAGE_CHECK. >+ ASSERT(m_state == State::PaymentMethodSelected); >+ >+ platformCompletePaymentMethodSelection(update); >+ m_state = State::Active; >+} >+ >+void PaymentProcessCoordinatorProxy::completePaymentSession(const std::optional<WebCore::PaymentAuthorizationResult>& result) >+{ >+ // It's possible that the payment has been canceled already. >+ if (!canCompletePayment()) >+ return; >+ >+ bool isFinalStateResult = WebCore::isFinalStateResult(result); >+ >+ platformCompletePaymentSession(result); >+ >+ if (!isFinalStateResult) { >+ m_state = State::Active; >+ return; >+ } >+ >+ didReachFinalState(); >+} >+ >+void PaymentProcessCoordinatorProxy::abortPaymentSession() >+{ >+ // It's possible that the payment has been canceled already. >+ if (!canAbort()) >+ return; >+ >+ hidePaymentUI(); >+ >+ didReachFinalState(); >+} >+ >+void PaymentProcessCoordinatorProxy::cancelPaymentSession() >+{ >+ if (!canCancel()) >+ return; >+ >+ hidePaymentUI(); >+ didCancelPaymentSession(); >+} >+ >+void PaymentProcessCoordinatorProxy::didCancelPaymentSession() >+{ >+ ASSERT(canCancel()); >+ >+ m_paymentProcess.m_connection->didCancelPaymentSession(); >+ >+ didReachFinalState(); >+} >+ >+void PaymentProcessCoordinatorProxy::validateMerchant(const WebCore::URL& url) >+{ >+ ASSERT(m_merchantValidationState == MerchantValidationState::Idle); >+ >+ m_merchantValidationState = MerchantValidationState::Validating; >+ m_paymentProcess.m_connection->validateMerchant(url.string()); >+} >+ >+void PaymentProcessCoordinatorProxy::didAuthorizePayment(const WebCore::Payment& payment) >+{ >+ m_state = State::Authorized; >+ m_paymentProcess.m_connection->didAuthorizePayment(payment); >+ >+} >+ >+void PaymentProcessCoordinatorProxy::didSelectShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod& shippingMethod) >+{ >+ ASSERT(m_state == State::Active); >+ >+ m_state = State::ShippingMethodSelected; >+ m_paymentProcess.m_connection->didSelectShippingMethod(shippingMethod); >+} >+ >+void PaymentProcessCoordinatorProxy::didSelectShippingContact(const WebCore::PaymentContact& shippingContact) >+{ >+ ASSERT(m_state == State::Active); >+ >+ m_state = State::ShippingContactSelected; >+ m_paymentProcess.m_connection->didSelectShippingContact(shippingContact); >+} >+ >+void PaymentProcessCoordinatorProxy::didSelectPaymentMethod(const WebCore::PaymentMethod& paymentMethod) >+{ >+ ASSERT(m_state == State::Active); >+ >+ m_state = State::PaymentMethodSelected; >+ m_paymentProcess.m_connection->didSelectPaymentMethod(paymentMethod); >+ >+} >+ >+bool PaymentProcessCoordinatorProxy::canBegin() const >+{ >+ switch (m_state) { >+ case State::Idle: >+ return true; >+ >+ case State::Activating: >+ case State::Active: >+ case State::Authorized: >+ case State::ShippingMethodSelected: >+ case State::ShippingContactSelected: >+ case State::PaymentMethodSelected: >+ return false; >+ } >+} >+ >+bool PaymentProcessCoordinatorProxy::canCancel() const >+{ >+ switch (m_state) { >+ case State::Activating: >+ case State::Active: >+ case State::Authorized: >+ case State::ShippingMethodSelected: >+ case State::ShippingContactSelected: >+ case State::PaymentMethodSelected: >+ return true; >+ >+ case State::Idle: >+ return false; >+ } >+} >+ >+bool PaymentProcessCoordinatorProxy::canCompletePayment() const >+{ >+ switch (m_state) { >+ case State::Authorized: >+ return true; >+ >+ case State::Idle: >+ case State::Activating: >+ case State::Active: >+ case State::ShippingMethodSelected: >+ case State::ShippingContactSelected: >+ case State::PaymentMethodSelected: >+ return false; >+ } >+} >+ >+bool PaymentProcessCoordinatorProxy::canAbort() const >+{ >+ switch (m_state) { >+ case State::Activating: >+ case State::Active: >+ case State::Authorized: >+ case State::ShippingMethodSelected: >+ case State::ShippingContactSelected: >+ case State::PaymentMethodSelected: >+ return true; >+ >+ case State::Idle: >+ return false; >+ } >+} >+ >+void PaymentProcessCoordinatorProxy::didReachFinalState() >+{ >+ m_state = State::Idle; >+ m_merchantValidationState = MerchantValidationState::Idle; >+ >+ ASSERT(activePaymentCoordinatorProxy == this); >+ activePaymentCoordinatorProxy = nullptr; >+} >+ >+} >+ >+#endif >diff --git a/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxy.h b/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxy.h >new file mode 100644 >index 0000000000000000000000000000000000000000..0237f6483c992ce6d826635b0421dc11bd442860 >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxy.h >@@ -0,0 +1,159 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_PROCESS) >+ >+#include "MessageReceiver.h" >+#include <WebCore/PaymentHeaders.h> >+#include <wtf/Forward.h> >+#include <wtf/RetainPtr.h> >+#include <wtf/WeakPtr.h> >+ >+namespace IPC { >+class DataReference; >+} >+ >+namespace WebCore { >+enum class PaymentAuthorizationStatus; >+class Payment; >+class PaymentContact; >+class PaymentMerchantSession; >+class PaymentMethod; >+class URL; >+} >+ >+OBJC_CLASS NSObject; >+OBJC_CLASS NSWindow; >+OBJC_CLASS PKPaymentAuthorizationController; >+OBJC_CLASS WKPaymentAuthorizationControllerDelegate; >+ >+namespace WebKit { >+ >+class WebPageProxy; >+class PaymentProcess; >+ >+class PaymentProcessCoordinatorProxy : private IPC::MessageReceiver, public CanMakeWeakPtr<PaymentProcessCoordinatorProxy> { >+public: >+ explicit PaymentProcessCoordinatorProxy(PaymentProcess&); >+ ~PaymentProcessCoordinatorProxy(); >+ >+ void didCancelPaymentSession(); >+ void validateMerchant(const WebCore::URL&); >+ void didAuthorizePayment(const WebCore::Payment&); >+ void didSelectShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod&); >+ void didSelectShippingContact(const WebCore::PaymentContact&); >+ void didSelectPaymentMethod(const WebCore::PaymentMethod&); >+ >+ void hidePaymentUI(); >+ >+ void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override; >+ >+private: >+ // IPC::MessageReceiver. >+ void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; >+ >+ // Message handlers. >+ void availablePaymentNetworks(Vector<String>&); >+ void canMakePayments(bool& reply); >+ void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, uint64_t requestID); >+ void openPaymentSetup(const String& merchantIdentifier, const String& domainName, uint64_t requestID); >+ void showPaymentUI(const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest&, bool& result); >+ void completeMerchantValidation(const WebCore::PaymentMerchantSession&); >+ void completeShippingMethodSelection(const std::optional<WebCore::ShippingMethodUpdate>&); >+ void completeShippingContactSelection(const std::optional<WebCore::ShippingContactUpdate>&); >+ void completePaymentMethodSelection(const std::optional<WebCore::PaymentMethodUpdate>&); >+ void completePaymentSession(const std::optional<WebCore::PaymentAuthorizationResult>&); >+ void abortPaymentSession(); >+ void cancelPaymentSession(); >+ >+ bool canBegin() const; >+ bool canCancel() const; >+ bool canCompletePayment() const; >+ bool canAbort() const; >+ >+ void didReachFinalState(); >+ >+ Vector<String> platformAvailablePaymentNetworks(); >+ bool platformCanMakePayments(); >+ void platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler); >+ void platformOpenPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler); >+ void platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&, WTF::Function<void(bool)>&& completionHandler); >+ void platformCompleteMerchantValidation(const WebCore::PaymentMerchantSession&); >+ void platformCompleteShippingMethodSelection(const std::optional<WebCore::ShippingMethodUpdate>&); >+ void platformCompleteShippingContactSelection(const std::optional<WebCore::ShippingContactUpdate>&); >+ void platformCompletePaymentMethodSelection(const std::optional<WebCore::PaymentMethodUpdate>&); >+ void platformCompletePaymentSession(const std::optional<WebCore::PaymentAuthorizationResult>&); >+ >+ PaymentProcess& m_paymentProcess; >+ >+ enum class State { >+ // Idle - Nothing's happening. >+ Idle, >+ >+ // Activating - Waiting to show the payment UI. >+ Activating, >+ >+ // Active - Showing payment UI. >+ Active, >+ >+ // Authorized - Dispatching the authorized event and waiting for the paymentSessionCompleted message. >+ Authorized, >+ >+ // ShippingMethodSelected - Dispatching the shippingmethodselected event and waiting for a reply. >+ ShippingMethodSelected, >+ >+ // ShippingContactSelected - Dispatching the shippingcontactselected event and waiting for a reply. >+ ShippingContactSelected, >+ >+ // PaymentMethodSelected - Dispatching the paymentmethodselected event and waiting for a reply. >+ PaymentMethodSelected, >+ } m_state; >+ >+ enum class MerchantValidationState { >+ // Idle - Nothing's happening. >+ Idle, >+ >+ // Validating - Dispatching the validatemerchant event and waiting for a reply. >+ Validating, >+ >+ // ValidationComplete - A merchant session has been sent along to PassKit. >+ ValidationComplete >+ } m_merchantValidationState; >+ >+ RetainPtr<PKPaymentAuthorizationController> m_paymentAuthorizationController; >+ RetainPtr<WKPaymentAuthorizationControllerDelegate> m_paymentAuthorizationControllerDelegate; >+ >+#if PLATFORM(MAC) >+ uint64_t m_showPaymentUIRequestSeed { 0 }; >+ RetainPtr<NSWindow> m_sheetWindow; >+ RetainPtr<NSObject *> m_sheetWindowWillCloseObserver; >+#endif >+}; >+ >+} >+ >+#endif >diff --git a/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxy.messages.in b/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxy.messages.in >new file mode 100644 >index 0000000000000000000000000000000000000000..0a75acdd290759c0a4d45cdda773bde86b3faac2 >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxy.messages.in >@@ -0,0 +1,45 @@ >+/* >+* Copyright (C) 2018 Apple Inc. All rights reserved. >+* >+* Redistribution and use in source and binary forms, with or without >+* modification, are permitted provided that the following conditions >+* are met: >+* 1. Redistributions of source code must retain the above copyright >+* notice, this list of conditions and the following disclaimer. >+* 2. Redistributions in binary form must reproduce the above copyright >+* notice, this list of conditions and the following disclaimer in the >+* documentation and/or other materials provided with the distribution. >+* >+* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+* THE POSSIBILITY OF SUCH DAMAGE. >+*/ >+ >+#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_PROCESS) >+ >+messages -> PaymentProcessCoordinatorProxy { >+ >+ AvailablePaymentNetworks() -> (Vector<String> availablePaymentNetworks) LegacySync >+ CanMakePayments() -> (bool result) LegacySync >+ CanMakePaymentsWithActiveCard(String merchantIdentifier, String domainName, uint64_t requestID) >+ OpenPaymentSetup(String merchantIdentifier, String domainName, uint64_t requestID) >+ >+ ShowPaymentUI(String originatingURLString, Vector<String> linkIconURLStrings, WebCore::ApplePaySessionPaymentRequest paymentRequest) -> (bool result) LegacySync >+ CompleteMerchantValidation(WebCore::PaymentMerchantSession paymentMerchantSession) >+ CompleteShippingMethodSelection(std::optional<WebCore::ShippingMethodUpdate> update) >+ CompleteShippingContactSelection(std::optional<WebCore::ShippingContactUpdate> update) >+ CompletePaymentMethodSelection(std::optional<WebCore::PaymentMethodUpdate> update) >+ CompletePaymentSession(std::optional<WebCore::PaymentAuthorizationResult> result) >+ AbortPaymentSession() >+ CancelPaymentSession() >+} >+ >+#endif >diff --git a/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxyCocoa.h b/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxyCocoa.h >new file mode 100644 >index 0000000000000000000000000000000000000000..ed707cebfa21748f65429234744e9144bceee027 >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxyCocoa.h >@@ -0,0 +1,75 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_PROCESS) >+ >+#import <WebCore/PaymentHeaders.h> >+#import <pal/spi/cocoa/PassKitSPI.h> >+#import <wtf/BlockPtr.h> >+ >+namespace WebCore { >+class URL; >+} >+ >+namespace WebKit { >+class WebPageProxy; >+class PaymentProcessCoordinatorProxy; >+ >+RetainPtr<PKPaymentRequest> toPKPaymentRequest(const URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&); >+ >+} >+ >+@interface WKPaymentAuthorizationControllerDelegate : NSObject <PKPaymentAuthorizationControllerDelegate, >+ PKPaymentAuthorizationControllerPrivateDelegate> { >+@package >+ WebKit::PaymentProcessCoordinatorProxy* _paymentProessCoordinatorProxy; >+ RetainPtr<NSArray> _paymentSummaryItems; >+ RetainPtr<NSArray> _shippingMethods; >+ >+ BlockPtr<void(PKPaymentMerchantSession *, NSError *)> _sessionBlock; >+ >+ BOOL _didReachFinalState; >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ BlockPtr<void(PKPaymentAuthorizationResult *)> _paymentAuthorizedCompletion; >+ BlockPtr<void(PKPaymentRequestPaymentMethodUpdate *)> _didSelectPaymentMethodCompletion; >+ BlockPtr<void(PKPaymentRequestShippingMethodUpdate *)> _didSelectShippingMethodCompletion; >+ BlockPtr<void(PKPaymentRequestShippingContactUpdate *)> _didSelectShippingContactCompletion; >+#else >+ BlockPtr<void(PKPaymentAuthorizationStatus)> _paymentAuthorizedCompletion; >+ BlockPtr<void(NSArray *)> _didSelectPaymentMethodCompletion; >+ BlockPtr<void(PKPaymentAuthorizationStatus, NSArray *)> _didSelectShippingMethodCompletion; >+ BlockPtr<void(PKPaymentAuthorizationStatus, NSArray *, NSArray *)> _didSelectShippingContactCompletion; >+#endif >+} >+ >+- (instancetype)initWithPaymentCoordinatorProxy:(WebKit::PaymentProcessCoordinatorProxy&)webPaymentCoordinatorProxy; >+ >+- (void)invalidate; >+ >+@end >+ >+#endif >diff --git a/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxyCocoa.mm b/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxyCocoa.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..cad1bd7b2092a5211eda7165c6f4485bfffd0178 >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxyCocoa.mm >@@ -0,0 +1,698 @@ >+/* >+ * Copyright (C) 2016-2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "PaymentProcessCoordinatorProxyCocoa.h" >+ >+#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_PROCESS) >+ >+#import "PaymentProcessCoordinatorProxy.h" >+#import "WebProcessPool.h" >+#import <WebCore/PaymentAuthorizationStatus.h> >+#import <WebCore/PaymentHeaders.h> >+#import <WebCore/URL.h> >+#import <pal/cocoa/PassKitSoftLink.h> >+#import <wtf/BlockPtr.h> >+#import <wtf/RunLoop.h> >+ >+#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300) >+SOFT_LINK_FRAMEWORK(Contacts) >+SOFT_LINK_CONSTANT(Contacts, CNPostalAddressStreetKey, NSString *); >+SOFT_LINK_CONSTANT(Contacts, CNPostalAddressSubLocalityKey, NSString *); >+SOFT_LINK_CONSTANT(Contacts, CNPostalAddressCityKey, NSString *); >+SOFT_LINK_CONSTANT(Contacts, CNPostalAddressSubAdministrativeAreaKey, NSString *); >+SOFT_LINK_CONSTANT(Contacts, CNPostalAddressStateKey, NSString *); >+SOFT_LINK_CONSTANT(Contacts, CNPostalAddressPostalCodeKey, NSString *); >+SOFT_LINK_CONSTANT(Contacts, CNPostalAddressCountryKey, NSString *); >+SOFT_LINK_CONSTANT(Contacts, CNPostalAddressISOCountryCodeKey, NSString *); >+SOFT_LINK_CONSTANT(PAL::PassKit, PKPaymentErrorDomain, NSString *); >+#endif >+ >+@implementation WKPaymentAuthorizationControllerDelegate >+ >+- (instancetype)initWithPaymentCoordinatorProxy:(WebKit::PaymentProcessCoordinatorProxy&)webPaymentCoordinatorProxy >+{ >+ if (!(self = [super init])) >+ return nullptr; >+ >+ _paymentProessCoordinatorProxy = &webPaymentCoordinatorProxy; >+ >+ return self; >+} >+ >+- (void)invalidate >+{ >+ _paymentProessCoordinatorProxy = nullptr; >+ if (_paymentAuthorizedCompletion) { >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ _paymentAuthorizedCompletion(adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get()); >+#else >+ _paymentAuthorizedCompletion(PKPaymentAuthorizationStatusFailure); >+#endif >+ _paymentAuthorizedCompletion = nullptr; >+ } >+} >+ >+- (void)paymentAuthorizationController:(PKPaymentAuthorizationController *)controller willFinishWithError:(NSError *)error >+{ >+} >+ >+- (void)paymentAuthorizationController:(PKPaymentAuthorizationController *)controller didRequestMerchantSession:(void(^)(PKPaymentMerchantSession *, NSError *))sessionBlock >+{ >+ ASSERT(!_sessionBlock); >+ _sessionBlock = sessionBlock; >+ >+ [PAL::getPKPaymentAuthorizationViewControllerClass() paymentServicesMerchantURL:^(NSURL *merchantURL, NSError *error) { >+ if (error) >+ LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error); >+ >+ dispatch_async(dispatch_get_main_queue(), ^{ >+ ASSERT(_sessionBlock); >+ >+ if (!_paymentProessCoordinatorProxy) { >+ _sessionBlock(nullptr, nullptr); >+ return; >+ } >+ >+ _paymentProessCoordinatorProxy->validateMerchant(merchantURL); >+ }); >+ }]; >+} >+ >+static WebCore::ApplePaySessionPaymentRequest::ShippingMethod toShippingMethod(PKShippingMethod *shippingMethod) >+{ >+ ASSERT(shippingMethod); >+ >+ WebCore::ApplePaySessionPaymentRequest::ShippingMethod result; >+ result.label = shippingMethod.label; >+ result.detail = shippingMethod.detail; >+ result.amount = shippingMethod.amount.stringValue; >+ result.identifier = shippingMethod.identifier; >+ >+ return result; >+} >+ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300) || PLATFORM(IOS_FAMILY) >+ >+- (void)paymentAuthorizationController:(PKPaymentAuthorizationController *)controller didAuthorizePayment:(PKPayment *)payment handler:(void (^)(PKPaymentAuthorizationResult *result))completion >+{ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ if (!_paymentProessCoordinatorProxy) { >+ completion(adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get()); >+ return; >+ } >+ >+ ASSERT(!_paymentAuthorizedCompletion); >+ _paymentAuthorizedCompletion = completion; >+ >+ _paymentProessCoordinatorProxy->didAuthorizePayment(WebCore::Payment(payment)); >+#endif >+} >+ >+- (void)paymentAuthorizationController:(PKPaymentAuthorizationController *)controller didSelectPaymentMethod:(PKPaymentMethod *)paymentMethod handler:(void (^)(PKPaymentRequestPaymentMethodUpdate *update))completion >+{ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ if (!_paymentProessCoordinatorProxy) { >+ completion(adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get()); >+ return; >+ } >+ >+ ASSERT(!_didSelectPaymentMethodCompletion); >+ _didSelectPaymentMethodCompletion = completion; >+ _paymentProessCoordinatorProxy->didSelectPaymentMethod(WebCore::PaymentMethod(paymentMethod)); >+#endif >+} >+ >+- (void)paymentAuthorizationController:(PKPaymentAuthorizationController *)controller didSelectShippingMethod:(PKShippingMethod *)shippingMethod handler:(void (^)(PKPaymentRequestShippingMethodUpdate *update))completion { >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ if (!_paymentProessCoordinatorProxy) { >+ completion(adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get()); >+ return; >+ } >+ >+ ASSERT(!_didSelectShippingMethodCompletion); >+ _didSelectShippingMethodCompletion = completion; >+ _paymentProessCoordinatorProxy->didSelectShippingMethod(toShippingMethod(shippingMethod)); >+#endif >+} >+ >+- (void)paymentAuthorizationController:(PKPaymentAuthorizationController *)controller didSelectShippingContact:(PKContact *)contact handler:(void (^)(PKPaymentRequestShippingContactUpdate *update))completion >+{ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ if (!_paymentProessCoordinatorProxy) { >+ completion(adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[ ] paymentSummaryItems:@[ ] shippingMethods:@[ ]]).get()); >+ return; >+ } >+ >+ ASSERT(!_didSelectShippingContactCompletion); >+ _didSelectShippingContactCompletion = completion; >+ _paymentProessCoordinatorProxy->didSelectShippingContact(WebCore::PaymentContact(contact)); >+#endif >+} >+ >+#endif >+ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000) >+ >+- (void)paymentAuthorizationController:(PKPaymentAuthorizationController *)controller didAuthorizePayment:(PKPayment *)payment completion:(void (^)(PKPaymentAuthorizationStatus))completion >+{ >+ if (!_paymentProessCoordinatorProxy) { >+ completion(PKPaymentAuthorizationStatusFailure); >+ return; >+ } >+ >+ ASSERT(!_paymentAuthorizedCompletion); >+ _paymentAuthorizedCompletion = completion; >+ >+ _paymentProessCoordinatorProxy->didAuthorizePayment(WebCore::Payment(payment)); >+} >+ >+- (void)paymentAuthorizationController:(PKPaymentAuthorizationController *)controller didSelectShippingMethod:(PKShippingMethod *)shippingMethod completion:(void (^)(PKPaymentAuthorizationStatus status, NSArray<PKPaymentSummaryItem *> *summaryItems))completion >+{ >+ if (!_paymentProessCoordinatorProxy) { >+ completion(PKPaymentAuthorizationStatusFailure, @[ ]); >+ return; >+ } >+ >+ ASSERT(!_didSelectShippingMethodCompletion); >+ _didSelectShippingMethodCompletion = completion; >+ _paymentProessCoordinatorProxy->didSelectShippingMethod(toShippingMethod(shippingMethod)); >+} >+ >+- (void)paymentAuthorizationController:(PKPaymentAuthorizationController *)controller didSelectPaymentMethod:(PKPaymentMethod *)paymentMethod completion:(void (^)(NSArray<PKPaymentSummaryItem *> *summaryItems))completion >+{ >+ if (!_paymentProessCoordinatorProxy) { >+ completion(@[ ]); >+ return; >+ } >+ >+ ASSERT(!_didSelectPaymentMethodCompletion); >+ _didSelectPaymentMethodCompletion = completion; >+ >+ _paymentProessCoordinatorProxy->didSelectPaymentMethod(WebCore::PaymentMethod(paymentMethod)); >+} >+ >+- (void)paymentAuthorizationController:(PKPaymentAuthorizationController *)controller didSelectShippingContact:(PKContact *)contact completion:(void (^)(PKPaymentAuthorizationStatus status, NSArray<PKShippingMethod *> *shippingMethods, NSArray<PKPaymentSummaryItem *> *summaryItems))completion >+{ >+ if (!_paymentProessCoordinatorProxy) { >+ completion(PKPaymentAuthorizationStatusFailure, @[ ], @[ ]); >+ return; >+ } >+ >+ ASSERT(!_didSelectShippingContactCompletion); >+ _didSelectShippingContactCompletion = completion; >+ _paymentProessCoordinatorProxy->didSelectShippingContact(WebCore::PaymentContact(contact)); >+} >+ >+#endif >+ >+- (void)paymentAuthorizationControllerDidFinish:(PKPaymentAuthorizationController *)controller >+{ >+ if (!_paymentProessCoordinatorProxy) >+ return; >+ >+ if (!_didReachFinalState) >+ _paymentProessCoordinatorProxy->didCancelPaymentSession(); >+ >+ _paymentProessCoordinatorProxy->hidePaymentUI(); >+} >+ >+@end >+ >+// FIXME: Once rdar://problem/24420024 has been fixed, import PKPaymentRequest_Private.h instead. >+@interface PKPaymentRequest () >+@property (nonatomic, retain) NSURL *originatingURL; >+@end >+ >+@interface PKPaymentRequest () >+// FIXME: Remove this once it's in an SDK. >+@property (nonatomic, strong) NSArray *thumbnailURLs; >+@property (nonatomic, strong) NSURL *thumbnailURL; >+ >+@property (nonatomic, assign) BOOL expectsMerchantSession; >+@end >+ >+namespace WebKit { >+ >+bool PaymentProcessCoordinatorProxy::platformCanMakePayments() >+{ >+ return [PAL::getPKPaymentAuthorizationViewControllerClass() canMakePayments]; >+} >+ >+void PaymentProcessCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler) >+{ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(merchantIdentifier, domainName, @"", BlockPtr<void(BOOL, NSError *)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable { >+ if (error) >+ LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error); >+ >+ RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler), canMakePayments] { >+ completionHandler(canMakePayments); >+ }); >+ }).get()); >+#else >+ PKCanMakePaymentsWithMerchantIdentifierAndDomain(merchantIdentifier, domainName, BlockPtr<void(BOOL, NSError *)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL canMakePayments, NSError *error) mutable { >+ if (error) >+ LOG_ERROR("PKCanMakePaymentsWithMerchantIdentifierAndDomain error %@", error); >+ >+ RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler), canMakePayments] { >+ completionHandler(canMakePayments); >+ }); >+ }).get()); >+#endif >+} >+ >+void PaymentProcessCoordinatorProxy::platformOpenPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler) >+{ >+ auto passLibrary = adoptNS([PAL::allocPKPassLibraryInstance() init]); >+ [passLibrary openPaymentSetupForMerchantIdentifier:merchantIdentifier domain:domainName completion:BlockPtr<void(BOOL)>::fromCallable([completionHandler = WTFMove(completionHandler)](BOOL result) mutable { >+ RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler), result] { >+ completionHandler(result); >+ }); >+ }).get()]; >+} >+ >+static PKPaymentSummaryItemType toPKPaymentSummaryItemType(WebCore::ApplePaySessionPaymentRequest::LineItem::Type type) >+{ >+ switch (type) { >+ case WebCore::ApplePaySessionPaymentRequest::LineItem::Type::Final: >+ return PKPaymentSummaryItemTypeFinal; >+ >+ case WebCore::ApplePaySessionPaymentRequest::LineItem::Type::Pending: >+ return PKPaymentSummaryItemTypePending; >+ } >+} >+ >+static NSDecimalNumber *toDecimalNumber(const String& amount) >+{ >+ if (!amount) >+ return [NSDecimalNumber zero]; >+ return [NSDecimalNumber decimalNumberWithString:amount locale:@{ NSLocaleDecimalSeparator : @"." }]; >+} >+ >+static RetainPtr<PKPaymentSummaryItem> toPKPaymentSummaryItem(const WebCore::ApplePaySessionPaymentRequest::LineItem& lineItem) >+{ >+ return [PAL::getPKPaymentSummaryItemClass() summaryItemWithLabel:lineItem.label amount:toDecimalNumber(lineItem.amount) type:toPKPaymentSummaryItemType(lineItem.type)]; >+} >+ >+static RetainPtr<NSArray> toPKPaymentSummaryItems(const WebCore::ApplePaySessionPaymentRequest::TotalAndLineItems& totalAndLineItems) >+{ >+ auto paymentSummaryItems = adoptNS([[NSMutableArray alloc] init]); >+ for (auto& lineItem : totalAndLineItems.lineItems) { >+ if (auto summaryItem = toPKPaymentSummaryItem(lineItem)) >+ [paymentSummaryItems addObject:summaryItem.get()]; >+ } >+ >+ if (auto totalItem = toPKPaymentSummaryItem(totalAndLineItems.total)) >+ [paymentSummaryItems addObject:totalItem.get()]; >+ >+ return paymentSummaryItems; >+} >+ >+static RetainPtr<PKShippingMethod> toPKShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod& shippingMethod) >+{ >+ RetainPtr<PKShippingMethod> result = [PAL::getPKShippingMethodClass() summaryItemWithLabel:shippingMethod.label amount:toDecimalNumber(shippingMethod.amount)]; >+ [result setIdentifier:shippingMethod.identifier]; >+ [result setDetail:shippingMethod.detail]; >+ >+ return result; >+} >+ >+RetainPtr<PKPaymentRequest> toPKPaymentRequest(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest& paymentRequest) >+{ >+ auto result = adoptNS([PAL::allocPKPaymentRequestInstance() init]); >+ >+ [result setOriginatingURL:originatingURL]; >+ >+ if ([result respondsToSelector:@selector(setThumbnailURLs:)]) { >+ auto thumbnailURLs = adoptNS([[NSMutableArray alloc] init]); >+ for (auto& linkIconURL : linkIconURLs) >+ [thumbnailURLs addObject:static_cast<NSURL *>(linkIconURL)]; >+ >+ [result setThumbnailURLs:thumbnailURLs.get()]; >+ } else if (!linkIconURLs.isEmpty()) >+ [result setThumbnailURL:linkIconURLs[0]]; >+ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101304) || PLATFORM(IOS_FAMILY) >+ [result setAPIType:toAPIType(paymentRequest.requester())]; >+#endif >+ >+ [result setCountryCode:paymentRequest.countryCode()]; >+ [result setCurrencyCode:paymentRequest.currencyCode()]; >+ [result setBillingContact:paymentRequest.billingContact().pkContact()]; >+ [result setShippingContact:paymentRequest.shippingContact().pkContact()]; >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ [result setRequiredBillingContactFields:toPKContactFields(paymentRequest.requiredBillingContactFields()).get()]; >+ [result setRequiredShippingContactFields:toPKContactFields(paymentRequest.requiredShippingContactFields()).get()]; >+#else >+ [result setRequiredBillingAddressFields:toPKAddressField(paymentRequest.requiredBillingContactFields())]; >+ [result setRequiredShippingAddressFields:toPKAddressField(paymentRequest.requiredShippingContactFields())]; >+#endif >+ >+ [result setSupportedNetworks:toSupportedNetworks(paymentRequest.supportedNetworks()).get()]; >+ [result setMerchantCapabilities:toPKMerchantCapabilities(paymentRequest.merchantCapabilities())]; >+ >+ [result setShippingType:toPKShippingType(paymentRequest.shippingType())]; >+ >+ auto shippingMethods = adoptNS([[NSMutableArray alloc] init]); >+ for (auto& shippingMethod : paymentRequest.shippingMethods()) >+ [shippingMethods addObject:toPKShippingMethod(shippingMethod).get()]; >+ [result setShippingMethods:shippingMethods.get()]; >+ >+ auto paymentSummaryItems = adoptNS([[NSMutableArray alloc] init]); >+ for (auto& lineItem : paymentRequest.lineItems()) { >+ if (auto summaryItem = toPKPaymentSummaryItem(lineItem)) >+ [paymentSummaryItems addObject:summaryItem.get()]; >+ } >+ >+ if (auto totalItem = toPKPaymentSummaryItem(paymentRequest.total())) >+ [paymentSummaryItems addObject:totalItem.get()]; >+ >+ [result setPaymentSummaryItems:paymentSummaryItems.get()]; >+ >+ [result setExpectsMerchantSession:YES]; >+ >+ if (!paymentRequest.applicationData().isNull()) { >+ auto applicationData = adoptNS([[NSData alloc] initWithBase64EncodedString:paymentRequest.applicationData() options:0]); >+ [result setApplicationData:applicationData.get()]; >+ } >+ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ [result setSupportedCountries:toNSSet(paymentRequest.supportedCountries()).get()]; >+#endif >+ >+ // TODO: set primary and secondary application bundle identifier here >+ // like analogous function in WebPaymentCoordinatorProxyCocoa.mm >+ >+ return result; >+} >+ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+static PKPaymentAuthorizationStatus toPKPaymentAuthorizationStatus(WebCore::PaymentAuthorizationStatus status) >+{ >+ switch (status) { >+ case WebCore::PaymentAuthorizationStatus::Success: >+ return PKPaymentAuthorizationStatusSuccess; >+ case WebCore::PaymentAuthorizationStatus::Failure: >+ return PKPaymentAuthorizationStatusFailure; >+ case WebCore::PaymentAuthorizationStatus::PINRequired: >+ return PKPaymentAuthorizationStatusPINRequired; >+ case WebCore::PaymentAuthorizationStatus::PINIncorrect: >+ return PKPaymentAuthorizationStatusPINIncorrect; >+ case WebCore::PaymentAuthorizationStatus::PINLockout: >+ return PKPaymentAuthorizationStatusPINLockout; >+ } >+} >+ >+static PKPaymentErrorCode toPKPaymentErrorCode(WebCore::PaymentError::Code code) >+{ >+ switch (code) { >+ case WebCore::PaymentError::Code::Unknown: >+ return PKPaymentUnknownError; >+ case WebCore::PaymentError::Code::ShippingContactInvalid: >+ return PKPaymentShippingContactInvalidError; >+ case WebCore::PaymentError::Code::BillingContactInvalid: >+ return PKPaymentBillingContactInvalidError; >+ case WebCore::PaymentError::Code::AddressUnserviceable: >+ return PKPaymentShippingAddressUnserviceableError; >+ } >+} >+ >+static RetainPtr<NSError> toNSError(const WebCore::PaymentError& error) >+{ >+ auto userInfo = adoptNS([[NSMutableDictionary alloc] init]); >+ [userInfo setObject:error.message forKey:NSLocalizedDescriptionKey]; >+ >+ if (error.contactField) { >+ NSString *pkContactField = nil; >+ NSString *postalAddressKey = nil; >+ >+ switch (*error.contactField) { >+ case WebCore::PaymentError::ContactField::PhoneNumber: >+ pkContactField = PAL::get_PassKit_PKContactFieldPhoneNumber(); >+ break; >+ >+ case WebCore::PaymentError::ContactField::EmailAddress: >+ pkContactField = PAL::get_PassKit_PKContactFieldEmailAddress(); >+ break; >+ >+ case WebCore::PaymentError::ContactField::Name: >+ pkContactField = PAL::get_PassKit_PKContactFieldName(); >+ break; >+ >+ case WebCore::PaymentError::ContactField::PhoneticName: >+ pkContactField = PAL::get_PassKit_PKContactFieldPhoneticName(); >+ break; >+ >+ case WebCore::PaymentError::ContactField::PostalAddress: >+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); >+ break; >+ >+ case WebCore::PaymentError::ContactField::AddressLines: >+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); >+ postalAddressKey = getCNPostalAddressStreetKey(); >+ break; >+ >+ case WebCore::PaymentError::ContactField::SubLocality: >+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); >+ postalAddressKey = getCNPostalAddressSubLocalityKey(); >+ break; >+ >+ case WebCore::PaymentError::ContactField::Locality: >+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); >+ postalAddressKey = getCNPostalAddressCityKey(); >+ break; >+ >+ case WebCore::PaymentError::ContactField::PostalCode: >+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); >+ postalAddressKey = getCNPostalAddressPostalCodeKey(); >+ break; >+ >+ case WebCore::PaymentError::ContactField::SubAdministrativeArea: >+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); >+ postalAddressKey = getCNPostalAddressSubAdministrativeAreaKey(); >+ break; >+ >+ case WebCore::PaymentError::ContactField::AdministrativeArea: >+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); >+ postalAddressKey = getCNPostalAddressStateKey(); >+ break; >+ >+ case WebCore::PaymentError::ContactField::Country: >+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); >+ postalAddressKey = getCNPostalAddressCountryKey(); >+ break; >+ >+ case WebCore::PaymentError::ContactField::CountryCode: >+ pkContactField = PAL::get_PassKit_PKContactFieldPostalAddress(); >+ postalAddressKey = getCNPostalAddressISOCountryCodeKey(); >+ break; >+ } >+ >+ [userInfo setObject:pkContactField forKey:PAL::get_PassKit_PKPaymentErrorContactFieldUserInfoKey()]; >+ if (postalAddressKey) >+ [userInfo setObject:postalAddressKey forKey:PAL::get_PassKit_PKPaymentErrorPostalAddressUserInfoKey()]; >+ } >+ >+ return adoptNS([[NSError alloc] initWithDomain:getPKPaymentErrorDomain() code:toPKPaymentErrorCode(error.code) userInfo:userInfo.get()]); >+} >+ >+static RetainPtr<NSArray> toNSErrors(const Vector<WebCore::PaymentError>& errors) >+{ >+ auto result = adoptNS([[NSMutableArray alloc] init]); >+ >+ for (auto error : errors) { >+ if (auto nsError = toNSError(error)) >+ [result addObject:nsError.get()]; >+ } >+ >+ return result; >+} >+#else >+static PKPaymentAuthorizationStatus toPKPaymentAuthorizationStatus(const std::optional<WebCore::PaymentAuthorizationResult>& result) >+{ >+ if (!result) >+ return PKPaymentAuthorizationStatusSuccess; >+ >+ if (result->errors.size() == 1) { >+ auto& error = result->errors[0]; >+ switch (error.code) { >+ case WebCore::PaymentError::Code::Unknown: >+ case WebCore::PaymentError::Code::AddressUnserviceable: >+ return PKPaymentAuthorizationStatusFailure; >+ >+ case WebCore::PaymentError::Code::BillingContactInvalid: >+ return PKPaymentAuthorizationStatusInvalidBillingPostalAddress; >+ >+ case WebCore::PaymentError::Code::ShippingContactInvalid: >+ if (error.contactField && error.contactField == WebCore::PaymentError::ContactField::PostalAddress) >+ return PKPaymentAuthorizationStatusInvalidShippingPostalAddress; >+ >+ return PKPaymentAuthorizationStatusInvalidShippingContact; >+ } >+ } >+ >+ switch (result->status) { >+ case WebCore::PaymentAuthorizationStatus::Success: >+ return PKPaymentAuthorizationStatusSuccess; >+ case WebCore::PaymentAuthorizationStatus::Failure: >+ return PKPaymentAuthorizationStatusFailure; >+ case WebCore::PaymentAuthorizationStatus::PINRequired: >+ return PKPaymentAuthorizationStatusPINRequired; >+ case WebCore::PaymentAuthorizationStatus::PINIncorrect: >+ return PKPaymentAuthorizationStatusPINIncorrect; >+ case WebCore::PaymentAuthorizationStatus::PINLockout: >+ return PKPaymentAuthorizationStatusPINLockout; >+ } >+ >+ return PKPaymentAuthorizationStatusFailure; >+} >+#endif >+ >+void PaymentProcessCoordinatorProxy::platformCompletePaymentSession(const std::optional<WebCore::PaymentAuthorizationResult>& result) >+{ >+ ASSERT(m_paymentAuthorizationController); >+ ASSERT(m_paymentAuthorizationControllerDelegate); >+ >+ m_paymentAuthorizationControllerDelegate->_didReachFinalState = WebCore::isFinalStateResult(result); >+ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ auto status = result ? result->status : WebCore::PaymentAuthorizationStatus::Success; >+ auto pkPaymentAuthorizationResult = adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:toPKPaymentAuthorizationStatus(status) errors:result ? toNSErrors(result->errors).get() : @[ ]]); >+ m_paymentAuthorizationControllerDelegate->_paymentAuthorizedCompletion(pkPaymentAuthorizationResult.get()); >+#else >+ m_paymentAuthorizationControllerDelegate->_paymentAuthorizedCompletion(toPKPaymentAuthorizationStatus(result)); >+#endif >+ m_paymentAuthorizationControllerDelegate->_paymentAuthorizedCompletion = nullptr; >+} >+ >+void PaymentProcessCoordinatorProxy::platformCompleteMerchantValidation(const WebCore::PaymentMerchantSession& paymentMerchantSession) >+{ >+ ASSERT(m_paymentAuthorizationController); >+ ASSERT(m_paymentAuthorizationControllerDelegate); >+ >+ m_paymentAuthorizationControllerDelegate->_sessionBlock(paymentMerchantSession.pkPaymentMerchantSession(), nullptr); >+ m_paymentAuthorizationControllerDelegate->_sessionBlock = nullptr; >+} >+ >+void PaymentProcessCoordinatorProxy::platformCompleteShippingMethodSelection(const std::optional<WebCore::ShippingMethodUpdate>& update) >+{ >+ ASSERT(m_paymentAuthorizationController); >+ ASSERT(m_paymentAuthorizationControllerDelegate); >+ >+ if (update) >+ m_paymentAuthorizationControllerDelegate->_paymentSummaryItems = toPKPaymentSummaryItems(update->newTotalAndLineItems); >+ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ auto pkShippingMethodUpdate = adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:m_paymentAuthorizationControllerDelegate->_paymentSummaryItems.get()]); >+ m_paymentAuthorizationControllerDelegate->_didSelectShippingMethodCompletion(pkShippingMethodUpdate.get()); >+#else >+ m_paymentAuthorizationControllerDelegate->_didSelectShippingMethodCompletion(PKPaymentAuthorizationStatusSuccess, m_paymentAuthorizationControllerDelegate->_paymentSummaryItems.get()); >+#endif >+ m_paymentAuthorizationControllerDelegate->_didSelectShippingMethodCompletion = nullptr; >+} >+ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED < 110000) >+static PKPaymentAuthorizationStatus toPKPaymentAuthorizationStatus(const std::optional<WebCore::ShippingContactUpdate>& update) >+{ >+ if (!update || update->errors.isEmpty()) >+ return PKPaymentAuthorizationStatusSuccess; >+ >+ if (update->errors.size() == 1) { >+ auto& error = update->errors[0]; >+ switch (error.code) { >+ case WebCore::PaymentError::Code::Unknown: >+ case WebCore::PaymentError::Code::AddressUnserviceable: >+ return PKPaymentAuthorizationStatusFailure; >+ >+ case WebCore::PaymentError::Code::BillingContactInvalid: >+ return PKPaymentAuthorizationStatusInvalidBillingPostalAddress; >+ >+ case WebCore::PaymentError::Code::ShippingContactInvalid: >+ if (error.contactField && error.contactField == WebCore::PaymentError::ContactField::PostalAddress) >+ return PKPaymentAuthorizationStatusInvalidShippingPostalAddress; >+ >+ return PKPaymentAuthorizationStatusInvalidShippingContact; >+ } >+ } >+ >+ return PKPaymentAuthorizationStatusFailure; >+} >+#endif >+ >+void PaymentProcessCoordinatorProxy::platformCompleteShippingContactSelection(const std::optional<WebCore::ShippingContactUpdate>& update) >+{ >+ ASSERT(m_paymentAuthorizationController); >+ ASSERT(m_paymentAuthorizationControllerDelegate); >+ >+ if (update) { >+ m_paymentAuthorizationControllerDelegate->_paymentSummaryItems = toPKPaymentSummaryItems(update->newTotalAndLineItems); >+ >+ auto shippingMethods = adoptNS([[NSMutableArray alloc] init]); >+ for (auto& shippingMethod : update->newShippingMethods) >+ [shippingMethods addObject:toPKShippingMethod(shippingMethod).get()]; >+ >+ m_paymentAuthorizationControllerDelegate->_shippingMethods = WTFMove(shippingMethods); >+ } >+ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ auto pkShippingContactUpdate = adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:update ? toNSErrors(update->errors).get() : @[ ] paymentSummaryItems:m_paymentAuthorizationControllerDelegate->_paymentSummaryItems.get() shippingMethods:m_paymentAuthorizationControllerDelegate->_shippingMethods.get()]); >+ m_paymentAuthorizationControllerDelegate->_didSelectShippingContactCompletion(pkShippingContactUpdate.get()); >+#else >+ m_paymentAuthorizationControllerDelegate->_didSelectShippingContactCompletion(toPKPaymentAuthorizationStatus(update), m_paymentAuthorizationControllerDelegate->_shippingMethods.get(), m_paymentAuthorizationControllerDelegate->_paymentSummaryItems.get()); >+#endif >+ m_paymentAuthorizationControllerDelegate->_didSelectShippingContactCompletion = nullptr; >+} >+ >+void PaymentProcessCoordinatorProxy::platformCompletePaymentMethodSelection(const std::optional<WebCore::PaymentMethodUpdate>& update) >+{ >+ ASSERT(m_paymentAuthorizationController); >+ ASSERT(m_paymentAuthorizationControllerDelegate); >+ >+ if (update) >+ m_paymentAuthorizationControllerDelegate->_paymentSummaryItems = toPKPaymentSummaryItems(update->newTotalAndLineItems); >+ >+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 110000) >+ auto pkPaymentMethodUpdate = adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:m_paymentAuthorizationControllerDelegate->_paymentSummaryItems.get()]); >+ m_paymentAuthorizationControllerDelegate->_didSelectPaymentMethodCompletion(pkPaymentMethodUpdate.get()); >+#else >+ m_paymentAuthorizationControllerDelegate->_didSelectPaymentMethodCompletion(m_paymentAuthorizationControllerDelegate->_paymentSummaryItems.get()); >+#endif >+ m_paymentAuthorizationControllerDelegate->_didSelectPaymentMethodCompletion = nullptr; >+} >+ >+Vector<String> PaymentProcessCoordinatorProxy::platformAvailablePaymentNetworks() >+{ >+ NSArray<PKPaymentNetwork> *availableNetworks = [PAL::getPKPaymentRequestClass() availableNetworks]; >+ Vector<String> result; >+ result.reserveInitialCapacity(availableNetworks.count); >+ for (PKPaymentNetwork network in availableNetworks) >+ result.uncheckedAppend(network); >+ return result; >+} >+ >+} // namespace WebKit >+ >+#endif // ENABLE(APPLE_PAY) >diff --git a/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxyIOS.mm b/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxyIOS.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..8c0869f6ca6ad369e6b13c7bf0c126b952582fe5 >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/PaymentProcessCoordinatorProxyIOS.mm >@@ -0,0 +1,79 @@ >+/* >+ * Copyright (C) 2016 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "PaymentProcessCoordinatorProxy.h" >+ >+#if PLATFORM(IOS_FAMILY) && ENABLE(APPLE_PAY) && ENABLE(PAYMENT_PROCESS) >+ >+#import "APIUIClient.h" >+#import "PaymentProcessCoordinatorProxyCocoa.h" >+#import <PassKit/PassKit.h> >+#import <UIKit/UIViewController.h> >+#import <WebCore/PaymentAuthorizationStatus.h> >+#import <pal/cocoa/PassKitSoftLink.h> >+ >+namespace WebKit { >+ >+void PaymentProcessCoordinatorProxy::platformShowPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, WTF::Function<void(bool)>&& completionHandler) >+{ >+ ASSERT(!m_paymentAuthorizationController); >+ >+ auto paymentRequest = toPKPaymentRequest(originatingURL, linkIconURLStrings, request); >+ >+ m_paymentAuthorizationController = adoptNS([PAL::allocPKPaymentAuthorizationControllerInstance() initWithPaymentRequest:paymentRequest.get()]); >+ if (!m_paymentAuthorizationController) { >+ completionHandler(false); >+ return; >+ } >+ >+ m_paymentAuthorizationControllerDelegate = adoptNS([[WKPaymentAuthorizationControllerDelegate alloc] initWithPaymentCoordinatorProxy:*this]); >+ m_paymentAuthorizationControllerDelegate->_paymentSummaryItems = [paymentRequest paymentSummaryItems]; >+ m_paymentAuthorizationControllerDelegate->_shippingMethods = [paymentRequest shippingMethods]; >+ >+ [m_paymentAuthorizationController setDelegate:m_paymentAuthorizationControllerDelegate.get()]; >+ [m_paymentAuthorizationController setPrivateDelegate:m_paymentAuthorizationControllerDelegate.get()]; >+ [m_paymentAuthorizationController presentWithCompletion: nullptr]; >+ >+ completionHandler(true); >+} >+ >+void PaymentProcessCoordinatorProxy::hidePaymentUI() >+{ >+ ASSERT(m_paymentAuthorizationController); >+ ASSERT(m_paymentAuthorizationControllerDelegate); >+ >+ [m_paymentAuthorizationController dismissWithCompletion:nullptr]; >+ [m_paymentAuthorizationController setDelegate:nil]; >+ [m_paymentAuthorizationController setPrivateDelegate:nil]; >+ m_paymentAuthorizationController = nullptr; >+ >+ [m_paymentAuthorizationControllerDelegate invalidate]; >+ m_paymentAuthorizationControllerDelegate = nullptr; >+} >+ >+} >+ >+#endif >diff --git a/Source/WebKit/PaymentProcess/PaymentToWebProcessConnection.cpp b/Source/WebKit/PaymentProcess/PaymentToWebProcessConnection.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..c1610a535f3245a548ae14a4baf37445f5fd526b >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/PaymentToWebProcessConnection.cpp >@@ -0,0 +1,148 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "PaymentToWebProcessConnection.h" >+ >+#if ENABLE(PAYMENT_PROCESS) >+ >+#include "Logging.h" >+#include "PaymentProcess.h" >+#include "PaymentProcessCoordinatorProxyMessages.h" >+#include "PaymentProcessMessages.h" >+#include "PaymentToWebProcessConnectionMessages.h" >+#include <wtf/RunLoop.h> >+ >+using namespace PAL; >+using namespace WebCore; >+ >+namespace WebKit { >+ >+Ref<PaymentToWebProcessConnection> PaymentToWebProcessConnection::create(IPC::Connection::Identifier connectionIdentifier) >+{ >+ return adoptRef(*new PaymentToWebProcessConnection(connectionIdentifier)); >+} >+ >+PaymentToWebProcessConnection::PaymentToWebProcessConnection(IPC::Connection::Identifier connectionIdentifier) >+ : m_connection(IPC::Connection::createServerConnection(connectionIdentifier, *this)) >+{ >+ // NOTE: we must set this to true because the WebContent process may re-enter when sending >+ // a sync IPC and this is a huge source of security bugs >+ m_connection->setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(true); >+ m_connection->open(); >+} >+ >+PaymentToWebProcessConnection::~PaymentToWebProcessConnection() >+{ >+ m_connection->invalidate(); >+} >+ >+void PaymentToWebProcessConnection::didReceiveMessage(IPC::Connection& connection, IPC::Decoder& decoder) >+{ >+ if (decoder.messageReceiverName() == Messages::PaymentProcess::messageReceiverName()) { >+ PaymentProcess::singleton().didReceiveMessage(connection, decoder); >+ return; >+ } >+ >+ if (decoder.messageReceiverName() == Messages::PaymentProcessCoordinatorProxy::messageReceiverName()) { >+ PaymentProcess::singleton().didReceiveMessage(connection, decoder); >+ return; >+ } >+ >+ ASSERT_NOT_REACHED(); >+} >+ >+void PaymentToWebProcessConnection::didReceiveSyncMessage(IPC::Connection& connection, IPC::Decoder& decoder, std::unique_ptr<IPC::Encoder>& replyEncoder) >+{ >+ if (decoder.messageReceiverName() == Messages::PaymentProcess::messageReceiverName()) { >+ PaymentProcess::singleton().didReceiveSyncMessage(connection, decoder, replyEncoder); >+ return; >+ >+ } >+ >+ if (decoder.messageReceiverName() == Messages::PaymentProcessCoordinatorProxy::messageReceiverName()) { >+ PaymentProcess::singleton().didReceiveSyncMessage(connection, decoder, replyEncoder); >+ return; >+ >+ } >+ >+ ASSERT_NOT_REACHED(); >+} >+ >+void PaymentToWebProcessConnection::validateMerchant(const String& validationURLString) >+{ >+ m_connection->send(Messages::WebToPaymentProcessConnection::ValidateMerchant(validationURLString), 0); >+} >+ >+void PaymentToWebProcessConnection::didAuthorizePayment(const WebCore::Payment& payment) >+{ >+ m_connection->send(Messages::WebToPaymentProcessConnection::DidAuthorizePayment(payment), 0); >+} >+ >+void PaymentToWebProcessConnection::didSelectShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod& shippingMethod) >+{ >+ m_connection->send(Messages::WebToPaymentProcessConnection::DidSelectShippingMethod(shippingMethod), 0); >+} >+ >+void PaymentToWebProcessConnection::didSelectShippingContact(const WebCore::PaymentContact& shippingContact) >+{ >+ m_connection->send(Messages::WebToPaymentProcessConnection::DidSelectShippingContact(shippingContact), 0); >+} >+ >+void PaymentToWebProcessConnection::didSelectPaymentMethod(const WebCore::PaymentMethod& paymentMethod) >+{ >+ m_connection->send(Messages::WebToPaymentProcessConnection::DidSelectPaymentMethod(paymentMethod), 0); >+} >+ >+void PaymentToWebProcessConnection::didCancelPaymentSession() >+{ >+ m_connection->send(Messages::WebToPaymentProcessConnection::DidCancelPaymentSession(), 0); >+} >+ >+void PaymentToWebProcessConnection::canMakePaymentsWithActiveCardReply(uint64_t requestID, bool canMakePayments) >+{ >+ m_connection->send(Messages::WebToPaymentProcessConnection::CanMakePaymentsWithActiveCardReply(requestID, canMakePayments), 0); >+} >+ >+void PaymentToWebProcessConnection::openPaymentSetupReply(uint64_t requestID, bool result) >+{ >+ m_connection->send(Messages::WebToPaymentProcessConnection::OpenPaymentSetupReply(requestID, result), 0); >+} >+ >+void PaymentToWebProcessConnection::didClose(IPC::Connection& connection) >+{ >+ UNUSED_PARAM(connection); >+} >+ >+void PaymentToWebProcessConnection::didReceiveInvalidMessage(IPC::Connection& connection, IPC::StringReference messageReceiverName, IPC::StringReference messageName) >+{ >+ UNUSED_PARAM(connection); >+ UNUSED_PARAM(messageReceiverName); >+ UNUSED_PARAM(messageName); >+} >+ >+} // namespace WebKit >+ >+#endif // PAYMENT(PAYMENT_PROCESS) >diff --git a/Source/WebKit/PaymentProcess/PaymentToWebProcessConnection.h b/Source/WebKit/PaymentProcess/PaymentToWebProcessConnection.h >new file mode 100644 >index 0000000000000000000000000000000000000000..7b314a02a8863bd3bdda90c1ddfdc6a8bbf11b04 >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/PaymentToWebProcessConnection.h >@@ -0,0 +1,73 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#if ENABLE(PAYMENT_PROCESS) >+ >+#pragma once >+ >+#include "Connection.h" >+#include "MessageSender.h" >+#include <pal/SessionID.h> >+#include <wtf/HashMap.h> >+ >+namespace WebKit { >+ >+class PaymentToWebProcessConnection : public RefCounted<PaymentToWebProcessConnection>, private IPC::Connection::Client, private IPC::MessageSender { >+public: >+ static Ref<PaymentToWebProcessConnection> create(IPC::Connection::Identifier); >+ ~PaymentToWebProcessConnection(); >+ >+ IPC::Connection& connection() { return m_connection.get(); } >+ >+ void validateMerchant(const String& validationURLString); >+ void didAuthorizePayment(const WebCore::Payment&); >+ void didSelectShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod&); >+ void didSelectShippingContact(const WebCore::PaymentContact&); >+ void didSelectPaymentMethod(const WebCore::PaymentMethod&); >+ void didCancelPaymentSession(); >+ void canMakePaymentsWithActiveCardReply(uint64_t requestID, bool canMakePayments); >+ void openPaymentSetupReply(uint64_t requestID, bool result); >+ >+private: >+ PaymentToWebProcessConnection(IPC::Connection::Identifier); >+ >+ // IPC::Connection::Client >+ void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; >+ void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override; >+ void didClose(IPC::Connection&) override; >+ void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override; >+ void didReceivePaymentToWebProcessConnectionMessage(IPC::Connection&, IPC::Decoder&); >+ void didReceiveSyncPaymentToWebProcessConnectionMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&); >+ >+ // IPC::MessageSender >+ IPC::Connection* messageSenderConnection() override { return m_connection.ptr(); } >+ uint64_t messageSenderDestinationID() override { return 0; } >+ >+ Ref<IPC::Connection> m_connection; >+}; >+ >+} // namespace WebKit >+ >+#endif // PAYMENT(PAYMENT_PROCESS) >diff --git a/Source/WebKit/PaymentProcess/PaymentToWebProcessConnection.messages.in b/Source/WebKit/PaymentProcess/PaymentToWebProcessConnection.messages.in >new file mode 100644 >index 0000000000000000000000000000000000000000..817f0d8689958383aa81dcc82d3cb7d5c444d888 >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/PaymentToWebProcessConnection.messages.in >@@ -0,0 +1,26 @@ >+# Copyright (C) 2018 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR >+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ >+#if ENABLE(PAYMENT_PROCESS) >+messages -> PaymentToWebProcessConnection { >+} >+#endif >diff --git a/Source/WebKit/PaymentProcess/ios/PaymentProcessIOS.mm b/Source/WebKit/PaymentProcess/ios/PaymentProcessIOS.mm >new file mode 100644 >index 0000000000000000000000000000000000000000..ecdbd5463a29a11cd25a5c70610c0f10290326e4 >--- /dev/null >+++ b/Source/WebKit/PaymentProcess/ios/PaymentProcessIOS.mm >@@ -0,0 +1,61 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#import "config.h" >+#import "PaymentProcess.h" >+ >+#if ENABLE(PAYMENT_PROCESS) >+ >+#if PLATFORM(IOS) >+ >+#import "SandboxInitializationParameters.h" >+ >+#define ENABLE_MANUAL_DATABASE_SANDBOXING 0 >+ >+namespace WebKit { >+ >+void PaymentProcess::initializeProcess(const ChildProcessInitializationParameters&) >+{ >+} >+ >+void PaymentProcess::initializeProcessName(const ChildProcessInitializationParameters& parameters) >+{ >+} >+ >+void PaymentProcess::initializeSandbox(const ChildProcessInitializationParameters& parameters, SandboxInitializationParameters& sandboxParameters) >+{ >+#if ENABLE_MANUAL_DATABASE_SANDBOXING >+ // Need to override the default, because service has a different bundle ID. >+ NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKWebView")]; >+ sandboxParameters.setOverrideSandboxProfilePath([webkit2Bundle pathForResource:@"com.apple.WebKit.Payments" ofType:@"sb"]); >+ ChildProcess::initializeSandbox(parameters, sandboxParameters); >+#endif >+} >+ >+} // namespace WebKit >+ >+#endif // PLATFORM(IOS) >+ >+#endif // PAYMENT(PAYMENT_PROCESS) >diff --git a/Source/WebKit/Platform/ExtraPrivateSymbolsForTAPI.h b/Source/WebKit/Platform/ExtraPrivateSymbolsForTAPI.h >index df08ea28af8ecb4064c99c7be33e72fd4d8b94c8..1a32ddad7d1da49d52b500ddddb39f64560899cb 100644 >--- a/Source/WebKit/Platform/ExtraPrivateSymbolsForTAPI.h >+++ b/Source/WebKit/Platform/ExtraPrivateSymbolsForTAPI.h >@@ -30,6 +30,7 @@ extern "C" { > #endif > > // FIXME: Remove these after <rdar://problem/30772033> is fixed. >+void PaymentServiceInitializer(); > void NetworkServiceInitializer(); > void PluginServiceInitializer(); > void WebContentServiceInitializer(); >diff --git a/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Payments.sb b/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Payments.sb >new file mode 100644 >index 0000000000000000000000000000000000000000..10672c686b1667ad97f5dfd75a4b3a7bdc0607b3 >--- /dev/null >+++ b/Source/WebKit/Resources/SandboxProfiles/ios/com.apple.WebKit.Payments.sb >@@ -0,0 +1,32 @@ >+; Copyright (C) 2018 Apple Inc. All rights reserved. >+; >+; Redistribution and use in source and binary forms, with or without >+; modification, are permitted provided that the following conditions >+; are met: >+; 1. Redistributions of source code must retain the above copyright >+; notice, this list of conditions and the following disclaimer. >+; 2. Redistributions in binary form must reproduce the above copyright >+; notice, this list of conditions and the following disclaimer in the >+; documentation and/or other materials provided with the distribution. >+; >+; THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+; THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+; PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+; BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+; CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+; SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+; INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+; CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+; ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+; THE POSSIBILITY OF SUCH DAMAGE. >+ >+(version 1) >+(deny default (with partial-symbolication)) >+(allow system-audit file-read-metadata) >+ >+(import "common.sb") >+ >+(deny mach-lookup (xpc-service-name-prefix "")) >+ >+(deny lsopen) >diff --git a/Source/WebKit/Scripts/process-payments-sandbox-entitlements.sh b/Source/WebKit/Scripts/process-payments-sandbox-entitlements.sh >new file mode 100755 >index 0000000000000000000000000000000000000000..c04f280fb8637af13390858d2480bd949dacaea9 >--- /dev/null >+++ b/Source/WebKit/Scripts/process-payments-sandbox-entitlements.sh >@@ -0,0 +1,14 @@ >+#!/bin/sh >+set -e >+ >+PROCESSED_XCENT_FILE="${TEMP_FILE_DIR}/${FULL_PRODUCT_NAME}.xcent" >+ >+if [[ ${WK_PLATFORM_NAME} == "macosx" ]]; then >+ >+ if [[ ${WK_USE_RESTRICTED_ENTITLEMENTS} == "YES" ]]; then >+ echo "Processing restricted entitlements for Internal SDK"; >+ >+ echo "Adding sandbox entitlements for Payments process."; >+ /usr/libexec/PlistBuddy -c "Merge Configurations/Payments-ios.entitlements" "${PROCESSED_XCENT_FILE}"; >+ fi >+fi >diff --git a/Source/WebKit/Shared/ChildProcess.h b/Source/WebKit/Shared/ChildProcess.h >index a72bc929dbd7c74c22669b82317a61ffabdf3769..de3e7aa8ad5d1c01bf1e881b18d328f859d10f7c 100644 >--- a/Source/WebKit/Shared/ChildProcess.h >+++ b/Source/WebKit/Shared/ChildProcess.h >@@ -48,7 +48,13 @@ public: > enum class ProcessType : uint8_t { > WebContent, > Network, >+#if ENABLE(PAYMENT_PROCESS) >+ Payment, >+#endif // ENABLE(PAYMENT_PROCESS) > Plugin >+#if ENABLE(PAYMENT_PROCESS) >+ Payment >+#endif // ENABLE(PAYMENT_PROCESS) > }; > > void initialize(const ChildProcessInitializationParameters&); >diff --git a/Source/WebKit/Shared/Payment/PaymentProcessCreationParameters.cpp b/Source/WebKit/Shared/Payment/PaymentProcessCreationParameters.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..57370973403d463408ed63bbcef4563bd009981f >--- /dev/null >+++ b/Source/WebKit/Shared/Payment/PaymentProcessCreationParameters.cpp >@@ -0,0 +1,53 @@ >+/* >+ * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#if ENABLE(PAYMENT_PROCESS) >+ >+#include "config.h" >+#include "PaymentProcessCreationParameters.h" >+ >+#include "ArgumentCoders.h" >+ >+namespace WebKit { >+ >+PaymentProcessCreationParameters::PaymentProcessCreationParameters() >+{ >+} >+ >+void PaymentProcessCreationParameters::encode(IPC::Encoder& encoder) const >+{ >+ encoder << sessionID; >+} >+ >+bool PaymentProcessCreationParameters::decode(IPC::Decoder& decoder, PaymentProcessCreationParameters& result) >+{ >+ if (!decoder.decode(result.sessionID)) >+ return false; >+ >+ return true; >+} >+ >+} // namespace WebKit >+#endif // ENABLE(PAYMENT_PROCESS) >diff --git a/Source/WebKit/Shared/Payment/PaymentProcessCreationParameters.h b/Source/WebKit/Shared/Payment/PaymentProcessCreationParameters.h >new file mode 100644 >index 0000000000000000000000000000000000000000..bac863c00a8a407013512ca231c05583517b9eec >--- /dev/null >+++ b/Source/WebKit/Shared/Payment/PaymentProcessCreationParameters.h >@@ -0,0 +1,52 @@ >+/* >+ * Copyright (C) 2013 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ * >+ */ >+#if ENABLE(PAYMENT_PROCESS) >+ >+#pragma once >+ >+#include "SandboxExtension.h" >+#include <pal/SessionID.h> >+#include <wtf/text/WTFString.h> >+ >+namespace IPC { >+class Decoder; >+class Encoder; >+} >+ >+namespace WebKit { >+ >+struct PaymentProcessCreationParameters { >+ PaymentProcessCreationParameters(); >+ >+ void encode(IPC::Encoder&) const; >+ static bool decode(IPC::Decoder&, PaymentProcessCreationParameters&); >+ >+ PAL::SessionID sessionID; >+}; >+ >+} // namespace WebKit >+ >+#endif // !PAYMENT(PAYMENT_PROCESS >diff --git a/Source/WebKit/Shared/ProcessExecutablePath.h b/Source/WebKit/Shared/ProcessExecutablePath.h >index 2ce716e4c72e582abe30f4879d2c6eb9e499a97b..62b5474efaa724eab528b4f6701791f0ce9aade0 100644 >--- a/Source/WebKit/Shared/ProcessExecutablePath.h >+++ b/Source/WebKit/Shared/ProcessExecutablePath.h >@@ -32,5 +32,8 @@ namespace WebKit { > String executablePathOfWebProcess(); > String executablePathOfPluginProcess(); > String executablePathOfNetworkProcess(); >+#if ENABLE(PAYMENT_PROCESS) >+String executablePathOfPaymentProcess(); >+#endif // !ENABLE(PAYMENT_PROCESS) > > } >diff --git a/Source/WebKit/Sources.txt b/Source/WebKit/Sources.txt >index 055ec5e576102f78649847ae3e34ae3e3c2c24a3..de0b13c3d153f35c95b9a7758a1063b028b65f83 100644 >--- a/Source/WebKit/Sources.txt >+++ b/Source/WebKit/Sources.txt >@@ -201,6 +201,7 @@ Shared/Databases/IndexedDB/WebIDBResult.cpp > > Shared/Gamepad/GamepadData.cpp > >+ > // TODO: These files should be unified once GTK's PluginProcess2 is removed. > Shared/Plugins/NPIdentifierData.cpp @no-unify > Shared/Plugins/NPObjectMessageReceiver.cpp @no-unify >diff --git a/Source/WebKit/SourcesCocoa.txt b/Source/WebKit/SourcesCocoa.txt >index f1a057a45db0fa35ce10dcf419693efe818a6da3..d48cac3ebd6da04fc654bb2b441f9f34c9fbd355 100644 >--- a/Source/WebKit/SourcesCocoa.txt >+++ b/Source/WebKit/SourcesCocoa.txt >@@ -184,6 +184,14 @@ Shared/mac/WebGestureEvent.cpp > Shared/mac/WebHitTestResultData.mm > Shared/mac/WebMemorySampler.mac.mm > >+PaymentProcess/EntryPoint/ios/XPCService/PaymentServiceEntryPoint.mm >+PaymentProcess/ios/PaymentProcessIOS.mm >+PaymentProcess/PaymentProcess.cpp >+PaymentProcess/PaymentProcessCoordinatorProxy.cpp >+PaymentProcess/PaymentToWebProcessConnection.cpp >+PaymentProcess/PaymentProcessCoordinatorProxyIOS.mm >+PaymentProcess/PaymentProcessCoordinatorProxyCocoa.mm >+ > Shared/Plugins/mac/PluginSandboxProfile.mm > > Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm >@@ -439,6 +447,8 @@ UIProcess/mac/WKViewLayoutStrategy.mm > > UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.cpp > >+UIProcess/Payments/PaymentProcessProxy.cpp >+ > UIProcess/Plugins/mac/PluginInfoStoreMac.mm > UIProcess/Plugins/mac/PluginProcessManagerMac.mm > UIProcess/Plugins/mac/PluginProcessProxyMac.mm >@@ -508,6 +518,9 @@ WebProcess/InjectedBundle/mac/InjectedBundleMac.mm > > WebProcess/MediaCache/WebMediaKeyStorageManager.cpp > >+WebProcess/Payments/PaymentProcessCoordinator.cpp >+WebProcess/Payments/WebToPaymentProcessConnection.cpp >+ > WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm > WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm > >diff --git a/Source/WebKit/UIProcess/API/C/WKContext.cpp b/Source/WebKit/UIProcess/API/C/WKContext.cpp >index 5f1bee46b6a697c46306e89db7dcb2f3aebf4090..cdf3a6b41ef6dd339de22b99d0560c2ef0377da0 100644 >--- a/Source/WebKit/UIProcess/API/C/WKContext.cpp >+++ b/Source/WebKit/UIProcess/API/C/WKContext.cpp >@@ -616,11 +616,43 @@ void WKContextTerminateServiceWorkerProcess(WKContextRef context) > WebKit::toImpl(context)->terminateServiceWorkerProcesses(); > } > >+void WKContextTerminatePaymentProcess(WKContextRef context) >+{ >+#if ENABLE(PAYMENT_PROCESS) >+ toImpl(context)->terminatePaymentProcessForTesting(); >+#endif // ENABLE(PAYMENT_PROCESS) >+} >+ >+void WKContextTerminatePaymentProcess(WKContextRef context) >+{ >+#if ENABLE(PAYMENT_PROCESS) >+ toImpl(context)->terminatePaymentProcessForTesting(); >+#endif // ENABLE(PAYMENT_PROCESS) >+} >+ > ProcessID WKContextGetNetworkProcessIdentifier(WKContextRef contextRef) > { > return WebKit::toImpl(contextRef)->networkProcessIdentifier(); > } > >+ProcessID WKContextGetPaymentProcessIdentifier(WKContextRef contextRef) >+{ >+#if ENABLE(PAYMENT_PROCESS) >+ return toImpl(contextRef)->paymentProcessIdentifier(); >+#else >+ return 0; >+#endif // ENABLE(PAYMENT_PROCESS) >+} >+ >+ProcessID WKContextGetPaymentProcessIdentifier(WKContextRef contextRef) >+{ >+#if ENABLE(PAYMENT_PROCESS) >+ return toImpl(contextRef)->paymentProcessIdentifier(); >+#else >+ return 0; >+#endif // ENABLE(PAYMENT_PROCESS) >+} >+ > void WKContextAddSupportedPlugin(WKContextRef contextRef, WKStringRef domainRef, WKStringRef nameRef, WKArrayRef mimeTypesRef, WKArrayRef extensionsRef) > { > #if ENABLE(NETSCAPE_PLUGIN_API) >diff --git a/Source/WebKit/UIProcess/API/C/WKContext.h b/Source/WebKit/UIProcess/API/C/WKContext.h >index c2de3afbc3e89ca649c4fa138c595115f33cb89d..c7cbd686b026273a054cd1988aa79a09d2154022 100644 >--- a/Source/WebKit/UIProcess/API/C/WKContext.h >+++ b/Source/WebKit/UIProcess/API/C/WKContext.h >@@ -50,6 +50,7 @@ typedef WKDataRef (*WKContextCopyWebCryptoMasterKeyCallback)(WKContextRef contex > > typedef void (*WKContextChildProcessDidCrashCallback)(WKContextRef context, const void *clientInfo); > typedef WKContextChildProcessDidCrashCallback WKContextNetworkProcessDidCrashCallback; >+typedef WKContextChildProcessDidCrashCallback WKContextPaymentProcessDidCrashCallback; > > typedef struct WKContextClientBase { > int version; >diff --git a/Source/WebKit/UIProcess/API/C/WKContextPrivate.h b/Source/WebKit/UIProcess/API/C/WKContextPrivate.h >index f9c7d3296e5c0cd7f3367de39a031d283fbe6666..1512639794d4ddeae6715e44c7aa33f23a3b9b4e 100644 >--- a/Source/WebKit/UIProcess/API/C/WKContextPrivate.h >+++ b/Source/WebKit/UIProcess/API/C/WKContextPrivate.h >@@ -92,6 +92,9 @@ WK_EXPORT void WKContextSetUsesNetworkProcess(WKContextRef, bool); > > WK_EXPORT void WKContextTerminateNetworkProcess(WKContextRef); > WK_EXPORT void WKContextTerminateServiceWorkerProcess(WKContextRef); >+WK_EXPORT void WKContextTerminatePaymentProcess(WKContextRef); >+ >+WK_EXPORT void WKContextTerminatePaymentProcess(WKContextRef); > > WK_EXPORT void WKContextSetAllowsAnySSLCertificateForWebSocketTesting(WKContextRef, bool); > WK_EXPORT void WKContextSetAllowsAnySSLCertificateForServiceWorkerTesting(WKContextRef, bool); >@@ -112,6 +115,7 @@ WK_EXPORT void WKContextSetFontWhitelist(WKContextRef, WKArrayRef); > WK_EXPORT void WKContextPreconnectToServer(WKContextRef context, WKURLRef serverURL); > > WK_EXPORT WKProcessID WKContextGetNetworkProcessIdentifier(WKContextRef context); >+WK_EXPORT WKProcessID WKContextGetPaymentProcessIdentifier(WKContextRef context); > > WK_EXPORT void WKContextAddSupportedPlugin(WKContextRef context, WKStringRef domain, WKStringRef name, WKArrayRef mimeTypes, WKArrayRef extensions); > WK_EXPORT void WKContextClearSupportedPlugins(WKContextRef context); >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm >index a18381ab35a97dba2fc3fab67320b4322764d785..9e70c604bb99bfd48ea400e2a1581986b1e0c454 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm >@@ -426,6 +426,13 @@ - (void)_clearSupportedPlugins > _processPool->clearSupportedPlugins(); > } > >+- (void)_terminatePaymentProcess >+{ >+#if ENABLE(PAYMENT_PROCESS) >+ _processPool->terminatePaymentProcessForTesting(); >+#endif // ENABLE(PAYMENT_PROCESS) >+} >+ > - (void)_terminateNetworkProcess > { > _processPool->terminateNetworkProcess(); >@@ -446,6 +453,15 @@ - (pid_t)_networkProcessIdentifier > return _processPool->networkProcessIdentifier(); > } > >+- (pid_t)_paymentProcessIdentifier >+{ >+#if ENABLE(PAYMENT_PROCESS) >+ return _processPool->paymentProcessIdentifier(); >+#else >+ return 0; >+#endif // ENABLE(PAYMENT_PROCESS) >+} >+ > - (void)_syncNetworkProcessCookies > { > _processPool->syncNetworkProcessCookies(); >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h >index 3de2c0362bf35e67b0434c1ef8bc83d606a14c36..62d8357af6c6b86d0c8f4d75159f975e11d6e1e7 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h >@@ -85,12 +85,14 @@ > - (_WKDownload *)_resumeDownloadFromData:(NSData *)resumeData path:(NSString *)path originatingWebView:(WKWebView *)webView WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > > // Test only. Should be called only while no web content processes are running. >+- (void)_terminatePaymentProcess WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > - (void)_terminateNetworkProcess; > - (void)_terminateServiceWorkerProcesses WK_API_AVAILABLE(macosx(10.14), ios(12.0)); > - (void)_disableServiceWorkerProcessTerminationDelay WK_API_AVAILABLE(macosx(10.14), ios(12.0)); > > // Test only. > - (pid_t)_networkProcessIdentifier WK_API_AVAILABLE(macosx(10.13), ios(11.0)); >+- (pid_t)_paymentProcessIdentifier WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA)); > > // Test only. > - (size_t)_webProcessCount WK_API_AVAILABLE(macosx(10.13), ios(11.0)); >diff --git a/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h b/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h >index c4d79fe4c12c9ab854fbbd42513b785383072ae7..7dba5f54bac67c267c11717779d6a670f3779c18 100644 >--- a/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h >+++ b/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h >@@ -31,11 +31,15 @@ > #import <pal/spi/cocoa/PassKitSPI.h> > #import <wtf/BlockPtr.h> > >+namespace WebCore { >+class URL; >+} >+ > namespace WebKit { > class WebPageProxy; > class WebPaymentCoordinatorProxy; > >-RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy&, const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&); >+RetainPtr<PKPaymentRequest> toPKPaymentRequest(const URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&); > > } > >diff --git a/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm b/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm >index a675ebdea975105ed4b9ea2bc50701d6aa1b408d..d12cb469f267290643ec9fae9715ed8c9a4f3f92 100644 >--- a/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm >+++ b/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm >@@ -441,8 +441,8 @@ static PKPaymentRequestAPIType toAPIType(WebCore::ApplePaySessionPaymentRequest: > } > } > #endif >- >-RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy& webPageProxy, const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest& paymentRequest) >+ >+RetainPtr<PKPaymentRequest> toPKPaymentRequest(WebPageProxy& webPageProxy, const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest& paymentRequest) > { > auto result = adoptNS([PAL::allocPKPaymentRequestInstance() init]); > >diff --git a/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h b/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h >index e07dba272a2e15be829de234c5dd50d5738e1a0c..14a39fa8ce75a59c31a18683dcad065180df3d87 100644 >--- a/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h >+++ b/Source/WebKit/UIProcess/Launcher/ProcessLauncher.h >@@ -58,6 +58,9 @@ public: > Plugin64, > #endif > Network, >+#if ENABLE(PAYMENT_PROCESS) >+ Payment, >+#endif // ENABLE(PAYMENT_PROCESS) > }; > > struct LaunchOptions { >diff --git a/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm b/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm >index 6cbac25d784c0eeea58a684ab468445ae2e39262..846764579e6196f70fd047f43dafb9c6d94d164e 100644 >--- a/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm >+++ b/Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm >@@ -62,6 +62,10 @@ static const char* serviceName(const ProcessLauncher::LaunchOptions& launchOptio > case ProcessLauncher::ProcessType::Plugin64: > return "com.apple.WebKit.Plugin.64"; > #endif >+#if ENABLE(PAYMENT_PROCESS) >+ case ProcessLauncher::ProcessType::Payment: >+ return "com.apple.WebKit.Payments"; >+#endif // ENABLE(PAYMENT_PROCESS) > } > } > >diff --git a/Source/WebKit/UIProcess/Payments/PaymentProcessProxy.cpp b/Source/WebKit/UIProcess/Payments/PaymentProcessProxy.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..749ae9bb14f57761e945c8680da674ab1083a6c3 >--- /dev/null >+++ b/Source/WebKit/UIProcess/Payments/PaymentProcessProxy.cpp >@@ -0,0 +1,136 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "PaymentProcessProxy.h" >+ >+#if ENABLE(PAYMENT_PROCESS) >+ >+#include "PaymentProcessMessages.h" >+#include "PaymentProcessProxyMessages.h" >+#include "ServiceWorkerProcessProxy.h" >+#include "WebProcessPool.h" >+#include "WebsiteData.h" >+#include <WebCore/NotImplemented.h> >+ >+#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, connection()) >+ >+namespace WebKit { >+using namespace WebCore; >+ >+PaymentProcessProxy::PaymentProcessProxy(WebProcessPool& processPool) >+ : ChildProcessProxy(processPool.alwaysRunsAtBackgroundPriority()) >+ , m_processPool(processPool) >+ , m_numPendingConnectionRequests(0) >+{ >+ connect(); >+} >+ >+PaymentProcessProxy::~PaymentProcessProxy() >+{ >+ for (auto& reply : m_pendingConnectionReplies) >+ reply({ }); >+} >+ >+void PaymentProcessProxy::terminateForTesting() >+{ >+ terminate(); >+} >+ >+void PaymentProcessProxy::getPaymentProcessConnection(WebProcessProxy& webProcessProxy, Messages::WebProcessProxy::GetPaymentProcessConnection::DelayedReply&& reply) >+{ >+ m_pendingConnectionReplies.append(WTFMove(reply)); >+ >+ if (state() != State::Running) { >+ m_numPendingConnectionRequests++; >+ return; >+ } >+ >+ >+ connection()->send(Messages::PaymentProcess::CreatePaymentToWebProcessConnection(), 0); >+ >+} >+ >+void PaymentProcessProxy::getLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions) >+{ >+ launchOptions.processType = ProcessLauncher::ProcessType::Payment; >+ ChildProcessProxy::getLaunchOptions(launchOptions); >+} >+ >+void PaymentProcessProxy::processWillShutDown(IPC::Connection& connection) >+{ >+ ASSERT_UNUSED(connection, this->connection() == &connection); >+} >+ >+void PaymentProcessProxy::didClose(IPC::Connection&) >+{ >+ auto protectedProcessPool = makeRef(m_processPool); >+ >+ // The payment process must have crashed or exited, so send any pending sync replies we might have. >+ while (!m_pendingConnectionReplies.isEmpty()) { >+ auto reply = m_pendingConnectionReplies.takeFirst(); >+ notImplemented(); >+ } >+ // Tell ProcessPool to forget about this payment process. This may cause us to be deleted. >+ m_processPool.paymentProcessCrashed(this); >+} >+ >+void PaymentProcessProxy::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) >+{ >+} >+ >+void PaymentProcessProxy::didCreatePaymentToWebProcessConnection(const IPC::Attachment& connectionIdentifier) >+{ >+ ASSERT(!m_pendingConnectionReplies.isEmpty()); >+ >+ // Grab the first pending connection reply. >+ auto reply = m_pendingConnectionReplies.takeFirst(); >+ MESSAGE_CHECK(MACH_PORT_VALID(connectionIdentifier.port())); >+ reply(IPC::Attachment(connectionIdentifier.port(), MACH_MSG_TYPE_MOVE_SEND)); >+ >+} >+ >+void PaymentProcessProxy::createPaymentToWebProcessConnection() >+{ >+} >+ >+void PaymentProcessProxy::didFinishLaunching(ProcessLauncher* launcher, IPC::Connection::Identifier connectionIdentifier) >+{ ChildProcessProxy::didFinishLaunching(launcher, connectionIdentifier); >+ >+ if (!IPC::Connection::identifierIsValid(connectionIdentifier)) { >+ // FIXME: Do better cleanup here. >+ return; >+ } >+ >+ for (unsigned i = 0; i < m_numPendingConnectionRequests; ++i) >+ send(Messages::PaymentProcess::CreatePaymentToWebProcessConnection(), 0); >+ >+ m_numPendingConnectionRequests = 0; >+} >+ >+} // namespace WebKit >+#undef MESSAGE_CHECK >+#endif // ENABLE(PAYMENT_PROCESS) >+ >diff --git a/Source/WebKit/UIProcess/Payments/PaymentProcessProxy.h b/Source/WebKit/UIProcess/Payments/PaymentProcessProxy.h >new file mode 100644 >index 0000000000000000000000000000000000000000..7bf1300491314786e32976cf8bd04236effa52c4 >--- /dev/null >+++ b/Source/WebKit/UIProcess/Payments/PaymentProcessProxy.h >@@ -0,0 +1,83 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+#if ENABLE(PAYMENT_PROCESS) >+ >+#pragma once >+ >+#include "ChildProcessProxy.h" >+#include "ProcessLauncher.h" >+#include "WebProcessProxyMessages.h" >+#include <wtf/Deque.h> >+#include <wtf/Forward.h> >+ >+namespace PAL { >+class SessionID; >+} >+ >+namespace WebCore { >+class SecurityOrigin; >+struct SecurityOriginData; >+} >+ >+namespace WebKit { >+ >+class WebProcessPool; >+class WebProcessProxy; >+enum class WebsiteDataType; >+struct WebsiteData; >+ >+class PaymentProcessProxy final : public ChildProcessProxy { >+public: >+ explicit PaymentProcessProxy(WebProcessPool&); >+ ~PaymentProcessProxy(); >+ >+ void terminateForTesting(); >+ void getPaymentProcessConnection(WebProcessProxy&, Messages::WebProcessProxy::GetPaymentProcessConnection::DelayedReply&&); >+ >+private: >+ // ChildProcessProxy >+ void getLaunchOptions(ProcessLauncher::LaunchOptions&) override; >+ void processWillShutDown(IPC::Connection&) override; >+ >+ // IPC::Connection::Client >+ void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; >+ void didClose(IPC::Connection&) override; >+ void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override; >+ >+ // Message handlers >+ void didCreatePaymentToWebProcessConnection(const IPC::Attachment&); >+ void createPaymentToWebProcessConnection(); >+ >+ // ProcessLauncher::Client >+ void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override; >+ >+ WebProcessPool& m_processPool; >+ >+ unsigned m_numPendingConnectionRequests; >+ Deque<Messages::WebProcessProxy::GetPaymentProcessConnection::DelayedReply> m_pendingConnectionReplies; >+}; >+ >+} // namespace WebKit >+#endif // ENABLE(PAYMENT_PROCESS) >diff --git a/Source/WebKit/UIProcess/Payments/PaymentProcessProxy.messages.in b/Source/WebKit/UIProcess/Payments/PaymentProcessProxy.messages.in >new file mode 100644 >index 0000000000000000000000000000000000000000..5b0d51772aaeec70ebc60f3546b8e1276f80646c >--- /dev/null >+++ b/Source/WebKit/UIProcess/Payments/PaymentProcessProxy.messages.in >@@ -0,0 +1,28 @@ >+# Copyright (C) 2018 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR >+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, >+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ >+#if ENABLE(PAYMENT_PROCESS) >+messages -> PaymentProcessProxy { >+ DidCreatePaymentToWebProcessConnection(IPC::Attachment connectionIdentifier) >+ >+} >+#endif // ENABLE(PAYMENT_PROCESS) >diff --git a/Source/WebKit/UIProcess/WebContextClient.cpp b/Source/WebKit/UIProcess/WebContextClient.cpp >index fa45762eceba013a6aca4f964da856639741d575..bec79b54cbf6c6ec5efeff4a97570f699b553f11 100644 >--- a/Source/WebKit/UIProcess/WebContextClient.cpp >+++ b/Source/WebKit/UIProcess/WebContextClient.cpp >@@ -46,4 +46,11 @@ void WebContextClient::networkProcessDidCrash(WebProcessPool* processPool) > m_client.networkProcessDidCrash(toAPI(processPool), m_client.base.clientInfo); > } > >+#if ENABLE(PAYMENT_PROCESS) >+void WebContextClient::paymentProcessDidCrash(WebProcessPool* processPool) >+{ >+ >+} >+#endif // ENABLE(PAYMENT_PROCESS) >+ > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebContextClient.h b/Source/WebKit/UIProcess/WebContextClient.h >index 80c31122c0776d4ee8d778d566821015221637d6..59b3a4079108f238f1d6f8abf1ab9edcc8453916 100644 >--- a/Source/WebKit/UIProcess/WebContextClient.h >+++ b/Source/WebKit/UIProcess/WebContextClient.h >@@ -45,6 +45,10 @@ class WebContextClient : public API::Client<WKContextClientBase> { > public: > void plugInAutoStartOriginHashesChanged(WebProcessPool*); > void networkProcessDidCrash(WebProcessPool*); >+#if ENABLE(PAYMENT_PROCESS) >+ void paymentProcessDidCrash(WebProcessPool*); >+#endif // ENABLE(PAYMENT_PROCESS) >+ > }; > > } // namespace WebKit >diff --git a/Source/WebKit/UIProcess/WebContextSupplement.h b/Source/WebKit/UIProcess/WebContextSupplement.h >index ed55b403db29f9400438ba32a60c758274934fa6..2c6acbb05cb026acda75c067d1f0d9d459a127e7 100644 >--- a/Source/WebKit/UIProcess/WebContextSupplement.h >+++ b/Source/WebKit/UIProcess/WebContextSupplement.h >@@ -29,6 +29,10 @@ > namespace WebKit { > > class NetworkProcessProxy; >+#if ENABLE(PAYMENT_PROCESS) >+class PaymentProcessProxy; >+#endif // ENABLE(PAYMENT_PROCESS) >+ > class WebProcessPool; > class WebProcessProxy; > >@@ -54,6 +58,12 @@ public: > virtual void processDidClose(NetworkProcessProxy*) > { > } >+ >+#if ENABLE(PAYMENT_PROCESS) >+ virtual void processDidClose(PaymentProcessProxy*) >+ { >+ } >+#endif // ENABLE(PAYMENT_PROCESS) > > WebProcessPool* processPool() const { return m_processPool; } > void clearProcessPool() { m_processPool = nullptr; } >diff --git a/Source/WebKit/UIProcess/WebInspectorProxy.cpp b/Source/WebKit/UIProcess/WebInspectorProxy.cpp >index 308c504c128cb05a16a12a4897b47c586c48453e..bce1f896b0fb63812d99f579f6516f3fa9c67c81 100644 >--- a/Source/WebKit/UIProcess/WebInspectorProxy.cpp >+++ b/Source/WebKit/UIProcess/WebInspectorProxy.cpp >@@ -645,7 +645,7 @@ void WebInspectorProxy::platformInspectedURLChanged(const String&) > notImplemented(); > } > >-void WebInspectorProxy::platformShowCertificate(const CertificateInfo&) >+void WebInspectorProxy::platformShowCertificate(const WebCore::CertificateInfo&) > { > notImplemented(); > } >diff --git a/Source/WebKit/UIProcess/WebProcessPool.cpp b/Source/WebKit/UIProcess/WebProcessPool.cpp >index 82830a53f61494b12020d48152078a5c93e2a5ca..c404ffcee71aebd161ab61d71f74ae55ce1c66ee 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.cpp >+++ b/Source/WebKit/UIProcess/WebProcessPool.cpp >@@ -54,6 +54,9 @@ > #include "SandboxExtension.h" > #include "ServiceWorkerProcessProxy.h" > #include "StatisticsData.h" >+#if ENABLE(PAYMENT_PROCESS) >+#include "PaymentProcessMessages.h" >+#endif // ENABLE(PAYMENT_PROCESS) > #include "TextChecker.h" > #include "UIGamepad.h" > #include "UIGamepadProvider.h" >@@ -328,6 +331,9 @@ WebProcessPool::~WebProcessPool() > > if (m_networkProcess) > m_networkProcess->shutDownProcess(); >+ >+ if (m_paymentProcess) >+ m_paymentProcess->shutDownProcess(); > > #if ENABLE(GAMEPAD) > if (!m_processesUsingGamepads.isEmpty()) >@@ -442,6 +448,9 @@ void WebProcessPool::sendMemoryPressureEvent(bool isCritical) > { > sendToAllProcesses(Messages::ChildProcess::DidReceiveMemoryPressureEvent(isCritical)); > sendToNetworkingProcess(Messages::ChildProcess::DidReceiveMemoryPressureEvent(isCritical)); >+#if ENABLE(PAYMENT_PROCESS) >+ sendToPaymentProcess(Messages::ChildProcess::DidReceiveMemoryPressureEvent(isCritical)); >+#endif // ENABLE(PAYMENT_PROCESS) > #if ENABLE(NETSCAPE_PLUGIN_API) > PluginProcessManager::singleton().sendMemoryPressureEvent(isCritical); > #endif >@@ -617,6 +626,36 @@ void WebProcessPool::getNetworkProcessConnection(WebProcessProxy& webProcessProx > m_networkProcess->getNetworkProcessConnection(webProcessProxy, WTFMove(reply)); > } > >+#if ENABLE(PAYMENT_PROCESS) >+void WebProcessPool::ensurePaymentProcess() >+{ >+ if (!m_paymentProcess) >+ m_paymentProcess = std::make_unique<PaymentProcessProxy>(*this); >+} >+ >+void WebProcessPool::getPaymentProcessConnection(WebProcessProxy& webProcessProxy, Messages::WebProcessProxy::GetPaymentProcessConnection::DelayedReply&& reply) >+{ >+ ensurePaymentProcess(); >+ m_paymentProcess->getPaymentProcessConnection(webProcessProxy, WTFMove(reply)); >+} >+ >+void WebProcessPool::paymentProcessCrashed(PaymentProcessProxy* paymentProcessProxy) >+{ >+ ASSERT(m_paymentProcess); >+ ASSERT(paymentProcessProxy == m_paymentProcess.get()); >+ >+ for (auto& supplement : m_supplements.values()) >+ supplement->processDidClose(paymentProcessProxy); >+ >+ m_client.paymentProcessDidCrash(this); >+ >+ if (m_automationSession) >+ m_automationSession->terminate(); >+ >+ m_paymentProcess = nullptr; >+} >+#endif // ENABLE(PAYMENT_PROCESS) >+ > #if ENABLE(SERVICE_WORKER) > void WebProcessPool::establishWorkerContextConnectionToNetworkProcess(NetworkProcessProxy& proxy, SecurityOriginData&& securityOrigin, std::optional<PAL::SessionID> sessionID) > { >@@ -693,6 +732,9 @@ void WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled(bool private > sendToAllProcesses(Messages::WebProcess::AddWebsiteDataStore(WebsiteDataStoreParameters::legacyPrivateSessionParameters())); > } else { > networkProcess()->removeSession(PAL::SessionID::legacyPrivateSessionID()); >+#if ENABLE(PAYMENT_PROCESS) >+// sendToPaymentProcess(Messages::PaymentProcess::DestroySession(PAL::SessionID::defaultSessionID())); >+#endif // ENABLE(PAYMENT_PROCESS) > sendToAllProcesses(Messages::WebProcess::DestroySession(PAL::SessionID::legacyPrivateSessionID())); > } > } >@@ -806,6 +848,9 @@ void WebProcessPool::initializeNewWebProcess(WebProcessProxy& process, WebsiteDa > }); > > ensureNetworkProcess(); >+#if ENABLE(PAYMENT_PROCESS) >+ ensurePaymentProcess(); >+#endif > > WebProcessCreationParameters parameters; > >@@ -1354,6 +1399,23 @@ void WebProcessPool::activePagesOriginsInWebProcessForTesting(ProcessID pid, Com > } > completionHandler({ }); > } >+#if ENABLE(PAYMENT_PROCESS) >+ProcessID WebProcessPool::paymentProcessIdentifier() >+{ >+ if (!m_paymentProcess) >+ return 0; >+ >+ return m_paymentProcess->processIdentifier(); >+} >+#if ENABLE(PAYMENT_PROCESS) >+ProcessID WebProcessPool::paymentProcessIdentifier() >+{ >+ if (!m_paymentProcess) >+ return 0; >+ >+ return m_paymentProcess->processIdentifier(); >+} >+#endif // ENABLE(PAYMENT_PROCESS) > > void WebProcessPool::setAlwaysUsesComplexTextCodePath(bool alwaysUseComplexText) > { >@@ -1625,6 +1687,17 @@ void WebProcessPool::clearCachedCredentials() > if (m_networkProcess) > m_networkProcess->send(Messages::NetworkProcess::ClearCachedCredentials(), 0); > } >+ >+#if ENABLE(PAYMENT_PROCESS) >+void WebProcessPool::terminatePaymentProcessForTesting() >+{ >+ if (!m_paymentProcess) >+ return; >+ >+ m_paymentProcess->terminateForTesting(); >+ m_paymentProcess = nullptr; >+} >+#endif // ENABLE(PAYMENT_PROCESS) > > void WebProcessPool::terminateNetworkProcess() > { >diff --git a/Source/WebKit/UIProcess/WebProcessPool.h b/Source/WebKit/UIProcess/WebProcessPool.h >index 06343249baa725afb6cb444c5523253d17e080bc..3461fa34ce74514b1944994895e89d0a374a38b8 100644 >--- a/Source/WebKit/UIProcess/WebProcessPool.h >+++ b/Source/WebKit/UIProcess/WebProcessPool.h >@@ -40,6 +40,9 @@ > #include "ProcessThrottler.h" > #include "ServiceWorkerProcessProxy.h" > #include "StatisticsRequest.h" >+#if ENABLE(PAYMENT_PROCESS) >+#include "PaymentProcessProxy.h" >+#endif // ENABLE(PAYMENT_PROCESS) > #include "VisitedLinkStore.h" > #include "WebContextClient.h" > #include "WebContextConnectionClient.h" >@@ -173,6 +176,12 @@ public: > template<typename T, typename U> void sendSyncToNetworkingProcess(T&& message, U&& reply); > template<typename T> void sendToNetworkingProcessRelaunchingIfNecessary(T&& message); > >+#if ENABLE(PAYMENT_PROCESS) >+ // Sends the message to WebProcess or PaymentProcess as approporiate for current process model. >+ template<typename T> void sendToPaymentProcess(T&& message); >+ template<typename T> void sendToPaymentProcessRelaunchingIfNecessary(T&& message); >+#endif // ENABLE(PAYMENT_PROCESS) >+ > void processDidFinishLaunching(WebProcessProxy*); > > // Disconnect the process from the context. >@@ -217,6 +226,9 @@ public: > ProcessID networkProcessIdentifier(); > void activePagesOriginsInWebProcessForTesting(ProcessID, CompletionHandler<void(Vector<String>&&)>&&); > bool networkProcessHasEntitlementForTesting(const String&); >+#if ENABLE(PAYMENT_PROCESS) >+ ProcessID paymentProcessIdentifier(); >+#endif // ENABLE(PAYMENT_PROCESS) > > WebPageGroup& defaultPageGroup() { return m_defaultPageGroup.get(); } > >@@ -276,6 +288,9 @@ public: > void setAllowsAnySSLCertificateForWebSocket(bool); > > void clearCachedCredentials(); >+#if ENABLE(PAYMENT_PROCESS) >+ void terminatePaymentProcessForTesting(); >+#endif // ENABLE(PAYMENT_PROCESS) > void terminateNetworkProcess(); > void terminateServiceWorkerProcesses(); > void disableServiceWorkerProcessTerminationDelay(); >@@ -344,6 +359,12 @@ public: > > void getNetworkProcessConnection(WebProcessProxy&, Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply&&); > >+#if ENABLE(PAYMENT_PROCESS) >+ void ensurePaymentProcess(); >+ PaymentProcessProxy* paymentProcess() { return m_paymentProcess.get(); } >+ void getPaymentProcessConnection(WebProcessProxy&, Messages::WebProcessProxy::GetPaymentProcessConnection::DelayedReply&&); >+ void paymentProcessCrashed(PaymentProcessProxy*); >+#endif // ENABLE(PAYMENT_PROCESS) > #if ENABLE(SERVICE_WORKER) > void establishWorkerContextConnectionToNetworkProcess(NetworkProcessProxy&, WebCore::SecurityOriginData&&, std::optional<PAL::SessionID>); > ServiceWorkerProcessProxy* serviceWorkerProcessProxyFromPageID(uint64_t pageID) const; >@@ -644,6 +665,9 @@ private: > bool m_canHandleHTTPSServerTrustEvaluation { true }; > bool m_didNetworkProcessCrash { false }; > std::unique_ptr<NetworkProcessProxy> m_networkProcess; >+#if ENABLE(PAYMENT_PROCESS) >+ std::unique_ptr<PaymentProcessProxy> m_paymentProcess; >+#endif // ENABLE(PAYMENT_PROCESS) > > HashMap<uint64_t, RefPtr<DictionaryCallback>> m_dictionaryCallbacks; > HashMap<uint64_t, RefPtr<StatisticsRequest>> m_statisticsRequests; >@@ -745,6 +769,22 @@ void WebProcessPool::sendToNetworkingProcessRelaunchingIfNecessary(T&& message) > m_networkProcess->send(std::forward<T>(message), 0); > } > >+#if ENABLE(PAYMENT_PROCESS) >+template<typename T> >+void WebProcessPool::sendToPaymentProcess(T&& message) >+{ >+ if (m_paymentProcess && m_paymentProcess->canSendMessage()) >+ m_paymentProcess->send(std::forward<T>(message), 0); >+} >+ >+template<typename T> >+void WebProcessPool::sendToPaymentProcessRelaunchingIfNecessary(T&& message) >+{ >+ ensurePaymentProcess(); >+ m_paymentProcess->send(std::forward<T>(message), 0); >+} >+#endif // ENABLE(PAYMENT_PROCESS) >+ > template<typename T> > void WebProcessPool::sendToAllProcesses(const T& message) > { >diff --git a/Source/WebKit/UIProcess/WebProcessProxy.cpp b/Source/WebKit/UIProcess/WebProcessProxy.cpp >index dd567f8b73cc064f36cac62d6d47ade3c93684c1..6d76626430af182a750ee3681154bddb3dafd00b 100644 >--- a/Source/WebKit/UIProcess/WebProcessProxy.cpp >+++ b/Source/WebKit/UIProcess/WebProcessProxy.cpp >@@ -631,6 +631,12 @@ void WebProcessProxy::getNetworkProcessConnection(Messages::WebProcessProxy::Get > { > m_processPool->getNetworkProcessConnection(*this, WTFMove(reply)); > } >+#if ENABLE(PAYMENT_PROCESS) >+void WebProcessProxy::getPaymentProcessConnection(Messages::WebProcessProxy::GetPaymentProcessConnection::DelayedReply&& reply) >+{ >+ m_processPool->getPaymentProcessConnection(*this, WTFMove(reply)); >+} >+#endif // ENABLE(PAYMENT_PROCESS) > > #if !PLATFORM(COCOA) > bool WebProcessProxy::platformIsBeingDebugged() const >diff --git a/Source/WebKit/UIProcess/WebProcessProxy.h b/Source/WebKit/UIProcess/WebProcessProxy.h >index 2361ae773a77efecbfa5649aee762e596e7bda97..529a870fdb30bbcbd1acb7e3c48525fc87916b18 100644 >--- a/Source/WebKit/UIProcess/WebProcessProxy.h >+++ b/Source/WebKit/UIProcess/WebProcessProxy.h >@@ -290,6 +290,9 @@ private: > #endif > void getNetworkProcessConnection(Messages::WebProcessProxy::GetNetworkProcessConnection::DelayedReply&&); > >+#if ENABLE(PAYMENT_PROCESS) >+ void getPaymentProcessConnection(Messages::WebProcessProxy::GetPaymentProcessConnection::DelayedReply&&); >+#endif // ENABLE(PAYMENT_PROCESS) > bool platformIsBeingDebugged() const; > bool shouldAllowNonValidInjectedCode() const; > >diff --git a/Source/WebKit/UIProcess/WebProcessProxy.messages.in b/Source/WebKit/UIProcess/WebProcessProxy.messages.in >index 6a98f4e96047dabf164a7610a87f2a9f6860b48a..5a1482790e93c2c15db76751cf15184e9da18b2e 100644 >--- a/Source/WebKit/UIProcess/WebProcessProxy.messages.in >+++ b/Source/WebKit/UIProcess/WebProcessProxy.messages.in >@@ -37,6 +37,9 @@ messages -> WebProcessProxy LegacyReceiver { > GetPluginProcessConnection(uint64_t pluginProcessToken) -> (IPC::Attachment connectionHandle, bool supportsAsynchronousInitialization) Delayed > #endif > GetNetworkProcessConnection() -> (IPC::Attachment connectionHandle) Delayed >+#if ENABLE(PAYMENT_PROCESS) >+ GetPaymentProcessConnection() -> (IPC::Attachment connectionHandle) Delayed >+#endif // ENABLE(PAYMENT_PROCESS) > ProcessReadyToSuspend() > DidCancelProcessSuspension() > >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >index 14960d3380ff93e5643f2ba93faa3f60cc2aa34a..f433dde748e4b8ce69cbfefed285b233b8fa915b 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp >@@ -58,6 +58,10 @@ > #include "PluginProcessManager.h" > #endif > >+#if ENABLE(PAYMENT_PROCESS) >+#include "PaymentProcessMessages.h" >+#endif // ENABLE(PAYMENT_PROCESS) >+ > #if HAVE(SEC_KEY_PROXY) > #include "SecKeyProxyStore.h" > #endif >@@ -132,6 +136,9 @@ WebsiteDataStore::~WebsiteDataStore() > ASSERT(nonDefaultDataStores().get(m_sessionID) == this); > nonDefaultDataStores().remove(m_sessionID); > for (auto& processPool : WebProcessPool::allProcessPools()) { >+#if ENABLE(PAYMENT_PROCESS) >+ destroyPaymentProcessSession(processPool); >+#endif > if (auto* networkProcess = processPool->networkProcess()) > networkProcess->removeSession(m_sessionID); > } >@@ -1319,6 +1326,13 @@ void WebsiteDataStore::removeAllStorageAccessHandler(CompletionHandler<void()>&& > } > } > >+void WebsiteDataStore::destroyPaymentProcessSession(WebProcessPool* pool) >+{ >+#if ENABLE(PAYMENT_PROCESS) >+ pool->sendToPaymentProcess(Messages::PaymentProcess::DestroySession()); >+#endif // ENABLE(PAYMENT_PROCESS) >+} >+ > void WebsiteDataStore::removePrevalentDomains(const Vector<String>& domains) > { > for (auto& processPool : processPools()) >@@ -1623,6 +1637,19 @@ void WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses(CompletionHandl > callback(); > } > >+#if ENABLE(PAYMENT_PROCESS) >+PaymentProcessCreationParameters WebsiteDataStore::paymentProcessParameters() >+{ >+ resolveDirectoriesIfNecessary(); >+ >+ PaymentProcessCreationParameters parameters; >+ >+ parameters.sessionID = m_sessionID; >+ >+ return parameters; >+} >+#endif // ENABLE(PAYMENT_PROCESS) >+ > Vector<WebCore::Cookie> WebsiteDataStore::pendingCookies() const > { > return copyToVector(m_pendingCookies); >diff --git a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >index 40f575aba4c290f78c531bfb5a9d047a94d79d7f..227c47727385579b8588863be14c03314b096c04 100644 >--- a/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >+++ b/Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.h >@@ -67,6 +67,9 @@ class WebResourceLoadStatisticsStore; > enum class WebsiteDataFetchOption; > enum class WebsiteDataType; > struct MockWebAuthenticationConfiguration; >+#if ENABLE(PAYMENT_PROCESS) >+struct PaymentProcessCreationParameters; >+#endif // ENABLE(PAYMENT_PROCESS) > struct WebsiteDataRecord; > struct WebsiteDataStoreParameters; > >@@ -148,6 +151,7 @@ public: > bool isAssociatedProcessPool(WebProcessPool&) const; > > WebsiteDataStoreParameters parameters(); >+ void destroyPaymentProcessSession(WebProcessPool*); > > Vector<WebCore::Cookie> pendingCookies() const; > void addPendingCookie(const WebCore::Cookie&); >diff --git a/Source/WebKit/WebKit.xcodeproj/project.pbxproj b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >index ffb8f95036b852b7854c494f4420ba958a1282d5..dd91818b0e90f5e607de73261b0fbe199aac3079 100644 >--- a/Source/WebKit/WebKit.xcodeproj/project.pbxproj >+++ b/Source/WebKit/WebKit.xcodeproj/project.pbxproj >@@ -20,6 +20,7 @@ > BC77F95616D0459100F8F78A /* PBXTargetDependency */, > BC82844616B4FF6600A278FE /* PBXTargetDependency */, > BC8283D516B4C01F00A278FE /* PBXTargetDependency */, >+ 39E9ECA921B8764200BA5F19 /* PBXTargetDependency */, > ); > name = All; > productName = WebKit2; >@@ -849,6 +850,18 @@ > 37F90DE31376560E0051CF68 /* HTTPCookieAcceptPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = F638954F133BEF38008941D5 /* HTTPCookieAcceptPolicy.h */; }; > 37FC19471850FBF2008CFA47 /* WKBrowsingContextLoadDelegatePrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 37FC19461850FBF2008CFA47 /* WKBrowsingContextLoadDelegatePrivate.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 37FC194B18510D6A008CFA47 /* WKNSURLAuthenticationChallenge.h in Headers */ = {isa = PBXBuildFile; fileRef = 37FC194918510D6A008CFA47 /* WKNSURLAuthenticationChallenge.h */; }; >+ 393F259F21C8D46500E4CE85 /* WebToPaymentProcessConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 393F259D21C8D44000E4CE85 /* WebToPaymentProcessConnectionMessageReceiver.cpp */; }; >+ 393F25A021C8D46800E4CE85 /* WebToPaymentProcessConnectionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 393F259E21C8D44100E4CE85 /* WebToPaymentProcessConnectionMessages.h */; }; >+ 395CDC5F21BB45D500766E4D /* PaymentProcessCoordinatorProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 395CDC5E21BB453300766E4D /* PaymentProcessCoordinatorProxyMessages.h */; }; >+ 395CDC6121BB46D700766E4D /* PaymentProcessCoordinatorMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 395CDC6021BB46CD00766E4D /* PaymentProcessCoordinatorMessages.h */; }; >+ 395CDC6421BB5E4E00766E4D /* PaymentProcessCoordinatorMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395CDC6321BB5E2C00766E4D /* PaymentProcessCoordinatorMessageReceiver.cpp */; }; >+ 395CDC6521BB5E5100766E4D /* PaymentProcessCoordinatorProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 395CDC6221BB5E1B00766E4D /* PaymentProcessCoordinatorProxyMessageReceiver.cpp */; }; >+ 395CDC6D21C47B6800766E4D /* PaymentProcessProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5118E9A71F295963003EF9F5 /* PaymentProcessProxyMessageReceiver.cpp */; }; >+ 395CDC6E21C47C5E00766E4D /* PaymentProcessMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5118E9A51F295963003EF9F5 /* PaymentProcessMessageReceiver.cpp */; }; >+ 39E9EC9721B75ED700BA5F19 /* XPCServiceMain.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC82839616B47EC400A278FE /* XPCServiceMain.mm */; }; >+ 39E9EC9921B75ED700BA5F19 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BC3DE46815A91763008D26FC /* Foundation.framework */; }; >+ 39E9EC9A21B75ED700BA5F19 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DC2EF5B0486A6940098B216 /* WebKit.framework */; }; >+ 39F8E43621B754ED00F2B96C /* com.apple.WebKit.Payments.sb in CopyFiles */ = {isa = PBXBuildFile; fileRef = 391360242193C1430056492A /* com.apple.WebKit.Payments.sb */; }; > 3F418EF91887BD97002795FD /* VideoFullscreenManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F418EF51887BD97002795FD /* VideoFullscreenManagerMessageReceiver.cpp */; }; > 3F418EFB1887BD97002795FD /* VideoFullscreenManagerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F418EF71887BD97002795FD /* VideoFullscreenManagerProxyMessageReceiver.cpp */; }; > 3F87B9BE158940190090FF62 /* WebColorChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F87B9BB15893F630090FF62 /* WebColorChooser.h */; }; >@@ -908,6 +921,8 @@ > 510F59111DDE297000412FF5 /* _WKLinkIconParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 51C0C9791DDD78540032CAD3 /* _WKLinkIconParameters.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 510FBB9B1288C95E00AFFDF4 /* WebContextMenuItemData.h in Headers */ = {isa = PBXBuildFile; fileRef = 510FBB991288C95E00AFFDF4 /* WebContextMenuItemData.h */; }; > 5110AE0D133C16CB0072717A /* WKIconDatabase.h in Headers */ = {isa = PBXBuildFile; fileRef = 5110AE0B133C16CB0072717A /* WKIconDatabase.h */; settings = {ATTRIBUTES = (Private, ); }; }; >+ 5118E9A91F295977003EF9F5 /* PaymentProcessMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 5118E9A61F295963003EF9F5 /* PaymentProcessMessages.h */; }; >+ 5118E9AB1F295977003EF9F5 /* PaymentProcessProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 5118E9A21F295963003EF9F5 /* PaymentProcessProxyMessages.h */; }; > 511F7D411EB1BCF500E47B83 /* WebsiteDataStoreParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 511F7D401EB1BCEE00E47B83 /* WebsiteDataStoreParameters.h */; }; > 511F8A7B138B460900A95F44 /* SecItemShimLibrary.h in Headers */ = {isa = PBXBuildFile; fileRef = 511F8A77138B460900A95F44 /* SecItemShimLibrary.h */; }; > 511F8A81138B485D00A95F44 /* SecItemShimLibrary.mm in Sources */ = {isa = PBXBuildFile; fileRef = 511F8A78138B460900A95F44 /* SecItemShimLibrary.mm */; }; >@@ -959,6 +974,7 @@ > 517CF0E3163A486C00C2950E /* NetworkProcessConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517CF0E1163A486C00C2950E /* NetworkProcessConnectionMessageReceiver.cpp */; }; > 517CF0E3163A486C00C2950F /* CacheStorageEngineConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 517CF0E1163A486C00C2950F /* CacheStorageEngineConnectionMessageReceiver.cpp */; }; > 517CF0E4163A486C00C2950E /* NetworkProcessConnectionMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 517CF0E2163A486C00C2950E /* NetworkProcessConnectionMessages.h */; }; >+ 517DD5BF180DA7D30081660B /* PaymentProcessProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 517DD5BD180DA7D30081660B /* PaymentProcessProxy.h */; }; > 51871B5C127CB89D00F76232 /* WebContextMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = 51871B5A127CB89D00F76232 /* WebContextMenu.h */; }; > 518ACAEA12AEE6BB00B04B83 /* WKProtectionSpaceTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 518ACAE912AEE6BB00B04B83 /* WKProtectionSpaceTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 518ACF1112B015F800B04B83 /* WKCredentialTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 518ACF1012B015F800B04B83 /* WKCredentialTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; >@@ -1695,6 +1711,27 @@ > remoteGlobalIDString = C0CE72851247E66800BC0EC4; > remoteInfo = "Derived Sources"; > }; >+ 39E9EC9221B75ED700BA5F19 /* PBXContainerItemProxy */ = { >+ isa = PBXContainerItemProxy; >+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; >+ proxyType = 1; >+ remoteGlobalIDString = E1AC2E2720F7B94C00B0897D; >+ remoteInfo = "Unlock Keychain"; >+ }; >+ 39E9EC9421B75ED700BA5F19 /* PBXContainerItemProxy */ = { >+ isa = PBXContainerItemProxy; >+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; >+ proxyType = 1; >+ remoteGlobalIDString = 8DC2EF4F0486A6940098B216; >+ remoteInfo = WebKit; >+ }; >+ 39E9ECA821B8764200BA5F19 /* PBXContainerItemProxy */ = { >+ isa = PBXContainerItemProxy; >+ containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; >+ proxyType = 1; >+ remoteGlobalIDString = 39E9EC9021B75ED700BA5F19; >+ remoteInfo = Payments; >+ }; > BC77F95516D0459100F8F78A /* PBXContainerItemProxy */ = { > isa = PBXContainerItemProxy; > containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; >@@ -1843,6 +1880,7 @@ > dstSubfolderSpec = 0; > files = ( > A78CCDDB193AC9F8005ECC25 /* com.apple.WebKit.Networking.sb in CopyFiles */, >+ 39F8E43621B754ED00F2B96C /* com.apple.WebKit.Payments.sb in CopyFiles */, > A78CCDDC193AC9FB005ECC25 /* com.apple.WebKit.WebContent.sb in CopyFiles */, > ); > runOnlyForDeploymentPostprocessing = 0; >@@ -2984,6 +3022,30 @@ > 37FC19461850FBF2008CFA47 /* WKBrowsingContextLoadDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBrowsingContextLoadDelegatePrivate.h; sourceTree = "<group>"; }; > 37FC194818510D6A008CFA47 /* WKNSURLAuthenticationChallenge.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WKNSURLAuthenticationChallenge.mm; sourceTree = "<group>"; }; > 37FC194918510D6A008CFA47 /* WKNSURLAuthenticationChallenge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNSURLAuthenticationChallenge.h; sourceTree = "<group>"; }; >+ 391360242193C1430056492A /* com.apple.WebKit.Payments.sb */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = com.apple.WebKit.Payments.sb; sourceTree = "<group>"; }; >+ 393F259D21C8D44000E4CE85 /* WebToPaymentProcessConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = WebToPaymentProcessConnectionMessageReceiver.cpp; path = DerivedSources/WebKit2/WebToPaymentProcessConnectionMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 393F259E21C8D44100E4CE85 /* WebToPaymentProcessConnectionMessages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WebToPaymentProcessConnectionMessages.h; path = DerivedSources/WebKit2/WebToPaymentProcessConnectionMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 395CDC4B21BA1FAD00766E4D /* PaymentProcessCoordinator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentProcessCoordinator.h; sourceTree = "<group>"; }; >+ 395CDC4C21BA1FAD00766E4D /* PaymentProcessCoordinator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentProcessCoordinator.cpp; sourceTree = "<group>"; }; >+ 395CDC4F21BB0B0600766E4D /* PaymentProcessCoordinatorProxy.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentProcessCoordinatorProxy.h; sourceTree = "<group>"; }; >+ 395CDC5021BB0B0600766E4D /* PaymentProcessCoordinatorProxy.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentProcessCoordinatorProxy.cpp; sourceTree = "<group>"; }; >+ 395CDC5121BB30D700766E4D /* PaymentProcessCoordinatorProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = PaymentProcessCoordinatorProxy.messages.in; sourceTree = "<group>"; }; >+ 395CDC5321BB33A600766E4D /* PaymentProcessCoordinator.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = PaymentProcessCoordinator.messages.in; sourceTree = "<group>"; }; >+ 395CDC5E21BB453300766E4D /* PaymentProcessCoordinatorProxyMessages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PaymentProcessCoordinatorProxyMessages.h; path = DerivedSources/WebKit2/PaymentProcessCoordinatorProxyMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 395CDC6021BB46CD00766E4D /* PaymentProcessCoordinatorMessages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PaymentProcessCoordinatorMessages.h; path = DerivedSources/WebKit2/PaymentProcessCoordinatorMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 395CDC6221BB5E1B00766E4D /* PaymentProcessCoordinatorProxyMessageReceiver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = PaymentProcessCoordinatorProxyMessageReceiver.cpp; path = DerivedSources/WebKit2/PaymentProcessCoordinatorProxyMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 395CDC6321BB5E2C00766E4D /* PaymentProcessCoordinatorMessageReceiver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = PaymentProcessCoordinatorMessageReceiver.cpp; path = DerivedSources/WebKit2/PaymentProcessCoordinatorMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 395CDC6721C19FE000766E4D /* WebToPaymentProcessConnection.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = WebToPaymentProcessConnection.messages.in; sourceTree = "<group>"; }; >+ 395CDC6821C1DDC900766E4D /* PaymentProcessCoordinatorProxyIOS.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PaymentProcessCoordinatorProxyIOS.mm; sourceTree = "<group>"; }; >+ 395CDC6921C1DDD400766E4D /* PaymentProcessCoordinatorProxyCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PaymentProcessCoordinatorProxyCocoa.mm; sourceTree = "<group>"; }; >+ 395CDC6A21C1DDE200766E4D /* PaymentProcessCoordinatorProxyCocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentProcessCoordinatorProxyCocoa.h; sourceTree = "<group>"; }; >+ 39BD0AF521AE202E00E3243F /* Info-iOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Info-iOS.plist"; sourceTree = "<group>"; }; >+ 39BD0AF621AE202E00E3243F /* PaymentServiceEntryPoint.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PaymentServiceEntryPoint.mm; sourceTree = "<group>"; }; >+ 39BD0AFA21AF412A00E3243F /* WebToPaymentProcessConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebToPaymentProcessConnection.h; sourceTree = "<group>"; }; >+ 39BD0AFB21AF412A00E3243F /* WebToPaymentProcessConnection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebToPaymentProcessConnection.cpp; sourceTree = "<group>"; }; >+ 39E9ECA221B75ED700BA5F19 /* com.apple.WebKit.Payments.xpc */ = {isa = PBXFileReference; explicitFileType = "wrapper.xpc-service"; includeInIndex = 0; path = com.apple.WebKit.Payments.xpc; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 39E9ECA421B7688C00BA5F19 /* Payments-iOS-minimalsimulator.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = "Payments-iOS-minimalsimulator.entitlements"; sourceTree = "<group>"; }; >+ 39E9ECA521B7688C00BA5F19 /* Payments-iOS.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = "Payments-iOS.entitlements"; sourceTree = "<group>"; }; > 3F418EF51887BD97002795FD /* VideoFullscreenManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VideoFullscreenManagerMessageReceiver.cpp; path = DerivedSources/WebKit2/VideoFullscreenManagerMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; > 3F418EF61887BD97002795FD /* VideoFullscreenManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VideoFullscreenManagerMessages.h; path = DerivedSources/WebKit2/VideoFullscreenManagerMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; > 3F418EF71887BD97002795FD /* VideoFullscreenManagerProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VideoFullscreenManagerProxyMessageReceiver.cpp; path = DerivedSources/WebKit2/VideoFullscreenManagerProxyMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; >@@ -3111,6 +3173,7 @@ > 4F601430155C5A32001FBDE0 /* BlockingResponseMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockingResponseMap.h; sourceTree = "<group>"; }; > 510031F61379CACB00C8DFE4 /* SecItemShim.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = SecItemShim.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; > 51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuClientMac.mm; sourceTree = "<group>"; }; >+ 51032F1A180F74F100961BB7 /* PaymentToWebProcessConnection.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = PaymentToWebProcessConnection.messages.in; sourceTree = "<group>"; }; > 5104F5A11F19D7CF004CF821 /* CookieStorageUtilsCF.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CookieStorageUtilsCF.mm; sourceTree = "<group>"; }; > 510523711C73D22B007993CB /* WebIDBConnectionToServer.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebIDBConnectionToServer.messages.in; sourceTree = "<group>"; }; > 510523721C73D37B007993CB /* WebIDBConnectionToServerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebIDBConnectionToServerMessageReceiver.cpp; path = DerivedSources/WebKit2/WebIDBConnectionToServerMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; >@@ -3133,12 +3196,12 @@ > 510FBB991288C95E00AFFDF4 /* WebContextMenuItemData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenuItemData.h; sourceTree = "<group>"; }; > 5110AE0A133C16CB0072717A /* WKIconDatabase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKIconDatabase.cpp; sourceTree = "<group>"; }; > 5110AE0B133C16CB0072717A /* WKIconDatabase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKIconDatabase.h; sourceTree = "<group>"; }; >- 5118E9A21F295963003EF9F5 /* StorageProcessProxyMessages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StorageProcessProxyMessages.h; path = DerivedSources/WebKit2/StorageProcessProxyMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 5118E9A21F295963003EF9F5 /* PaymentProcessProxyMessages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentProcessProxyMessages.h; sourceTree = "<group>"; }; > 5118E9A31F295963003EF9F5 /* StorageToWebProcessConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = StorageToWebProcessConnectionMessageReceiver.cpp; path = DerivedSources/WebKit2/StorageToWebProcessConnectionMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; > 5118E9A41F295963003EF9F5 /* StorageToWebProcessConnectionMessages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StorageToWebProcessConnectionMessages.h; path = DerivedSources/WebKit2/StorageToWebProcessConnectionMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; >- 5118E9A51F295963003EF9F5 /* StorageProcessMessageReceiver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = StorageProcessMessageReceiver.cpp; path = DerivedSources/WebKit2/StorageProcessMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; >- 5118E9A61F295963003EF9F5 /* StorageProcessMessages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StorageProcessMessages.h; path = DerivedSources/WebKit2/StorageProcessMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; >- 5118E9A71F295963003EF9F5 /* StorageProcessProxyMessageReceiver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = StorageProcessProxyMessageReceiver.cpp; path = DerivedSources/WebKit2/StorageProcessProxyMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 5118E9A51F295963003EF9F5 /* PaymentProcessMessageReceiver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentProcessMessageReceiver.cpp; sourceTree = "<group>"; }; >+ 5118E9A61F295963003EF9F5 /* PaymentProcessMessages.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentProcessMessages.h; sourceTree = "<group>"; }; >+ 5118E9A71F295963003EF9F5 /* PaymentProcessProxyMessageReceiver.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentProcessProxyMessageReceiver.cpp; sourceTree = "<group>"; }; > 511F7D3F1EB1BCEE00E47B83 /* WebsiteDataStoreParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebsiteDataStoreParameters.cpp; sourceTree = "<group>"; }; > 511F7D401EB1BCEE00E47B83 /* WebsiteDataStoreParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebsiteDataStoreParameters.h; sourceTree = "<group>"; }; > 511F8A77138B460900A95F44 /* SecItemShimLibrary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SecItemShimLibrary.h; path = ../../WebProcess/mac/SecItemShimLibrary.h; sourceTree = "<group>"; }; >@@ -3156,6 +3219,7 @@ > 512935D61288D19400A4B695 /* WebContextMenuItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenuItem.h; sourceTree = "<group>"; }; > 512935E11288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageContextMenuClient.cpp; sourceTree = "<group>"; }; > 512935E21288D97800A4B695 /* InjectedBundlePageContextMenuClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageContextMenuClient.h; sourceTree = "<group>"; }; >+ 512A9766180E05D20039A149 /* PaymentProcessProxy.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = PaymentProcessProxy.messages.in; sourceTree = "<group>"; }; > 512F588E12A8838800629530 /* AuthenticationChallengeProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationChallengeProxy.cpp; sourceTree = "<group>"; }; > 512F588F12A8838800629530 /* AuthenticationChallengeProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallengeProxy.h; sourceTree = "<group>"; }; > 512F589012A8838800629530 /* AuthenticationDecisionListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationDecisionListener.cpp; sourceTree = "<group>"; }; >@@ -3226,6 +3290,8 @@ > 517CF0E1163A486C00C2950E /* NetworkProcessConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkProcessConnectionMessageReceiver.cpp; path = DerivedSources/WebKit2/NetworkProcessConnectionMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; > 517CF0E1163A486C00C2950F /* CacheStorageEngineConnectionMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CacheStorageEngineConnectionMessageReceiver.cpp; path = DerivedSources/WebKit2/CacheStorageEngineConnectionMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; }; > 517CF0E2163A486C00C2950E /* NetworkProcessConnectionMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkProcessConnectionMessages.h; path = DerivedSources/WebKit2/NetworkProcessConnectionMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; >+ 517DD5BC180DA7D30081660B /* PaymentProcessProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentProcessProxy.cpp; sourceTree = "<group>"; }; >+ 517DD5BD180DA7D30081660B /* PaymentProcessProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PaymentProcessProxy.h; sourceTree = "<group>"; }; > 5183B3931379F85C00E8754E /* Shim.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Shim.xcconfig; sourceTree = "<group>"; }; > 51871B59127CB89D00F76232 /* WebContextMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextMenu.cpp; sourceTree = "<group>"; }; > 51871B5A127CB89D00F76232 /* WebContextMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextMenu.h; sourceTree = "<group>"; }; >@@ -3245,6 +3311,7 @@ > 51A55600128C6D92009ABCEC /* WKContextMenuItemTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKContextMenuItemTypes.h; sourceTree = "<group>"; }; > 51A5877E1D1C4CB9004BA9AF /* WebIDBResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebIDBResult.cpp; sourceTree = "<group>"; }; > 51A5877F1D1C4CB9004BA9AF /* WebIDBResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebIDBResult.h; sourceTree = "<group>"; }; >+ 51A60B29180CCD9000F3BF50 /* PaymentService.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = PaymentService.xcconfig; sourceTree = "<group>"; }; > 51A728DC1B1BAD2D00102EEE /* WKBundleNavigationActionPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundleNavigationActionPrivate.h; sourceTree = "<group>"; }; > 51A7F2F2125BF820008AEB1D /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = "<group>"; }; > 51A7F2F4125BF8D4008AEB1D /* Logging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Logging.cpp; sourceTree = "<group>"; }; >@@ -3304,6 +3371,11 @@ > 51DD9F2716367DA2001578E9 /* NetworkConnectionToWebProcessMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkConnectionToWebProcessMessages.h; path = DerivedSources/WebKit2/NetworkConnectionToWebProcessMessages.h; sourceTree = BUILT_PRODUCTS_DIR; }; > 51E351C8180F2CCC00E53BE9 /* IDBUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IDBUtilities.cpp; sourceTree = "<group>"; }; > 51E351C9180F2CCC00E53BE9 /* IDBUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IDBUtilities.h; sourceTree = "<group>"; }; >+ 51E351FA180F5D0B00E53BE9 /* PaymentProcess.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentProcess.cpp; sourceTree = "<group>"; }; >+ 51E351FB180F5D0B00E53BE9 /* PaymentProcess.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentProcess.h; sourceTree = "<group>"; }; >+ 51E351FC180F5D0B00E53BE9 /* PaymentProcess.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = PaymentProcess.messages.in; sourceTree = "<group>"; }; >+ 51E351FD180F5D0B00E53BE9 /* PaymentToWebProcessConnection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PaymentToWebProcessConnection.cpp; sourceTree = "<group>"; }; >+ 51E351FE180F5D0B00E53BE9 /* PaymentToWebProcessConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentToWebProcessConnection.h; sourceTree = "<group>"; }; > 51E399051D6F54C5009C8831 /* UIGamepadProviderCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = UIGamepadProviderCocoa.mm; sourceTree = "<group>"; }; > 51E6C15F1F29355100FD3437 /* ResourceLoadStatisticsPersistentStorageIOS.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = ResourceLoadStatisticsPersistentStorageIOS.mm; path = ios/ResourceLoadStatisticsPersistentStorageIOS.mm; sourceTree = "<group>"; }; > 51E6C1611F2935CD00FD3437 /* ResourceLoadStatisticsPersistentStorage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ResourceLoadStatisticsPersistentStorage.h; sourceTree = "<group>"; }; >@@ -4452,6 +4524,7 @@ > E1E552C316AE065E004ED653 /* SandboxInitializationParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SandboxInitializationParameters.h; sourceTree = "<group>"; }; > E1EE53DC11F8CF9F00CCBEE4 /* InjectedBundlePageEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageEditorClient.h; sourceTree = "<group>"; }; > E1EE53E611F8CFFB00CCBEE4 /* InjectedBundlePageEditorClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageEditorClient.cpp; sourceTree = "<group>"; }; >+ E1FEF39C190F791C00731658 /* PaymentProcessIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PaymentProcessIOS.mm; sourceTree = "<group>"; }; > E413F59B1AC1ADB600345360 /* NetworkCacheEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheEntry.h; sourceTree = "<group>"; }; > E413F59E1AC1AF9D00345360 /* NetworkCacheEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCacheEntry.cpp; sourceTree = "<group>"; }; > E42E060B1AA7440D00B11699 /* NetworkCacheIOChannel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheIOChannel.h; sourceTree = "<group>"; }; >@@ -4539,6 +4612,15 @@ > ); > runOnlyForDeploymentPostprocessing = 0; > }; >+ 39E9EC9821B75ED700BA5F19 /* Frameworks */ = { >+ isa = PBXFrameworksBuildPhase; >+ buildActionMask = 2147483647; >+ files = ( >+ 39E9EC9921B75ED700BA5F19 /* Foundation.framework in Frameworks */, >+ 39E9EC9A21B75ED700BA5F19 /* WebKit.framework in Frameworks */, >+ ); >+ runOnlyForDeploymentPostprocessing = 0; >+ }; > 510031EE1379CACB00C8DFE4 /* Frameworks */ = { > isa = PBXFrameworksBuildPhase; > buildActionMask = 2147483647; >@@ -4601,6 +4683,7 @@ > isa = PBXGroup; > children = ( > BC8283B116B4BF7700A278FE /* com.apple.WebKit.Networking.xpc */, >+ 39E9ECA221B75ED700BA5F19 /* com.apple.WebKit.Payments.xpc */, > BC8283F916B4FDDE00A278FE /* com.apple.WebKit.Plugin.32.xpc */, > BC82841F16B4FDF600A278FE /* com.apple.WebKit.Plugin.64.xpc */, > 372EBB462017E64300085064 /* com.apple.WebKit.WebContent.Development.xpc */, >@@ -4626,6 +4709,7 @@ > 1A1D2116191D995C0001619F /* postprocess-framework-headers.sh */, > BC2E6E74114196F000A63B1E /* Platform */, > 1AADDF4B10D82AF000D3D63D /* Shared */, >+ 51F7DC0A180CC41100212CA3 /* PaymentProcess */, > BC032DC310F438260058C15A /* UIProcess */, > BC032D5C10F436D50058C15A /* WebProcess */, > 510CC7DA16138E0100D03ED3 /* NetworkProcess */, >@@ -4831,6 +4915,9 @@ > 41D0FC7D20E43A5100076AE8 /* Network-OSX-sandbox.entitlements */, > 5C7ACFD1218DD8BD004CBB59 /* Network-OSX.entitlements */, > BC8283AB16B4BEAD00A278FE /* NetworkService.xcconfig */, >+ 39E9ECA421B7688C00BA5F19 /* Payments-iOS-minimalsimulator.entitlements */, >+ 39E9ECA521B7688C00BA5F19 /* Payments-iOS.entitlements */, >+ 51A60B29180CCD9000F3BF50 /* PaymentService.xcconfig */, > A1EDD2DB1884B96400BBFE98 /* PluginProcessShim.xcconfig */, > BC8283F216B4FC5300A278FE /* PluginService.32.xcconfig */, > BC8283F416B4FC5300A278FE /* PluginService.64.xcconfig */, >@@ -6284,6 +6371,52 @@ > path = Resources/mac; > sourceTree = "<group>"; > }; >+ 39BD0AF121AE202E00E3243F /* EntryPoint */ = { >+ isa = PBXGroup; >+ children = ( >+ 39BD0AF221AE202E00E3243F /* ios */, >+ ); >+ path = EntryPoint; >+ sourceTree = "<group>"; >+ }; >+ 39BD0AF221AE202E00E3243F /* ios */ = { >+ isa = PBXGroup; >+ children = ( >+ 39BD0AF321AE202E00E3243F /* XPCService */, >+ ); >+ path = ios; >+ sourceTree = "<group>"; >+ }; >+ 39BD0AF321AE202E00E3243F /* XPCService */ = { >+ isa = PBXGroup; >+ children = ( >+ 39BD0AF421AE202E00E3243F /* PaymentService */, >+ 39BD0AF621AE202E00E3243F /* PaymentServiceEntryPoint.mm */, >+ ); >+ path = XPCService; >+ sourceTree = "<group>"; >+ }; >+ 39BD0AF421AE202E00E3243F /* PaymentService */ = { >+ isa = PBXGroup; >+ children = ( >+ 39BD0AF521AE202E00E3243F /* Info-iOS.plist */, >+ ); >+ path = PaymentService; >+ sourceTree = "<group>"; >+ }; >+ 39BD0AF921AF412A00E3243F /* Payments */ = { >+ isa = PBXGroup; >+ children = ( >+ 395CDC4C21BA1FAD00766E4D /* PaymentProcessCoordinator.cpp */, >+ 395CDC4B21BA1FAD00766E4D /* PaymentProcessCoordinator.h */, >+ 395CDC5321BB33A600766E4D /* PaymentProcessCoordinator.messages.in */, >+ 39BD0AFB21AF412A00E3243F /* WebToPaymentProcessConnection.cpp */, >+ 39BD0AFA21AF412A00E3243F /* WebToPaymentProcessConnection.h */, >+ 395CDC6721C19FE000766E4D /* WebToPaymentProcessConnection.messages.in */, >+ ); >+ path = Payments; >+ sourceTree = "<group>"; >+ }; > 413075971DE84ED70039EC69 /* webrtc */ = { > isa = PBXGroup; > children = ( >@@ -6604,6 +6737,16 @@ > name = mac; > sourceTree = "<group>"; > }; >+ 517DD5BB180DA7C40081660B /* Payments */ = { >+ isa = PBXGroup; >+ children = ( >+ 517DD5BC180DA7D30081660B /* PaymentProcessProxy.cpp */, >+ 517DD5BD180DA7D30081660B /* PaymentProcessProxy.h */, >+ 512A9766180E05D20039A149 /* PaymentProcessProxy.messages.in */, >+ ); >+ path = Payments; >+ sourceTree = "<group>"; >+ }; > 518E8EF116B208F000E91429 /* Authentication */ = { > isa = PBXGroup; > children = ( >@@ -6660,6 +6803,27 @@ > path = ios; > sourceTree = "<group>"; > }; >+ 51F7DC0A180CC41100212CA3 /* PaymentProcess */ = { >+ isa = PBXGroup; >+ children = ( >+ 39BD0AF121AE202E00E3243F /* EntryPoint */, >+ E1FEF39B190F791C00731658 /* ios */, >+ 51E351FA180F5D0B00E53BE9 /* PaymentProcess.cpp */, >+ 51E351FB180F5D0B00E53BE9 /* PaymentProcess.h */, >+ 51E351FC180F5D0B00E53BE9 /* PaymentProcess.messages.in */, >+ 395CDC5021BB0B0600766E4D /* PaymentProcessCoordinatorProxy.cpp */, >+ 395CDC4F21BB0B0600766E4D /* PaymentProcessCoordinatorProxy.h */, >+ 395CDC5121BB30D700766E4D /* PaymentProcessCoordinatorProxy.messages.in */, >+ 395CDC6A21C1DDE200766E4D /* PaymentProcessCoordinatorProxyCocoa.h */, >+ 395CDC6921C1DDD400766E4D /* PaymentProcessCoordinatorProxyCocoa.mm */, >+ 395CDC6821C1DDC900766E4D /* PaymentProcessCoordinatorProxyIOS.mm */, >+ 51E351FD180F5D0B00E53BE9 /* PaymentToWebProcessConnection.cpp */, >+ 51E351FE180F5D0B00E53BE9 /* PaymentToWebProcessConnection.h */, >+ 51032F1A180F74F100961BB7 /* PaymentToWebProcessConnection.messages.in */, >+ ); >+ path = PaymentProcess; >+ sourceTree = "<group>"; >+ }; > 570AB8F620AE81AB00B8BE87 /* cocoa */ = { > isa = PBXGroup; > children = ( >@@ -7064,6 +7228,7 @@ > isa = PBXGroup; > children = ( > A78CCDD8193AC9E3005ECC25 /* com.apple.WebKit.Networking.sb */, >+ 391360242193C1430056492A /* com.apple.WebKit.Payments.sb */, > A78CCDD7193AC9E3005ECC25 /* com.apple.WebKit.Storage.sb */, > A78CCDD9193AC9E3005ECC25 /* com.apple.WebKit.WebContent.sb */, > ); >@@ -7112,6 +7277,7 @@ > 4A410F4119AF7B27002EBAB5 /* MediaStream */, > 5105B0D2162F7A5E00E27709 /* Network */, > 31099974146C8AA80029DEB9 /* Notifications (User) */, >+ 39BD0AF921AF412A00E3243F /* Payments */, > 1A6FB7AA11E64B4900DB1371 /* Plugins */, > 5118E9981F295259003EF9F5 /* Storage */, > 1AAF08AA1926930B00B6390C /* UserContent */, >@@ -7274,6 +7440,7 @@ > BCCF085C113F3B7500C650C5 /* mac */, > 510CC7E716138E7200D03ED3 /* Network */, > 31A2EC401489973700810D71 /* Notifications */, >+ 517DD5BB180DA7C40081660B /* Payments */, > 1AEFCC0511D01F34008219D3 /* Plugins */, > 2D1551A91F5A9B420006E3FE /* RemoteLayerTree */, > 1AAF089E192681AC00B6390C /* UserContent */, >@@ -8372,6 +8539,18 @@ > 5C0B17751E7C879C00E9123C /* NetworkSocketStreamMessages.h */, > 1A2D8437127F65D5001EB962 /* NPObjectMessageReceiverMessageReceiver.cpp */, > 1A2D8438127F65D5001EB962 /* NPObjectMessageReceiverMessages.h */, >+ 395CDC6321BB5E2C00766E4D /* PaymentProcessCoordinatorMessageReceiver.cpp */, >+ 395CDC6021BB46CD00766E4D /* PaymentProcessCoordinatorMessages.h */, >+ 395CDC6221BB5E1B00766E4D /* PaymentProcessCoordinatorProxyMessageReceiver.cpp */, >+ 395CDC5E21BB453300766E4D /* PaymentProcessCoordinatorProxyMessages.h */, >+ 5118E9A51F295963003EF9F5 /* PaymentProcessMessageReceiver.cpp */, >+ 5118E9A51F295963003EF9F5 /* PaymentProcessMessageReceiver.cpp */, >+ 5118E9A61F295963003EF9F5 /* PaymentProcessMessages.h */, >+ 5118E9A61F295963003EF9F5 /* PaymentProcessMessages.h */, >+ 5118E9A71F295963003EF9F5 /* PaymentProcessProxyMessageReceiver.cpp */, >+ 5118E9A71F295963003EF9F5 /* PaymentProcessProxyMessageReceiver.cpp */, >+ 5118E9A21F295963003EF9F5 /* PaymentProcessProxyMessages.h */, >+ 5118E9A21F295963003EF9F5 /* PaymentProcessProxyMessages.h */, > CDA29A241CBEB67A00901CCF /* PlaybackSessionManagerMessageReceiver.cpp */, > CDA29A251CBEB67A00901CCF /* PlaybackSessionManagerMessages.h */, > CDA29A261CBEB67A00901CCF /* PlaybackSessionManagerProxyMessageReceiver.cpp */, >@@ -8406,10 +8585,6 @@ > 1A334DEC16DE8F88006A8E38 /* StorageAreaMapMessages.h */, > 1AB31A9416BC688100F6DBC9 /* StorageManagerMessageReceiver.cpp */, > 1AB31A9516BC688100F6DBC9 /* StorageManagerMessages.h */, >- 5118E9A51F295963003EF9F5 /* StorageProcessMessageReceiver.cpp */, >- 5118E9A61F295963003EF9F5 /* StorageProcessMessages.h */, >- 5118E9A71F295963003EF9F5 /* StorageProcessProxyMessageReceiver.cpp */, >- 5118E9A21F295963003EF9F5 /* StorageProcessProxyMessages.h */, > 5118E9A31F295963003EF9F5 /* StorageToWebProcessConnectionMessageReceiver.cpp */, > 5118E9A41F295963003EF9F5 /* StorageToWebProcessConnectionMessages.h */, > CD491B0B1E732E4D00009066 /* UserMediaCaptureManagerMessageReceiver.cpp */, >@@ -8511,6 +8686,8 @@ > 517A52D61F43A9B600DCDC0A /* WebSWServerConnectionMessages.h */, > 515262BA1FB951310070E579 /* WebSWServerToContextConnectionMessageReceiver.cpp */, > 515262BB1FB951310070E579 /* WebSWServerToContextConnectionMessages.h */, >+ 393F259D21C8D44000E4CE85 /* WebToPaymentProcessConnectionMessageReceiver.cpp */, >+ 393F259E21C8D44100E4CE85 /* WebToPaymentProcessConnectionMessages.h */, > 1AAF08B519269E6D00B6390C /* WebUserContentControllerMessageReceiver.cpp */, > 1AAF08B619269E6D00B6390C /* WebUserContentControllerMessages.h */, > 7C361D76192803BD0036A59D /* WebUserContentControllerProxyMessageReceiver.cpp */, >@@ -8692,6 +8869,14 @@ > name = PDF; > sourceTree = "<group>"; > }; >+ E1FEF39B190F791C00731658 /* ios */ = { >+ isa = PBXGroup; >+ children = ( >+ E1FEF39C190F791C00731658 /* PaymentProcessIOS.mm */, >+ ); >+ path = ios; >+ sourceTree = "<group>"; >+ }; > E489D2821A0A2BE80078C06A /* cache */ = { > isa = PBXGroup; > children = ( >@@ -9156,6 +9341,11 @@ > 1AC7537C183A9FDB0072CB15 /* PageLoadState.h in Headers */, > 1A8B66B01BC43C860082DF77 /* PageLoadStateObserver.h in Headers */, > C574A58112E66681002DFE98 /* PasteboardTypes.h in Headers */, >+ 395CDC6121BB46D700766E4D /* PaymentProcessCoordinatorMessages.h in Headers */, >+ 395CDC5F21BB45D500766E4D /* PaymentProcessCoordinatorProxyMessages.h in Headers */, >+ 5118E9A91F295977003EF9F5 /* PaymentProcessMessages.h in Headers */, >+ 517DD5BF180DA7D30081660B /* PaymentProcessProxy.h in Headers */, >+ 5118E9AB1F295977003EF9F5 /* PaymentProcessProxyMessages.h in Headers */, > C1E123BA20A11573002646F4 /* PDFContextMenu.h in Headers */, > E19582D3153CBFD700B60875 /* PDFKitImports.h in Headers */, > 2D6BF12421AF56E1001E79C9 /* PencilKitSoftLink.h in Headers */, >@@ -9515,6 +9705,7 @@ > 9356F2DD2152B6F600E6D5DF /* WebSWServerConnection.h in Headers */, > 517A52D91F43A9DA00DCDC0A /* WebSWServerConnectionMessages.h in Headers */, > 515262BC1FB9515D0070E579 /* WebSWServerToContextConnectionMessages.h in Headers */, >+ 393F25A021C8D46800E4CE85 /* WebToPaymentProcessConnectionMessages.h in Headers */, > BCA0EF7F12331E78007D3CFB /* WebUndoStep.h in Headers */, > 1AAF08AE1926936700B6390C /* WebUserContentController.h in Headers */, > 7C065F2C1C8CD95F00C2D950 /* WebUserContentControllerDataTypes.h in Headers */, >@@ -9951,6 +10142,28 @@ > productReference = 372EBB462017E64300085064 /* com.apple.WebKit.WebContent.Development.xpc */; > productType = "com.apple.product-type.xpc-service"; > }; >+ 39E9EC9021B75ED700BA5F19 /* Payments */ = { >+ isa = PBXNativeTarget; >+ buildConfigurationList = 39E9EC9E21B75ED700BA5F19 /* Build configuration list for PBXNativeTarget "Payments" */; >+ buildPhases = ( >+ 39E9EC9521B75ED700BA5F19 /* Remove stale entitlements file */, >+ 39E9EC9621B75ED700BA5F19 /* Sources */, >+ 39E9EC9821B75ED700BA5F19 /* Frameworks */, >+ 39E9EC9B21B75ED700BA5F19 /* Resources */, >+ 39E9EC9C21B75ED700BA5F19 /* Unlock keychain */, >+ 39E9EC9D21B75ED700BA5F19 /* Process Payment entitlements */, >+ ); >+ buildRules = ( >+ ); >+ dependencies = ( >+ 39E9EC9121B75ED700BA5F19 /* PBXTargetDependency */, >+ 39E9EC9321B75ED700BA5F19 /* PBXTargetDependency */, >+ ); >+ name = Payments; >+ productName = Payments; >+ productReference = 39E9ECA221B75ED700BA5F19 /* com.apple.WebKit.Payments.xpc */; >+ productType = "com.apple.product-type.xpc-service"; >+ }; > 510031EA1379CACB00C8DFE4 /* SecItemShim */ = { > isa = PBXNativeTarget; > buildConfigurationList = 510031F21379CACB00C8DFE4 /* Build configuration list for PBXNativeTarget "SecItemShim" */; >@@ -10131,6 +10344,7 @@ > BC3DE46515A91763008D26FC /* WebContent */, > 372EBB382017E64300085064 /* WebContent.Development */, > BC8283B016B4BF7700A278FE /* Networking */, >+ 39E9EC9021B75ED700BA5F19 /* Payments */, > BC8283F816B4FDDE00A278FE /* Plugin.32 */, > BC82841E16B4FDF600A278FE /* Plugin.64 */, > A7AADA1019395CA9003EA1C7 /* Sandbox Profiles */, >@@ -10148,6 +10362,13 @@ > ); > runOnlyForDeploymentPostprocessing = 0; > }; >+ 39E9EC9B21B75ED700BA5F19 /* Resources */ = { >+ isa = PBXResourcesBuildPhase; >+ buildActionMask = 2147483647; >+ files = ( >+ ); >+ runOnlyForDeploymentPostprocessing = 0; >+ }; > 8DC2EF520486A6940098B216 /* Resources */ = { > isa = PBXResourcesBuildPhase; > buildActionMask = 2147483647; >@@ -10378,6 +10599,49 @@ > shellPath = /bin/sh; > shellScript = "if [[ \"${WK_MANUAL_SANDBOXING_ENABLED}\" != \"YES\" || \"${WK_PLATFORM_NAME}\" == \"macosx\" || \"${WK_PLATFORM_NAME}\" == \"iosmac\" ]]; then\n exit\nfi\n\nif [[ \"${ACTION}\" == \"build\" || \"${ACTION}\" == \"install\" ]]; then\n for ((i = 0; i < ${SCRIPT_INPUT_FILE_COUNT}; ++i)); do\n eval SANDBOX_PROFILE=\\${SCRIPT_INPUT_FILE_${i}}\n ditto \"${SANDBOX_PROFILE}\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/${SANDBOX_PROFILE##*/}\"\n done\nfi\n"; > }; >+ 39E9EC9521B75ED700BA5F19 /* Remove stale entitlements file */ = { >+ isa = PBXShellScriptBuildPhase; >+ buildActionMask = 2147483647; >+ files = ( >+ ); >+ inputPaths = ( >+ ); >+ name = "Remove stale entitlements file"; >+ outputPaths = ( >+ ); >+ runOnlyForDeploymentPostprocessing = 0; >+ shellPath = /bin/sh; >+ shellScript = "# We autogenerate this file, so don't want to retain an old copy during builds.\nrm -f ${TEMP_FILE_DIR}/${FULL_PRODUCT_NAME}.xcent\n"; >+ }; >+ 39E9EC9C21B75ED700BA5F19 /* Unlock keychain */ = { >+ isa = PBXShellScriptBuildPhase; >+ buildActionMask = 2147483647; >+ files = ( >+ ); >+ inputPaths = ( >+ ); >+ name = "Unlock keychain"; >+ outputPaths = ( >+ ); >+ runOnlyForDeploymentPostprocessing = 0; >+ shellPath = /bin/sh; >+ shellScript = "UNLOCK_SCRIPT_PATH=\"${SRCROOT}/../../../Internal/Tools/Scripts/unlock-safari-engineering-keychain-if-needed\"\n\n[[ -x \"${UNLOCK_SCRIPT_PATH}\" ]] && exec \"${UNLOCK_SCRIPT_PATH}\"\n\nexit 0\n"; >+ }; >+ 39E9EC9D21B75ED700BA5F19 /* Process Payment entitlements */ = { >+ isa = PBXShellScriptBuildPhase; >+ buildActionMask = 2147483647; >+ files = ( >+ ); >+ inputPaths = ( >+ ); >+ name = "Process Payment entitlements"; >+ outputPaths = ( >+ ); >+ runOnlyForDeploymentPostprocessing = 0; >+ shellPath = /bin/sh; >+ shellScript = " >+"; >+ }; > 4157853721279CC600DD3800 /* Copy Custom WebContent Resources to Framework Private Headers */ = { > isa = PBXShellScriptBuildPhase; > buildActionMask = 2147483647; >@@ -10630,6 +10894,7 @@ > "$(BUILT_PRODUCTS_DIR)/com.apple.WebKit.Plugin.64.xpc", > "$(BUILT_PRODUCTS_DIR)/$(WK_STORAGE_SERVICE_PRODUCT_NAME).xpc", > "$(BUILT_PRODUCTS_DIR)/com.apple.WebKit.WebContent.Development.xpc", >+ "$(BUILT_PRODUCTS_DIR)/com.apple.WebKit.Payments.xpc", > ); > name = "Copy XPC services for engineering builds"; > outputPaths = ( >@@ -10639,10 +10904,11 @@ > "$(BUILT_PRODUCTS_DIR)/WebKit.framework/XPCServices/com.apple.WebKit.Plugin.64.xpc", > "$(BUILT_PRODUCTS_DIR)/WebKit.framework/XPCServices/$(WK_STORAGE_SERVICE_PRODUCT_NAME).xpc", > "$(BUILT_PRODUCTS_DIR)/WebKit.framework/XPCServices/com.apple.WebKit.WebContent.Development.xpc", >+ "$(BUILT_PRODUCTS_DIR)/WebKit.framework/XPCServices/com.apple.WebKit.Payments.xpc", > ); > runOnlyForDeploymentPostprocessing = 0; > shellPath = /bin/sh; >- shellScript = "if [[ \"${CONFIGURATION}\" == \"Production\" ]]; then\n exit\nfi\n\nif [[ ${WK_PLATFORM_NAME} != \"macosx\" ]]; then\n XPC_SERVICES_PATH=\"${BUILT_PRODUCTS_DIR}/WebKit.framework/XPCServices\"\nelse\n XPC_SERVICES_PATH=\"${BUILT_PRODUCTS_DIR}/WebKit.framework/Versions/A/XPCServices\"\nfi\n\nmkdir -p \"${XPC_SERVICES_PATH}\"\nditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.WebContent.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.WebContent.xpc\"\nditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.Networking.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Networking.xpc\"\nditto \"${BUILT_PRODUCTS_DIR}/${WK_STORAGE_SERVICE_PRODUCT_NAME}.xpc\" \"${XPC_SERVICES_PATH}/${WK_STORAGE_SERVICE_PRODUCT_NAME}.xpc\"\n\nif [[ ${WK_PLATFORM_NAME} == macosx ]]; then\n ditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.Plugin.32.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Plugin.xpc\"\n ditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.Plugin.64.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Plugin.64.xpc\"\nfi\n"; >+ shellScript = "if [[ \"${CONFIGURATION}\" == \"Production\" ]]; then\n exit\nfi\n\nif [[ ${WK_PLATFORM_NAME} != \"macosx\" ]]; then\n XPC_SERVICES_PATH=\"${BUILT_PRODUCTS_DIR}/WebKit.framework/XPCServices\"\nelse\n XPC_SERVICES_PATH=\"${BUILT_PRODUCTS_DIR}/WebKit.framework/Versions/A/XPCServices\"\nfi\nmkdir -p \"${XPC_SERVICES_PATH}\"\nditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.WebContent.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.WebContent.xpc\"\nditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.Networking.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Networking.xpc\"\nditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.Payments.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Payments.xpc\"\n\nditto \"${BUILT_PRODUCTS_DIR}/${WK_STORAGE_SERVICE_PRODUCT_NAME}.xpc\" \"${XPC_SERVICES_PATH}/${WK_STORAGE_SERVICE_PRODUCT_NAME}.xpc\"\n\nif [[ ${WK_PLATFORM_NAME} == macosx ]]; then\n ditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.Plugin.32.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Plugin.xpc\"\n ditto \"${BUILT_PRODUCTS_DIR}/com.apple.WebKit.Plugin.64.xpc\" \"${XPC_SERVICES_PATH}/com.apple.WebKit.Plugin.64.xpc\"\nfi\n"; > }; > C0CE72841247E66800BC0EC4 /* Generate Derived Sources */ = { > isa = PBXShellScriptBuildPhase; >@@ -10691,6 +10957,14 @@ > ); > runOnlyForDeploymentPostprocessing = 0; > }; >+ 39E9EC9621B75ED700BA5F19 /* Sources */ = { >+ isa = PBXSourcesBuildPhase; >+ buildActionMask = 2147483647; >+ files = ( >+ 39E9EC9721B75ED700BA5F19 /* XPCServiceMain.mm in Sources */, >+ ); >+ runOnlyForDeploymentPostprocessing = 0; >+ }; > 510031EC1379CACB00C8DFE4 /* Sources */ = { > isa = PBXSourcesBuildPhase; > buildActionMask = 2147483647; >@@ -10759,6 +11033,10 @@ > 2D913447212CF9F000128AFD /* NPRuntimeObjectMap.cpp in Sources */, > 2D913448212CF9F000128AFD /* NPRuntimeUtilities.cpp in Sources */, > 2D92A794212B6AD400F493FD /* NPVariantData.cpp in Sources */, >+ 395CDC6421BB5E4E00766E4D /* PaymentProcessCoordinatorMessageReceiver.cpp in Sources */, >+ 395CDC6521BB5E5100766E4D /* PaymentProcessCoordinatorProxyMessageReceiver.cpp in Sources */, >+ 395CDC6E21C47C5E00766E4D /* PaymentProcessMessageReceiver.cpp in Sources */, >+ 395CDC6D21C47B6800766E4D /* PaymentProcessProxyMessageReceiver.cpp in Sources */, > CDA29A281CBEB67A00901CCF /* PlaybackSessionManagerMessageReceiver.cpp in Sources */, > CDA29A2A1CBEB67A00901CCF /* PlaybackSessionManagerProxyMessageReceiver.cpp in Sources */, > 2D913449212CF9F000128AFD /* Plugin.cpp in Sources */, >@@ -11042,6 +11320,7 @@ > 517A52D81F43A9DA00DCDC0A /* WebSWServerConnectionMessageReceiver.cpp in Sources */, > 9356F2E02152B75200E6D5DF /* WebSWServerToContextConnection.cpp in Sources */, > 515262BD1FB951610070E579 /* WebSWServerToContextConnectionMessageReceiver.cpp in Sources */, >+ 393F259F21C8D46500E4CE85 /* WebToPaymentProcessConnectionMessageReceiver.cpp in Sources */, > 2D92A78E212B6AB100F493FD /* WebTouchEvent.cpp in Sources */, > 1AAF08B719269E6D00B6390C /* WebUserContentControllerMessageReceiver.cpp in Sources */, > 7C361D78192803BD0036A59D /* WebUserContentControllerProxyMessageReceiver.cpp in Sources */, >@@ -11140,6 +11419,21 @@ > target = C0CE72851247E66800BC0EC4 /* Derived Sources */; > targetProxy = 37F7407812721F740093869B /* PBXContainerItemProxy */; > }; >+ 39E9EC9121B75ED700BA5F19 /* PBXTargetDependency */ = { >+ isa = PBXTargetDependency; >+ target = E1AC2E2720F7B94C00B0897D /* Unlock Keychain */; >+ targetProxy = 39E9EC9221B75ED700BA5F19 /* PBXContainerItemProxy */; >+ }; >+ 39E9EC9321B75ED700BA5F19 /* PBXTargetDependency */ = { >+ isa = PBXTargetDependency; >+ target = 8DC2EF4F0486A6940098B216 /* WebKit */; >+ targetProxy = 39E9EC9421B75ED700BA5F19 /* PBXContainerItemProxy */; >+ }; >+ 39E9ECA921B8764200BA5F19 /* PBXTargetDependency */ = { >+ isa = PBXTargetDependency; >+ target = 39E9EC9021B75ED700BA5F19 /* Payments */; >+ targetProxy = 39E9ECA821B8764200BA5F19 /* PBXContainerItemProxy */; >+ }; > BC77F95616D0459100F8F78A /* PBXTargetDependency */ = { > isa = PBXTargetDependency; > target = BC8283F816B4FDDE00A278FE /* Plugin.32 */; >@@ -11334,6 +11628,63 @@ > }; > name = Production; > }; >+ 39E9EC9F21B75ED700BA5F19 /* Debug */ = { >+ isa = XCBuildConfiguration; >+ baseConfigurationReference = 51A60B29180CCD9000F3BF50 /* PaymentService.xcconfig */; >+ buildSettings = { >+ CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO = "Configurations/Payments-iOS.entitlements"; >+ INFOPLIST_FILE = "PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist"; >+ "INFOPLIST_FILE[sdk=iphone*]" = "PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist"; >+ "INFOPLIST_FILE[sdk=macosx*]" = "PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist"; >+ PRODUCT_BUNDLE_IDENTIFIER = com.apple.WebKit.Payments; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_appletvos = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_appletvsimulator = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_iosmac = "Payments-iOS-minimalsimulator"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_iphoneos = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_iphonesimulator = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_watchos = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_watchsimulator = "Payments-iOS"; >+ }; >+ name = Debug; >+ }; >+ 39E9ECA021B75ED700BA5F19 /* Release */ = { >+ isa = XCBuildConfiguration; >+ baseConfigurationReference = 51A60B29180CCD9000F3BF50 /* PaymentService.xcconfig */; >+ buildSettings = { >+ CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO = "Configurations/Payments-iOS.entitlements"; >+ INFOPLIST_FILE = "PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist"; >+ "INFOPLIST_FILE[sdk=iphone*]" = "PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist"; >+ "INFOPLIST_FILE[sdk=macosx*]" = "PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist"; >+ PRODUCT_BUNDLE_IDENTIFIER = com.apple.WebKit.Payments; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_appletvos = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_appletvsimulator = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_iosmac = "Payments-iOS-minimalsimulator"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_iphoneos = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_iphonesimulator = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_watchos = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_watchsimulator = "Payments-iOS"; >+ }; >+ name = Release; >+ }; >+ 39E9ECA121B75ED700BA5F19 /* Production */ = { >+ isa = XCBuildConfiguration; >+ baseConfigurationReference = 51A60B29180CCD9000F3BF50 /* PaymentService.xcconfig */; >+ buildSettings = { >+ CODE_SIGN_ENTITLEMENTS_COCOA_TOUCH_NO = "Configurations/Payments-iOS.entitlements"; >+ INFOPLIST_FILE = "PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist"; >+ "INFOPLIST_FILE[sdk=iphone*]" = "PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist"; >+ "INFOPLIST_FILE[sdk=macosx*]" = "PaymentProcess/EntryPoint/ios/XPCService/PaymentService/Info-iOS.plist"; >+ PRODUCT_BUNDLE_IDENTIFIER = com.apple.WebKit.Payments; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_appletvos = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_appletvsimulator = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_iosmac = "Payments-iOS-minimalsimulator"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_iphoneos = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_iphonesimulator = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_watchos = "Payments-iOS"; >+ WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE_watchsimulator = "Payments-iOS"; >+ }; >+ name = Production; >+ }; > 510031F31379CACB00C8DFE4 /* Debug */ = { > isa = XCBuildConfiguration; > baseConfigurationReference = A1EDD2DC1884B9B500BBFE98 /* SecItemShim.xcconfig */; >@@ -11605,6 +11956,16 @@ > defaultConfigurationIsVisible = 0; > defaultConfigurationName = Production; > }; >+ 39E9EC9E21B75ED700BA5F19 /* Build configuration list for PBXNativeTarget "Payments" */ = { >+ isa = XCConfigurationList; >+ buildConfigurations = ( >+ 39E9EC9F21B75ED700BA5F19 /* Debug */, >+ 39E9ECA021B75ED700BA5F19 /* Release */, >+ 39E9ECA121B75ED700BA5F19 /* Production */, >+ ); >+ defaultConfigurationIsVisible = 0; >+ defaultConfigurationName = Production; >+ }; > 510031F21379CACB00C8DFE4 /* Build configuration list for PBXNativeTarget "SecItemShim" */ = { > isa = XCConfigurationList; > buildConfigurations = ( >diff --git a/Source/WebKit/WebProcess/Payments/PaymentProcessCoordinator.cpp b/Source/WebKit/WebProcess/Payments/PaymentProcessCoordinator.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..e1bda6bebecef01487cf8bdeb396a73aba4a4ebc >--- /dev/null >+++ b/Source/WebKit/WebProcess/Payments/PaymentProcessCoordinator.cpp >@@ -0,0 +1,237 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "PaymentProcessCoordinator.h" >+ >+#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_PROCESS) >+ >+#include "DataReference.h" >+#include "PaymentProcessCoordinatorMessages.h" >+#include "PaymentProcessCoordinatorProxyMessages.h" >+#include "WebCoreArgumentCoders.h" >+#include "WebPage.h" >+#include "WebProcess.h" >+#include "WebToPaymentProcessConnection.h" >+#include <WebCore/Frame.h> >+#include <WebCore/PaymentCoordinator.h> >+#include <WebCore/URL.h> >+ >+namespace WebKit { >+ >+PaymentProcessCoordinator::PaymentProcessCoordinator(WebPage& webPage) >+ : m_webPage(webPage) >+{ >+ WebProcess::singleton().addMessageReceiver(Messages::PaymentProcessCoordinator::messageReceiverName(), m_webPage.pageID(), *this); >+} >+ >+PaymentProcessCoordinator::~PaymentProcessCoordinator() >+{ >+ WebProcess::singleton().removeMessageReceiver(*this); >+} >+ >+bool PaymentProcessCoordinator::supportsVersion(unsigned version) >+{ >+ ASSERT(version > 0); >+ >+#if !ENABLE(APPLE_PAY_SESSION_V3) >+ static const unsigned currentVersion = 2; >+#elif !ENABLE(APPLE_PAY_SESSION_V4) >+ static const unsigned currentVersion = 3; >+#else >+ static const unsigned currentVersion = 5; >+#endif >+ >+ return version <= currentVersion; >+} >+ >+const PaymentProcessCoordinator::AvailablePaymentNetworksSet& PaymentProcessCoordinator::availablePaymentNetworks() >+{ >+ if (m_availablePaymentNetworks) >+ return *m_availablePaymentNetworks; >+ >+ m_availablePaymentNetworks = PaymentProcessCoordinator::AvailablePaymentNetworksSet(); >+ >+ Vector<String> availablePaymentNetworks; >+ using AvailablePaymentNetworksMessage = Messages::PaymentProcessCoordinatorProxy::AvailablePaymentNetworks; >+ if (WebProcess::singleton().ensureWebToPaymentProcessConnection().connection().sendSync(AvailablePaymentNetworksMessage(), AvailablePaymentNetworksMessage::Reply(availablePaymentNetworks), 0)) { >+ for (auto& network : availablePaymentNetworks) >+ m_availablePaymentNetworks->add(network); >+ } >+ >+ return *m_availablePaymentNetworks; >+} >+ >+std::optional<String> PaymentProcessCoordinator::validatedPaymentNetwork(const String& paymentNetwork) >+{ >+ auto& paymentNetworks = availablePaymentNetworks(); >+ auto result = paymentNetworks.find(paymentNetwork); >+ if (result == paymentNetworks.end()) >+ return std::nullopt; >+ return *result; >+} >+ >+bool PaymentProcessCoordinator::canMakePayments() >+{ >+ bool canMakePayments; >+ if (!WebProcess::singleton().ensureWebToPaymentProcessConnection().connection().sendSync(Messages::PaymentProcessCoordinatorProxy::CanMakePayments(), Messages::PaymentProcessCoordinatorProxy::CanMakePayments::Reply(canMakePayments), 0)) >+ return false; >+ >+ return canMakePayments; >+} >+ >+static uint64_t generateCanMakePaymentsWithActiveCardReplyID() >+{ >+ static uint64_t canMakePaymentsWithActiveCardReplyID; >+ >+ return ++canMakePaymentsWithActiveCardReplyID; >+} >+ >+void PaymentProcessCoordinator::canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler) >+{ >+ auto replyID = generateCanMakePaymentsWithActiveCardReplyID(); >+ >+ m_pendingCanMakePaymentsWithActiveCardCallbacks.add(replyID, WTFMove(completionHandler)); >+ WebProcess::singleton().ensureWebToPaymentProcessConnection().connection().send(Messages::PaymentProcessCoordinatorProxy::CanMakePaymentsWithActiveCard(merchantIdentifier, domainName, replyID), 0); >+} >+ >+static uint64_t generateOpenPaymentSetupReplyID() >+{ >+ static uint64_t openPaymentSetupReplyID; >+ >+ return ++openPaymentSetupReplyID; >+} >+ >+void PaymentProcessCoordinator::openPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler) >+{ >+ auto replyID = generateOpenPaymentSetupReplyID(); >+ >+ m_pendingOpenPaymentSetupCallbacks.add(replyID, WTFMove(completionHandler)); >+ WebProcess::singleton().ensureWebToPaymentProcessConnection().connection().send(Messages::PaymentProcessCoordinatorProxy::OpenPaymentSetup(merchantIdentifier, domainName, replyID), 0); >+} >+ >+bool PaymentProcessCoordinator::showPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest& paymentRequest) >+{ >+ Vector<String> linkIconURLStrings; >+ for (const auto& linkIconURL : linkIconURLs) >+ linkIconURLStrings.append(linkIconURL.string()); >+ >+ bool result; >+ if (!WebProcess::singleton().ensureWebToPaymentProcessConnection().connection().sendSync(Messages::PaymentProcessCoordinatorProxy::ShowPaymentUI(originatingURL.string(), linkIconURLStrings, paymentRequest), Messages::PaymentProcessCoordinatorProxy::ShowPaymentUI::Reply(result), 0)) >+ return false; >+ >+ return result; >+} >+ >+void PaymentProcessCoordinator::completeMerchantValidation(const WebCore::PaymentMerchantSession& paymentMerchantSession) >+{ >+ WebProcess::singleton().ensureWebToPaymentProcessConnection().connection().send(Messages::PaymentProcessCoordinatorProxy::CompleteMerchantValidation(paymentMerchantSession), 0); >+} >+ >+void PaymentProcessCoordinator::completeShippingMethodSelection(std::optional<WebCore::ShippingMethodUpdate>&& update) >+{ >+ WebProcess::singleton().ensureWebToPaymentProcessConnection().connection().send(Messages::PaymentProcessCoordinatorProxy::CompleteShippingMethodSelection(update), 0); >+} >+ >+void PaymentProcessCoordinator::completeShippingContactSelection(std::optional<WebCore::ShippingContactUpdate>&& update) >+{ >+ WebProcess::singleton().ensureWebToPaymentProcessConnection().connection().send(Messages::PaymentProcessCoordinatorProxy::CompleteShippingContactSelection(update), 0); >+} >+ >+void PaymentProcessCoordinator::completePaymentMethodSelection(std::optional<WebCore::PaymentMethodUpdate>&& update) >+{ >+ WebProcess::singleton().ensureWebToPaymentProcessConnection().connection().send(Messages::PaymentProcessCoordinatorProxy::CompletePaymentMethodSelection(update), 0); >+} >+ >+void PaymentProcessCoordinator::completePaymentSession(std::optional<WebCore::PaymentAuthorizationResult>&& result) >+{ >+ WebProcess::singleton().ensureWebToPaymentProcessConnection().connection().send(Messages::PaymentProcessCoordinatorProxy::CompletePaymentSession(result), 0); >+} >+ >+void PaymentProcessCoordinator::abortPaymentSession() >+{ >+ WebProcess::singleton().ensureWebToPaymentProcessConnection().connection().send(Messages::PaymentProcessCoordinatorProxy::AbortPaymentSession(), 0); >+} >+ >+void PaymentProcessCoordinator::cancelPaymentSession() >+{ >+ WebProcess::singleton().ensureWebToPaymentProcessConnection().connection().send(Messages::PaymentProcessCoordinatorProxy::CancelPaymentSession(), 0); >+} >+ >+void PaymentProcessCoordinator::paymentCoordinatorDestroyed() >+{ >+ delete this; >+} >+ >+void PaymentProcessCoordinator::validateMerchant(const String& validationURLString) >+{ >+ paymentProcessCoordinator().validateMerchant(WebCore::URL(WebCore::URL(), validationURLString)); >+} >+ >+void PaymentProcessCoordinator::didAuthorizePayment(const WebCore::Payment& payment) >+{ >+ paymentProcessCoordinator().didAuthorizePayment(payment); >+} >+ >+void PaymentProcessCoordinator::didSelectShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod& shippingMethod) >+{ >+ paymentProcessCoordinator().didSelectShippingMethod(shippingMethod); >+} >+ >+void PaymentProcessCoordinator::didSelectShippingContact(const WebCore::PaymentContact& shippingContact) >+{ >+ paymentProcessCoordinator().didSelectShippingContact(shippingContact); >+} >+ >+void PaymentProcessCoordinator::didSelectPaymentMethod(const WebCore::PaymentMethod& paymentMethod) >+{ >+ paymentProcessCoordinator().didSelectPaymentMethod(paymentMethod); >+} >+ >+void PaymentProcessCoordinator::didCancelPaymentSession() >+{ >+ paymentProcessCoordinator().didCancelPaymentSession(); >+} >+ >+void PaymentProcessCoordinator::canMakePaymentsWithActiveCardReply(uint64_t requestID, bool canMakePayments) >+{ >+ auto callback = m_pendingCanMakePaymentsWithActiveCardCallbacks.take(requestID); >+ callback(canMakePayments); >+} >+ >+void PaymentProcessCoordinator::openPaymentSetupReply(uint64_t requestID, bool result) >+{ >+ auto callback = m_pendingOpenPaymentSetupCallbacks.take(requestID); >+ callback(result); >+} >+ >+WebCore::PaymentCoordinator& PaymentProcessCoordinator::paymentProcessCoordinator() >+{ >+ return m_webPage.corePage()->paymentCoordinator(); >+} >+ >+} >+ >+#endif >diff --git a/Source/WebKit/WebProcess/Payments/PaymentProcessCoordinator.h b/Source/WebKit/WebProcess/Payments/PaymentProcessCoordinator.h >new file mode 100644 >index 0000000000000000000000000000000000000000..2acbbcadf85727f7831d73556ea4c79f4c02ed67 >--- /dev/null >+++ b/Source/WebKit/WebProcess/Payments/PaymentProcessCoordinator.h >@@ -0,0 +1,102 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#pragma once >+ >+#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_PROCESS) >+ >+#include "MessageReceiver.h" >+#include <WebCore/PaymentCoordinatorClient.h> >+#include <WebCore/PaymentHeaders.h> >+#include <wtf/Forward.h> >+#include <wtf/HashMap.h> >+#include <wtf/HashSet.h> >+#include <wtf/text/StringHash.h> >+ >+namespace IPC { >+class DataReference; >+} >+ >+namespace WebCore { >+class PaymentCoordinator; >+class PaymentContact; >+} >+ >+namespace WebKit { >+ >+class WebPage; >+ >+class PaymentProcessCoordinator final : public WebCore::PaymentCoordinatorClient, private IPC::MessageReceiver { >+public: >+ explicit PaymentProcessCoordinator(WebPage&); >+ ~PaymentProcessCoordinator(); >+ >+private: >+ // WebCore::PaymentCoordinatorClient. >+ bool supportsVersion(unsigned version) override; >+ std::optional<String> validatedPaymentNetwork(const String&) override; >+ bool canMakePayments() override; >+ void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler) override; >+ void openPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler) override; >+ bool showPaymentUI(const WebCore::URL& originatingURL, const Vector<WebCore::URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&) override; >+ void completeMerchantValidation(const WebCore::PaymentMerchantSession&) override; >+ void completeShippingMethodSelection(std::optional<WebCore::ShippingMethodUpdate>&&) override; >+ void completeShippingContactSelection(std::optional<WebCore::ShippingContactUpdate>&&) override; >+ void completePaymentMethodSelection(std::optional<WebCore::PaymentMethodUpdate>&&) override; >+ void completePaymentSession(std::optional<WebCore::PaymentAuthorizationResult>&&) override; >+ >+ void abortPaymentSession() override; >+ void cancelPaymentSession() override; >+ >+ void paymentCoordinatorDestroyed() override; >+ >+ // IPC::MessageReceiver. >+ void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; >+ >+ // Message handlers. >+ void validateMerchant(const String& validationURLString); >+ void didAuthorizePayment(const WebCore::Payment&); >+ void didSelectShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod&); >+ void didSelectShippingContact(const WebCore::PaymentContact&); >+ void didSelectPaymentMethod(const WebCore::PaymentMethod&); >+ void didCancelPaymentSession(); >+ void canMakePaymentsWithActiveCardReply(uint64_t requestID, bool canMakePayments); >+ void openPaymentSetupReply(uint64_t requestID, bool result); >+ >+ WebCore::PaymentCoordinator& paymentProcessCoordinator(); >+ >+ using AvailablePaymentNetworksSet = HashSet<String, ASCIICaseInsensitiveHash>; >+ const AvailablePaymentNetworksSet& availablePaymentNetworks(); >+ >+ WebPage& m_webPage; >+ >+ HashMap<uint64_t, WTF::Function<void(bool)>> m_pendingCanMakePaymentsWithActiveCardCallbacks; >+ HashMap<uint64_t, WTF::Function<void(bool)>> m_pendingOpenPaymentSetupCallbacks; >+ >+ std::optional<AvailablePaymentNetworksSet> m_availablePaymentNetworks; >+}; >+ >+} >+#endif >diff --git a/Source/WebKit/WebProcess/Payments/PaymentProcessCoordinator.messages.in b/Source/WebKit/WebProcess/Payments/PaymentProcessCoordinator.messages.in >new file mode 100644 >index 0000000000000000000000000000000000000000..bae271e86465e1ac7b458a7ea902357b31bd6e7e >--- /dev/null >+++ b/Source/WebKit/WebProcess/Payments/PaymentProcessCoordinator.messages.in >@@ -0,0 +1,39 @@ >+# Copyright (C) 2018 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+# THE POSSIBILITY OF SUCH DAMAGE. >+#/ >+ >+#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_PROCESS) >+ >+messages -> PaymentProcessCoordinator { >+ >+ ValidateMerchant(String validationURLString) >+ DidAuthorizePayment(WebCore::Payment payment) >+ DidSelectShippingMethod(WebCore::ApplePaySessionPaymentRequest::ShippingMethod shippingMethod) >+ DidSelectShippingContact(WebCore::PaymentContact shippingContact) >+ DidSelectPaymentMethod(WebCore::PaymentMethod paymentMethod) >+ DidCancelPaymentSession() >+ CanMakePaymentsWithActiveCardReply(uint64_t requestID, bool canMakePayments) >+ OpenPaymentSetupReply(uint64_t requestID, bool result) >+} >+ >+#endif >diff --git a/Source/WebKit/WebProcess/Payments/WebToPaymentProcessConnection.cpp b/Source/WebKit/WebProcess/Payments/WebToPaymentProcessConnection.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..2d4cd2c7d16a444b962b530fd577b4c4aedf5beb >--- /dev/null >+++ b/Source/WebKit/WebProcess/Payments/WebToPaymentProcessConnection.cpp >@@ -0,0 +1,98 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ * >+ */ >+ >+#include "config.h" >+#include "WebToPaymentProcessConnection.h" >+ >+#if ENABLE(PAYMENT_PROCESS) >+ >+#include "PaymentProcessCoordinatorMessages.h" >+#include "WebProcess.h" >+ >+namespace WebKit { >+using namespace PAL; >+using namespace WebCore; >+ >+WebToPaymentProcessConnection::WebToPaymentProcessConnection(IPC::Connection::Identifier connectionIdentifier) >+ : m_connection(IPC::Connection::createClientConnection(connectionIdentifier, *this)) >+{ >+ m_connection->open(); >+} >+ >+WebToPaymentProcessConnection::~WebToPaymentProcessConnection() >+{ >+ m_connection->invalidate(); >+} >+ >+void WebToPaymentProcessConnection::validateMerchant(const String& validationURLString) >+{ >+ UNUSED_PARAM(validationURLString); >+ WebProcess::singleton().webToPaymentProcessConnectionClosed(this); >+ >+} >+ >+void WebToPaymentProcessConnection::didAuthorizePayment(const WebCore::Payment& payment) >+{ >+} >+ >+void WebToPaymentProcessConnection::didSelectShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod& shippingMethod) >+{ >+} >+ >+void WebToPaymentProcessConnection::didSelectShippingContact(const WebCore::PaymentContact& shippingContact) >+{ >+} >+ >+void WebToPaymentProcessConnection::didSelectPaymentMethod(const WebCore::PaymentMethod& paymentMethod) >+{ >+} >+ >+void WebToPaymentProcessConnection::didCancelPaymentSession() >+{ >+} >+ >+void WebToPaymentProcessConnection::canMakePaymentsWithActiveCardReply(uint64_t requestID, bool canMakePayments) >+{ >+} >+ >+void WebToPaymentProcessConnection::openPaymentSetupReply(uint64_t requestID, bool result) >+{ >+} >+ >+ >+void WebToPaymentProcessConnection::didClose(IPC::Connection& connection) >+{ >+ auto protectedThis = makeRef(*this); >+ >+ WebProcess::singleton().webToPaymentProcessConnectionClosed(this); >+} >+ >+void WebToPaymentProcessConnection::didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) >+{ >+} >+ >+} // namespace WebKit >+#endif // ENABLE(PAYMENT_PROCESS) >diff --git a/Source/WebKit/WebProcess/Payments/WebToPaymentProcessConnection.h b/Source/WebKit/WebProcess/Payments/WebToPaymentProcessConnection.h >new file mode 100644 >index 0000000000000000000000000000000000000000..9a90527db18a4e35243d95b9542767c5d60686af >--- /dev/null >+++ b/Source/WebKit/WebProcess/Payments/WebToPaymentProcessConnection.h >@@ -0,0 +1,77 @@ >+/* >+ * Copyright (C) 2018 Apple Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ * >+ */ >+ >+#if ENABLE(PAYMENT_PROCESS) >+ >+#pragma once >+ >+#include "Connection.h" >+#include "MessageSender.h" >+#include <WebCore/ApplePaySessionPaymentRequest.h> >+#include <WebCore/Payment.h> >+#include <WebCore/PaymentContact.h> >+#include <WebCore/PaymentMethod.h> >+#include <wtf/RefCounted.h> >+ >+namespace WebKit { >+ >+class WebToPaymentProcessConnection : public IPC::Connection::WorkQueueMessageReceiver, IPC::Connection::Client, IPC::MessageSender { >+public: >+ static Ref<WebToPaymentProcessConnection> create(IPC::Connection::Identifier connectionIdentifier) >+ { >+ return adoptRef(*new WebToPaymentProcessConnection(connectionIdentifier)); >+ } >+ ~WebToPaymentProcessConnection(); >+ >+ IPC::Connection& connection() { return m_connection.get(); } >+ >+ void validateMerchant(const String& validationURLString); >+ void didAuthorizePayment(const WebCore::Payment&); >+ void didSelectShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod&); >+ void didSelectShippingContact(const WebCore::PaymentContact&); >+ void didSelectPaymentMethod(const WebCore::PaymentMethod&); >+ void didCancelPaymentSession(); >+ void canMakePaymentsWithActiveCardReply(uint64_t requestID, bool canMakePayments); >+ void openPaymentSetupReply(uint64_t requestID, bool result); >+ >+ >+private: >+ WebToPaymentProcessConnection(IPC::Connection::Identifier); >+ >+ // IPC::Connection::Client >+ void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override; >+ void didClose(IPC::Connection&) override; >+ void didReceiveInvalidMessage(IPC::Connection&, IPC::StringReference messageReceiverName, IPC::StringReference messageName) override; >+ >+ // IPC::MessageSender >+ IPC::Connection* messageSenderConnection() override { return m_connection.ptr(); } >+ uint64_t messageSenderDestinationID() override { return 0; } >+ >+ Ref<IPC::Connection> m_connection; >+}; >+ >+} // namespace WebKit >+#endif // ENABLE(PAYMENT_PROCESS) >diff --git a/Source/WebKit/WebProcess/Payments/WebToPaymentProcessConnection.messages.in b/Source/WebKit/WebProcess/Payments/WebToPaymentProcessConnection.messages.in >new file mode 100644 >index 0000000000000000000000000000000000000000..71899807c603bbe210025f781de420f882a69e6d >--- /dev/null >+++ b/Source/WebKit/WebProcess/Payments/WebToPaymentProcessConnection.messages.in >@@ -0,0 +1,39 @@ >+# Copyright (C) 2018 Apple Inc. All rights reserved. >+# >+# Redistribution and use in source and binary forms, with or without >+# modification, are permitted provided that the following conditions >+# are met: >+# 1. Redistributions of source code must retain the above copyright >+# notice, this list of conditions and the following disclaimer. >+# 2. Redistributions in binary form must reproduce the above copyright >+# notice, this list of conditions and the following disclaimer in the >+# documentation and/or other materials provided with the distribution. >+# >+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+# THE POSSIBILITY OF SUCH DAMAGE. >+#/ >+ >+#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_PROCESS) >+ >+messages -> WebToPaymentProcessConnection { >+ >+ ValidateMerchant(String validationURLString) >+ DidAuthorizePayment(WebCore::Payment payment) >+ DidSelectShippingMethod(WebCore::ApplePaySessionPaymentRequest::ShippingMethod shippingMethod) >+ DidSelectShippingContact(WebCore::PaymentContact shippingContact) >+ DidSelectPaymentMethod(WebCore::PaymentMethod paymentMethod) >+ DidCancelPaymentSession() >+ CanMakePaymentsWithActiveCardReply(uint64_t requestID, bool canMakePayments) >+ OpenPaymentSetupReply(uint64_t requestID, bool result) >+} >+ >+#endif >diff --git a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h >index dcd6da5806bb332c24ffec8518ee5096cbae7f83..b76e3c18559eb00ee2c6c813f24788eef432e881 100644 >--- a/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h >+++ b/Source/WebKit/WebProcess/Storage/WebSWClientConnection.h >@@ -90,6 +90,7 @@ private: > void didResolveRegistrationPromise(const WebCore::ServiceWorkerRegistrationKey&) final; > > void scheduleStorageJob(const WebCore::ServiceWorkerJobData&); >+ void schedulePaymentJob(const WebCore::ServiceWorkerJobData&); > > void runOrDelayTaskForImport(WTF::Function<void()>&& task); > >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index be6befb8147865fc0e81e81223b6c496ab7f1bd5..7aac12e07ab82ce5e7db1a5e88536ea33b9ffae7 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -51,6 +51,7 @@ > #include "NetworkProcessConnection.h" > #include "NotificationPermissionRequestManager.h" > #include "PageBanner.h" >+#include "PaymentProcessCoordinator.h" > #include "PluginProcessAttributes.h" > #include "PluginProxy.h" > #include "PluginView.h" >@@ -453,7 +454,9 @@ WebPage::WebPage(uint64_t pageID, WebPageCreationParameters&& parameters) > pageConfiguration.userContentProvider = m_userContentController.ptr(); > pageConfiguration.visitedLinkStore = VisitedLinkTableController::getOrCreate(parameters.visitedLinkTableID); > >-#if ENABLE(APPLE_PAY) >+#if ENABLE(APPLE_PAY) && ENABLE(PAYMENT_PROCESS) >+ pageConfiguration.paymentCoordinatorClient = new PaymentProcessCoordinator(*this); >+#elif ENABLE(APPLE_PAY) > pageConfiguration.paymentCoordinatorClient = new WebPaymentCoordinator(*this); > #endif > >diff --git a/Source/WebKit/WebProcess/WebPage/WebPageInspectorTargetController.cpp b/Source/WebKit/WebProcess/WebPage/WebPageInspectorTargetController.cpp >index b0d703c537f00790c4ffca9f3b1d9b41dd08a43e..7b5d00160de35998f5d577a4bf3558b19651c6bc 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPageInspectorTargetController.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPageInspectorTargetController.cpp >@@ -63,7 +63,7 @@ void WebPageInspectorTargetController::removeTarget(Inspector::InspectorTarget& > > void WebPageInspectorTargetController::connectInspector(const String& targetId, Inspector::FrontendChannel::ConnectionType connectionType) > { >- InspectorTarget* target = m_targets.get(targetId); >+ auto* target = m_targets.get(targetId); > if (!target) > return; > >@@ -78,7 +78,7 @@ void WebPageInspectorTargetController::connectInspector(const String& targetId, > > void WebPageInspectorTargetController::disconnectInspector(const String& targetId) > { >- InspectorTarget* target = m_targets.get(targetId); >+ auto* target = m_targets.get(targetId); > if (!target) > return; > >@@ -91,7 +91,7 @@ void WebPageInspectorTargetController::disconnectInspector(const String& targetI > > void WebPageInspectorTargetController::sendMessageToTargetBackend(const String& targetId, const String& message) > { >- InspectorTarget* target = m_targets.get(targetId); >+ auto* target = m_targets.get(targetId); > if (!target) > return; > >diff --git a/Source/WebKit/WebProcess/WebProcess.cpp b/Source/WebKit/WebProcess/WebProcess.cpp >index 09cea95355311b64c3ae0bc631eda8b10852fffb..a60d6a20c3805f5b40dfbdad8a5b972f7f61b89d 100644 >--- a/Source/WebKit/WebProcess/WebProcess.cpp >+++ b/Source/WebKit/WebProcess/WebProcess.cpp >@@ -136,6 +136,11 @@ > #include "UserMediaCaptureManager.h" > #endif > >+#if ENABLE(PAYMENT_PROCESS) >+#include "PaymentProcessMessages.h" >+#include "WebToPaymentProcessConnection.h" >+#endif // ENABLE(PAYMENT_PROCESS) >+ > #if ENABLE(SEC_ITEM_SHIM) > #include "SecItemShim.h" > #endif >@@ -385,6 +390,7 @@ void WebProcess::initializeWebProcess(WebProcessCreationParameters&& parameters) > NetworkStorageSession::switchToNewTestingSession(); > > ensureNetworkProcessConnection(); >+ ensureWebToPaymentProcessConnection(); > > setTerminationTimeout(parameters.terminationTimeout); > >@@ -1243,6 +1249,31 @@ WebLoaderStrategy& WebProcess::webLoaderStrategy() > { > return m_webLoaderStrategy; > } >+#if ENABLE(PAYMENT_PROCESS) >+void WebProcess::webToPaymentProcessConnectionClosed(WebToPaymentProcessConnection* connection) >+{ >+ ASSERT(m_webToPaymentProcessConnection); >+ ASSERT(m_webToPaymentProcessConnection == connection); >+ >+ m_webToPaymentProcessConnection = nullptr; >+} >+ >+WebToPaymentProcessConnection& WebProcess::ensureWebToPaymentProcessConnection() >+{ >+ if (!m_webToPaymentProcessConnection) { >+ IPC::Attachment encodedConnectionIdentifier; >+ >+ if (!parentProcessConnection()->sendSync(Messages::WebProcessProxy::GetPaymentProcessConnection(), Messages::WebProcessProxy::GetPaymentProcessConnection::Reply(encodedConnectionIdentifier), 0)) >+ ASSERT_NOT_REACHED(); >+ if (!IPC::Connection::identifierIsValid(encodedConnectionIdentifier.port())) >+ CRASH(); >+ >+ m_webToPaymentProcessConnection = WebToPaymentProcessConnection::create(encodedConnectionIdentifier.port()); >+ >+ } >+ return *m_webToPaymentProcessConnection; >+} >+#endif // ENABLE(PAYMENT_PROCESS) > > void WebProcess::setEnhancedAccessibility(bool flag) > { >diff --git a/Source/WebKit/WebProcess/WebProcess.h b/Source/WebKit/WebProcess/WebProcess.h >index 23dec03c9850b2e1a697e3aa6134a8ab416d7b3c..b80a8460bbcf0b62d50d4aa46db0d16cb919ff40 100644 >--- a/Source/WebKit/WebProcess/WebProcess.h >+++ b/Source/WebKit/WebProcess/WebProcess.h >@@ -98,6 +98,9 @@ class WebLoaderStrategy; > class WebPage; > class WebPageGroupProxy; > class WebProcessSupplement; >+#if ENABLE(PAYMENT_PROCESS) >+class WebToPaymentProcessConnection; >+#endif // ENABLE(PAYMENT_PROCESS) > enum class WebsiteDataType; > struct WebPageCreationParameters; > struct WebPageGroupData; >@@ -175,6 +178,11 @@ public: > > LibWebRTCNetwork& libWebRTCNetwork(); > >+#if ENABLE(PAYMENT_PROCESS) >+ void webToPaymentProcessConnectionClosed(WebToPaymentProcessConnection*); >+ WebToPaymentProcessConnection& ensureWebToPaymentProcessConnection(); >+#endif // ENABLE(PAYMENT_PROCESS) >+ > void setCacheModel(uint32_t); > > void ensureLegacyPrivateBrowsingSessionInNetworkProcess(); >@@ -444,6 +452,10 @@ private: > > std::unique_ptr<WebAutomationSessionProxy> m_automationSessionProxy; > >+#if ENABLE(PAYMENT_PROCESS) >+ RefPtr<WebToPaymentProcessConnection> m_webToPaymentProcessConnection; >+#endif // ENABLE(PAYMENT_PROCESS) >+ > #if ENABLE(NETSCAPE_PLUGIN_API) > RefPtr<PluginProcessConnectionManager> m_pluginProcessConnectionManager; > #endif >diff --git a/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig b/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig >index 2e9a04d01bdd1421c4b457114bf89c3c784ef9c0..ad6b5f389e374afd7c050841107879efa82a7ae5 100644 >--- a/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig >+++ b/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig >@@ -292,6 +292,7 @@ ENABLE_NAVIGATOR_STANDALONE_cocoatouch = ENABLE_NAVIGATOR_STANDALONE; > ENABLE_NOTIFICATIONS = $(ENABLE_NOTIFICATIONS_$(WK_PLATFORM_NAME)); > ENABLE_NOTIFICATIONS_macosx = ENABLE_NOTIFICATIONS; > >+ENABLE_PAYMENT_PROCESS = ENABLE_PAYMENT_PROCESS; > ENABLE_PAYMENT_REQUEST = ENABLE_PAYMENT_REQUEST; > > ENABLE_PDFKIT_PLUGIN = $(ENABLE_PDFKIT_PLUGIN_$(WK_PLATFORM_NAME)); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 29fb744c6d9cea64afaac21ff95a910e33bd7f4f..2fefd32b6a61d11140113f85f149786ebc387b62 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,24 @@ >+2018-11-27 Zamiul Haque <zhaque@apple.com> >+ >+ Payment process stub with feature flag >+ https://bugs.webkit.org/show_bug.cgi?id=191298 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: >+ * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl: >+ * WebKitTestRunner/InjectedBundle/TestRunner.cpp: >+ (WTR::TestRunner::terminatePaymentProcess): >+ * WebKitTestRunner/InjectedBundle/TestRunner.h: >+ * WebKitTestRunner/TestController.cpp: >+ (WTR::TestController::generatePageConfiguration): >+ (WTR::TestController::paymentProcessName): >+ (WTR::TestController::paymentProcessDidCrash): >+ (WTR::TestController::terminatePaymentProcess): >+ * WebKitTestRunner/TestController.h: >+ * WebKitTestRunner/TestInvocation.cpp: >+ (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): >+ > 2018-12-19 Megan Gardner <megan_gardner@apple.com> > > Allow clients to set the navigator platform >diff --git a/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig b/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig >index 2e9a04d01bdd1421c4b457114bf89c3c784ef9c0..ad6b5f389e374afd7c050841107879efa82a7ae5 100644 >--- a/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig >+++ b/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig >@@ -292,6 +292,7 @@ ENABLE_NAVIGATOR_STANDALONE_cocoatouch = ENABLE_NAVIGATOR_STANDALONE; > ENABLE_NOTIFICATIONS = $(ENABLE_NOTIFICATIONS_$(WK_PLATFORM_NAME)); > ENABLE_NOTIFICATIONS_macosx = ENABLE_NOTIFICATIONS; > >+ENABLE_PAYMENT_PROCESS = ENABLE_PAYMENT_PROCESS; > ENABLE_PAYMENT_REQUEST = ENABLE_PAYMENT_REQUEST; > > ENABLE_PDFKIT_PLUGIN = $(ENABLE_PDFKIT_PLUGIN_$(WK_PLATFORM_NAME)); >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm >index 3f1a6288682102a5892a0eef32a9442a0caf5084..c346abfd620f93555fd8005c8a1b40d8a9c047b1 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm >@@ -144,6 +144,7 @@ TEST(ResourceLoadStatistics, ChildProcessesNotLaunched) > // Ensure the shared process pool exists so the data store operations we're about to do work with it. > WKProcessPool *sharedProcessPool = [WKProcessPool _sharedProcessPool]; > >+ EXPECT_EQ((pid_t)0, [sharedProcessPool _paymentProcessIdentifier]); > EXPECT_EQ((size_t)0, [sharedProcessPool _pluginProcessCount]); > > auto *dataStore = [WKWebsiteDataStore defaultDataStore]; >@@ -168,6 +169,7 @@ TEST(ResourceLoadStatistics, ChildProcessesNotLaunched) > > EXPECT_TRUE([[NSFileManager defaultManager] fileExistsAtPath:targetURL.path]); > >+ EXPECT_EQ((pid_t)0, [sharedProcessPool _paymentProcessIdentifier]); > EXPECT_EQ((size_t)0, [sharedProcessPool _pluginProcessCount]); > } > >diff --git a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm >index 61ddbc3d63a9ea87c26eca0d1bfd667765730916..e6403e9e0ff6eabda9ece0f29cffa65e555cdc87 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm >@@ -1046,6 +1046,9 @@ TEST(ServiceWorkers, ServiceWorkerProcessCreation) > TestWebKitAPI::Util::run(&done); > done = false; > >+ // Make sure payment process is not launched. >+ EXPECT_EQ(0, webView.get().configuration.processPool._paymentProcessIdentifier); >+ > // Make sure that loading the simple page did not start the service worker process. > EXPECT_EQ(1u, webView.get().configuration.processPool._webProcessCountIgnoringPrewarmed); > >@@ -1130,6 +1133,9 @@ TEST(ServiceWorkers, HasServiceWorkerRegistrationBit) > TestWebKitAPI::Util::run(&done); > done = false; > >+ // There should be no payment process created. >+ EXPECT_EQ(0, webView.get().configuration.processPool._paymentProcessIdentifier); >+ > // Let's use the web site data store that has service worker and load a page. > newConfiguration.get().websiteDataStore = [configuration websiteDataStore]; > >diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >index da022c4f0c7692e7c6df4d62e4596f189eadbc5e..676916f9072326933c467d7435db7edb11f7422a 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl >@@ -335,6 +335,7 @@ interface TestRunner { > > void terminateNetworkProcess(); > void terminateServiceWorkerProcess(); >+ void terminatePaymentProcess(); > > readonly attribute boolean didCancelClientRedirect; > >diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >index 22579e8918559b8e328f41836f70d15711760892..19e6257151e455005b87c84099c9739a48859873 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp >@@ -1292,6 +1292,14 @@ void TestRunner::terminateServiceWorkerProcess() > WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, nullptr); > } > >+void TestRunner::terminatePaymentProcess() >+{ >+#if ENABLE(PAYMENT_PROCESS) >+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("TerminatePaymentProcess")); >+ WKBundlePagePostSynchronousMessageForTesting(InjectedBundle::singleton().page()->page(), messageName.get(), nullptr, nullptr); >+#endif // ENABLE(PAYMENT_PROCESS) >+} >+ > static unsigned nextUIScriptCallbackID() > { > static unsigned callbackID = FirstUIScriptCallbackID; >diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >index 120efc8263ec77249b3b0d7da61476a3c8a7af17..4d5f986c301cfa07317336f0fed6f44430b3cda7 100644 >--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h >@@ -448,6 +448,7 @@ public: > > void terminateNetworkProcess(); > void terminateServiceWorkerProcess(); >+ void terminatePaymentProcess(); > > void removeAllSessionCredentials(JSValueRef); > void callDidRemoveAllSessionCredentialsCallback(); >diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp >index 2f98ed32396da759f6ffdeddeadc935d11e558d2..5ec3ed71525d465aef7a6b28b02a8912b133dea7 100644 >--- a/Tools/WebKitTestRunner/TestController.cpp >+++ b/Tools/WebKitTestRunner/TestController.cpp >@@ -1075,6 +1075,13 @@ const char* TestController::networkProcessName() > #endif > } > >+#if ENABLE(PAYMENT_PROCESS) >+const char* TestController::paymentProcessName() >+{ >+ return "com.apple.WebKit.Payments"; >+} >+#endif >+ > void TestController::setAllowsAnySSLCertificate(bool allows) > { > WKContextSetAllowsAnySSLCertificateForWebSocketTesting(platformContext(), allows); >@@ -1511,6 +1518,13 @@ void TestController::networkProcessDidCrash(WKContextRef context, const void *cl > static_cast<TestController*>(const_cast<void*>(clientInfo))->networkProcessDidCrash(); > } > >+void TestController::paymentProcessDidCrash(WKContextRef context, const void *clientInfo) >+{ >+#if ENABLE(PAYMENT_PROCESS) >+ static_cast<TestController*>(const_cast<void*>(clientInfo))->paymentProcessDidCrash(); >+#endif >+} >+ > void TestController::didReceiveKeyDownMessageFromInjectedBundle(WKDictionaryRef messageBodyDictionary, bool synchronous) > { > WKRetainPtr<WKStringRef> keyKey = adoptWK(WKStringCreateWithUTF8CString("Key")); >@@ -1844,6 +1858,15 @@ void TestController::networkProcessDidCrash() > exit(1); > } > >+void TestController::paymentProcessDidCrash() >+{ >+#if ENABLE(PAYMENT_PROCESS) >+ pid_t pid = WKContextGetPaymentProcessIdentifier(m_context.get()); >+ fprintf(stderr, "#CRASHED - %s (pid %ld)\n", paymentProcessName(), static_cast<long>(pid)); >+ exit(1); >+#endif >+} >+ > // WKPageNavigationClient > > void TestController::didCommitNavigation(WKPageRef page, WKNavigationRef navigation, WKTypeRef, const void* clientInfo) >@@ -2643,6 +2666,13 @@ void TestController::terminateServiceWorkerProcess() > WKContextTerminateServiceWorkerProcess(platformContext()); > } > >+void TestController::terminatePaymentProcess() >+{ >+#if ENABLE(PAYMENT_PROCESS) >+ WKContextTerminatePaymentProcess(platformContext()); >+#endif >+} >+ > #if !PLATFORM(COCOA) > void TestController::platformWillRunTest(const TestInvocation&) > { >diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h >index 13a39c6905f0d87ba87b9db57f8dad5c17ac71bc..bf9de537ea8f319398f326de38982c8c5d5fa485 100644 >--- a/Tools/WebKitTestRunner/TestController.h >+++ b/Tools/WebKitTestRunner/TestController.h >@@ -168,7 +168,10 @@ public: > static const char* webProcessName(); > static const char* networkProcessName(); > static const char* databaseProcessName(); >- >+#if ENABLE(PAYMENT_PROCESS) >+ static const char* paymentProcessName(); >+#endif >+ > WorkQueueManager& workQueueManager() { return m_workQueueManager; } > > void setRejectsProtectionSpaceAndContinueForAuthenticationChallenges(bool value) { m_rejectsProtectionSpaceAndContinueForAuthenticationChallenges = value; } >@@ -239,7 +242,8 @@ public: > > void terminateNetworkProcess(); > void terminateServiceWorkerProcess(); >- >+ void terminatePaymentProcess(); >+ > void removeAllSessionCredentials(); > > void clearServiceWorkerRegistrations(); >@@ -348,6 +352,8 @@ private: > // WKContextClient > static void networkProcessDidCrash(WKContextRef, const void*); > void networkProcessDidCrash(); >+ static void paymentProcessDidCrash(WKContextRef, const void*); >+ void paymentProcessDidCrash(); > > // WKPageNavigationClient > static void didCommitNavigation(WKPageRef, WKNavigationRef, WKTypeRef userData, const void*); >diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp >index 1a91eb28434d4ed7d1b961220063850540ad782b..72fbb9e8cb3f00dd9a67e5a71a9f92ca7bf986cd 100644 >--- a/Tools/WebKitTestRunner/TestInvocation.cpp >+++ b/Tools/WebKitTestRunner/TestInvocation.cpp >@@ -1453,6 +1453,14 @@ WKRetainPtr<WKTypeRef> TestInvocation::didReceiveSynchronousMessageFromInjectedB > return nullptr; > } > >+#if ENABLE(PAYMENT_PROCESS) >+ if (WKStringIsEqualToUTF8CString(messageName, "TerminatePaymentProcess")) { >+ ASSERT(!messageBody); >+ TestController::singleton().terminatePaymentProcess(); >+ return nullptr; >+ } >+#endif >+ > if (WKStringIsEqualToUTF8CString(messageName, "TerminateNetworkProcess")) { > ASSERT(!messageBody); > TestController::singleton().terminateNetworkProcess();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 191298
:
353947
|
353949
|
354162
|
354191
|
354197
|
354198
|
354226
|
354230
|
354283
|
354407
|
354858
|
354883
|
354885
|
354900
|
354966
|
354983
|
355158
|
355593
|
355595
|
355601
|
355675
|
355679
|
355837
|
357759
|
357829
|
357834
|
357876
|
358014