<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[242356] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/242356">242356</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2019-03-04 08:47:58 -0800 (Mon, 04 Mar 2019)</dd>
</dl>
<h3>Log Message</h3>
<pre>[Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
https://bugs.webkit.org/show_bug.cgi?id=195080
<rdar://problem/48421558>
Reviewed by Antti Koivisto.
Source/WebKit:
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources.make:
* Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp.
* Shared/ApplePay/WebPaymentCoordinatorProxy.h: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h.
* Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in.
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h.
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm.
* Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Renamed from Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm.
* Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Renamed from Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm.
* Shared/mac/WebHitTestResultData.mm:
* SourcesCocoa.txt:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
* UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
* WebKit.xcodeproj/project.pbxproj:
Source/WTF:
* wtf/FeatureDefines.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfFeatureDefinesh">trunk/Source/WTF/wtf/FeatureDefines.h</a></li>
<li><a href="#trunkSourceWebKitCMakeListstxt">trunk/Source/WebKit/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitDerivedSourcesinputxcfilelist">trunk/Source/WebKit/DerivedSources-input.xcfilelist</a></li>
<li><a href="#trunkSourceWebKitDerivedSourcesmake">trunk/Source/WebKit/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebKitSharedmacWebHitTestResultDatamm">trunk/Source/WebKit/Shared/mac/WebHitTestResultData.mm</a></li>
<li><a href="#trunkSourceWebKitSourcesCocoatxt">trunk/Source/WebKit/SourcesCocoa.txt</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeFrameScrollingNodeRemoteIOSh">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeFrameScrollingNodeRemoteIOSmm">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeScrollingNodeDelegateIOSh">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h</a></li>
<li><a href="#trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeScrollingNodeDelegateIOSmm">trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebKit/Shared/ApplePay/</li>
<li><a href="#trunkSourceWebKitSharedApplePayWebPaymentCoordinatorProxycpp">trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitSharedApplePayWebPaymentCoordinatorProxyh">trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h</a></li>
<li><a href="#trunkSourceWebKitSharedApplePayWebPaymentCoordinatorProxymessagesin">trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in</a></li>
<li>trunk/Source/WebKit/Shared/ApplePay/cocoa/</li>
<li><a href="#trunkSourceWebKitSharedApplePaycocoaWebPaymentCoordinatorProxyCocoah">trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h</a></li>
<li><a href="#trunkSourceWebKitSharedApplePaycocoaWebPaymentCoordinatorProxyCocoamm">trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm</a></li>
<li>trunk/Source/WebKit/Shared/ApplePay/ios/</li>
<li><a href="#trunkSourceWebKitSharedApplePayiosWebPaymentCoordinatorProxyIOSmm">trunk/Source/WebKit/Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm</a></li>
<li>trunk/Source/WebKit/Shared/ApplePay/mac/</li>
<li><a href="#trunkSourceWebKitSharedApplePaymacWebPaymentCoordinatorProxyMacmm">trunk/Source/WebKit/Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li>trunk/Source/WebKit/UIProcess/ApplePay/</li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WTF/ChangeLog 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2019-03-04 Andy Estes <aestes@apple.com>
+
+ [Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
+ https://bugs.webkit.org/show_bug.cgi?id=195080
+ <rdar://problem/48421558>
+
+ Reviewed by Antti Koivisto.
+
+ * wtf/FeatureDefines.h:
+
</ins><span class="cx"> 2019-03-04 Michael Catanzaro <mcatanzaro@igalia.com>
</span><span class="cx">
</span><span class="cx"> URLHelpers should use unorm2_quickCheck before converting to NFC
</span></span></pre></div>
<a id="trunkSourceWTFwtfFeatureDefinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/FeatureDefines.h (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/FeatureDefines.h 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WTF/wtf/FeatureDefines.h 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -179,6 +179,10 @@
</span><span class="cx"> #define ENABLE_MEDIA_SOURCE 0
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if !defined(HAVE_PASSKIT_GRANULAR_ERRORS)
+#define HAVE_PASSKIT_GRANULAR_ERRORS 1
+#endif
+
</ins><span class="cx"> #endif /* PLATFORM(IOS_FAMILY) */
</span><span class="cx">
</span><span class="cx"> /* --------- Apple WATCHOS port --------- */
</span><span class="lines">@@ -265,6 +269,10 @@
</span><span class="cx"> #define ENABLE_MEDIA_SOURCE 1
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if !defined(HAVE_PASSKIT_GRANULAR_ERRORS)
+#define HAVE_PASSKIT_GRANULAR_ERRORS __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
+#endif
+
</ins><span class="cx"> #endif /* PLATFORM(MAC) */
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebKitCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/CMakeLists.txt (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/CMakeLists.txt 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WebKit/CMakeLists.txt 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> "${WEBKIT_DIR}/Shared"
</span><span class="cx"> "${WEBKIT_DIR}/Shared/API"
</span><span class="cx"> "${WEBKIT_DIR}/Shared/API/c"
</span><ins>+ "${WEBKIT_DIR}/Shared/ApplePay"
</ins><span class="cx"> "${WEBKIT_DIR}/Shared/Authentication"
</span><span class="cx"> "${WEBKIT_DIR}/Shared/CoreIPCSupport"
</span><span class="cx"> "${WEBKIT_DIR}/Shared/Databases"
</span><span class="lines">@@ -36,7 +37,6 @@
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/API"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/API/C"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/API/cpp"
</span><del>- "${WEBKIT_DIR}/UIProcess/ApplePay"
</del><span class="cx"> "${WEBKIT_DIR}/UIProcess/Authentication"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/Automation"
</span><span class="cx"> "${WEBKIT_DIR}/UIProcess/Downloads"
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WebKit/ChangeLog 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2019-03-04 Andy Estes <aestes@apple.com>
+
+ [Apple Pay] Move WebPaymentCoordinatorProxy from Source/WebKit/UIProcess to Source/WebKit/Shared
+ https://bugs.webkit.org/show_bug.cgi?id=195080
+ <rdar://problem/48421558>
+
+ Reviewed by Antti Koivisto.
+
+ * CMakeLists.txt:
+ * DerivedSources-input.xcfilelist:
+ * DerivedSources.make:
+ * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp.
+ * Shared/ApplePay/WebPaymentCoordinatorProxy.h: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h.
+ * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in: Renamed from Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in.
+ * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h.
+ * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Renamed from Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm.
+ * Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm: Renamed from Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm.
+ * Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm: Renamed from Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm.
+ * Shared/mac/WebHitTestResultData.mm:
+ * SourcesCocoa.txt:
+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h:
+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm:
+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h:
+ * UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm:
+ * WebKit.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2019-03-04 Jer Noble <jer.noble@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] Fullscreen "stay in page" option breaks video playback
</span></span></pre></div>
<a id="trunkSourceWebKitDerivedSourcesinputxcfilelist"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/DerivedSources-input.xcfilelist (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/DerivedSources-input.xcfilelist 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WebKit/DerivedSources-input.xcfilelist 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx"> $(PROJECT_DIR)/Scripts/webkit/model.py
</span><span class="cx"> $(PROJECT_DIR)/Scripts/webkit/parser.py
</span><span class="cx"> $(PROJECT_DIR)/Shared/API/Cocoa/RemoteObjectRegistry.messages.in
</span><ins>+$(PROJECT_DIR)/Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in
</ins><span class="cx"> $(PROJECT_DIR)/Shared/Authentication/AuthenticationManager.messages.in
</span><span class="cx"> $(PROJECT_DIR)/Shared/AuxiliaryProcess.messages.in
</span><span class="cx"> $(PROJECT_DIR)/Shared/HTTPSUpgrade/HTTPSUpgradeList.txt
</span><span class="lines">@@ -58,7 +59,6 @@
</span><span class="cx"> $(PROJECT_DIR)/Shared/Plugins/NPObjectMessageReceiver.messages.in
</span><span class="cx"> $(PROJECT_DIR)/Shared/WebConnection.messages.in
</span><span class="cx"> $(PROJECT_DIR)/Shared/WebPreferences.yaml
</span><del>-$(PROJECT_DIR)/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in
</del><span class="cx"> $(PROJECT_DIR)/UIProcess/Automation/Automation.json
</span><span class="cx"> $(PROJECT_DIR)/UIProcess/Automation/WebAutomationSession.messages.in
</span><span class="cx"> $(PROJECT_DIR)/UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in
</span></span></pre></div>
<a id="trunkSourceWebKitDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/DerivedSources.make (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/DerivedSources.make 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WebKit/DerivedSources.make 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> $(WebKit2)/Shared/Plugins \
</span><span class="cx"> $(WebKit2)/Shared \
</span><span class="cx"> $(WebKit2)/Shared/API/Cocoa \
</span><ins>+ $(WebKit2)/Shared/ApplePay \
</ins><span class="cx"> $(WebKit2)/Shared/Authentication \
</span><span class="cx"> $(WebKit2)/Shared/mac \
</span><span class="cx"> $(WebKit2)/WebProcess/ApplePay \
</span><span class="lines">@@ -64,7 +65,6 @@
</span><span class="cx"> $(WebKit2)/WebProcess/ios \
</span><span class="cx"> $(WebKit2)/WebProcess \
</span><span class="cx"> $(WebKit2)/UIProcess \
</span><del>- $(WebKit2)/UIProcess/ApplePay \
</del><span class="cx"> $(WebKit2)/UIProcess/Automation \
</span><span class="cx"> $(WebKit2)/UIProcess/Cocoa \
</span><span class="cx"> $(WebKit2)/UIProcess/Databases \
</span></span></pre></div>
<a id="trunkSourceWebKitSharedApplePayWebPaymentCoordinatorProxycppfromrev242355trunkSourceWebKitUIProcessApplePayWebPaymentCoordinatorProxycpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.cpp (from rev 242355, trunk/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp) (0 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.cpp (rev 0)
+++ trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.cpp 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -0,0 +1,346 @@
</span><ins>+/*
+ * Copyright (C) 2015-2019 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 "WebPaymentCoordinatorProxy.h"
+
+#if ENABLE(APPLE_PAY)
+
+#include "MessageReceiverMap.h"
+#include "WebPageProxy.h"
+#include "WebPaymentCoordinatorMessages.h"
+#include "WebPaymentCoordinatorProxyMessages.h"
+#include "WebProcessProxy.h"
+#include <WebCore/PaymentAuthorizationStatus.h>
+
+namespace WebKit {
+
+static WeakPtr<WebPaymentCoordinatorProxy>& activePaymentCoordinatorProxy()
+{
+ static NeverDestroyed<WeakPtr<WebPaymentCoordinatorProxy>> activePaymentCoordinatorProxy;
+ return activePaymentCoordinatorProxy.get();
+}
+
+WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy(WebPaymentCoordinatorProxy::Client& client)
+ : m_client { client }
+{
+ m_client.paymentCoordinatorMessageReceiver(*this).addMessageReceiver(Messages::WebPaymentCoordinatorProxy::messageReceiverName(), m_client.paymentCoordinatorDestinationID(*this), *this);
+ finishConstruction(*this);
+}
+
+WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy()
+{
+ if (m_state != State::Idle)
+ hidePaymentUI();
+
+ m_client.paymentCoordinatorMessageReceiver(*this).removeMessageReceiver(Messages::WebPaymentCoordinatorProxy::messageReceiverName(), m_client.paymentCoordinatorDestinationID(*this));
+}
+
+IPC::Connection* WebPaymentCoordinatorProxy::messageSenderConnection() const
+{
+ return m_client.paymentCoordinatorConnection(*this);
+}
+
+uint64_t WebPaymentCoordinatorProxy::messageSenderDestinationID() const
+{
+ return m_client.paymentCoordinatorDestinationID(*this);
+}
+
+void WebPaymentCoordinatorProxy::availablePaymentNetworks(CompletionHandler<void(Vector<String>&&)>&& completionHandler)
+{
+ completionHandler(platformAvailablePaymentNetworks());
+}
+
+void WebPaymentCoordinatorProxy::canMakePayments(CompletionHandler<void(bool)>&& reply)
+{
+ reply(platformCanMakePayments());
+}
+
+void WebPaymentCoordinatorProxy::canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, uint64_t requestID)
+{
+ platformCanMakePaymentsWithActiveCard(merchantIdentifier, domainName, [weakThis = makeWeakPtr(*this), requestID](bool canMakePayments) {
+ if (auto paymentCoordinatorProxy = weakThis.get())
+ paymentCoordinatorProxy->send(Messages::WebPaymentCoordinator::CanMakePaymentsWithActiveCardReply(requestID, canMakePayments));
+ });
+}
+
+void WebPaymentCoordinatorProxy::openPaymentSetup(const String& merchantIdentifier, const String& domainName, uint64_t requestID)
+{
+ platformOpenPaymentSetup(merchantIdentifier, domainName, [weakThis = makeWeakPtr(*this), requestID](bool result) {
+ if (auto paymentCoordinatorProxy = weakThis.get())
+ paymentCoordinatorProxy->send(Messages::WebPaymentCoordinator::OpenPaymentSetupReply(requestID, result));
+ });
+}
+
+void WebPaymentCoordinatorProxy::showPaymentUI(const String& originatingURLString, const Vector<String>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& paymentRequest, CompletionHandler<void(bool)>&& completionHandler)
+{
+ // FIXME: Make this a message check.
+ ASSERT(canBegin());
+
+ if (auto& coordinator = activePaymentCoordinatorProxy()) {
+ coordinator->hidePaymentUI();
+ coordinator->didCancelPaymentSession();
+ }
+
+ activePaymentCoordinatorProxy() = makeWeakPtr(this);
+
+ m_state = State::Activating;
+
+ URL originatingURL(URL(), originatingURLString);
+
+ Vector<URL> linkIconURLs;
+ for (const auto& linkIconURLString : linkIconURLStrings)
+ linkIconURLs.append(URL(URL(), linkIconURLString));
+
+ platformShowPaymentUI(originatingURL, linkIconURLs, paymentRequest, [weakThis = makeWeakPtr(*this)](bool result) {
+ if (!weakThis)
+ return;
+
+ ASSERT(weakThis->m_state == State::Activating);
+ if (!result) {
+ weakThis->didCancelPaymentSession();
+ return;
+ }
+
+ weakThis->m_state = State::Active;
+ });
+
+ completionHandler(true);
+}
+
+
+void WebPaymentCoordinatorProxy::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 WebPaymentCoordinatorProxy::completeShippingMethodSelection(const 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 WebPaymentCoordinatorProxy::completeShippingContactSelection(const 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 WebPaymentCoordinatorProxy::completePaymentMethodSelection(const 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 WebPaymentCoordinatorProxy::completePaymentSession(const 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 WebPaymentCoordinatorProxy::abortPaymentSession()
+{
+ // It's possible that the payment has been canceled already.
+ if (!canAbort())
+ return;
+
+ hidePaymentUI();
+
+ didReachFinalState();
+}
+
+void WebPaymentCoordinatorProxy::cancelPaymentSession()
+{
+ if (!canCancel())
+ return;
+
+ hidePaymentUI();
+ didCancelPaymentSession();
+}
+
+void WebPaymentCoordinatorProxy::didCancelPaymentSession()
+{
+ ASSERT(canCancel());
+
+ send(Messages::WebPaymentCoordinator::DidCancelPaymentSession());
+
+ didReachFinalState();
+}
+
+void WebPaymentCoordinatorProxy::validateMerchant(const URL& url)
+{
+ ASSERT(m_merchantValidationState == MerchantValidationState::Idle);
+
+ m_merchantValidationState = MerchantValidationState::Validating;
+ send(Messages::WebPaymentCoordinator::ValidateMerchant(url.string()));
+}
+
+void WebPaymentCoordinatorProxy::didAuthorizePayment(const WebCore::Payment& payment)
+{
+ m_state = State::Authorized;
+ send(Messages::WebPaymentCoordinator::DidAuthorizePayment(payment));
+}
+
+void WebPaymentCoordinatorProxy::didSelectShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod& shippingMethod)
+{
+ ASSERT(m_state == State::Active);
+
+ m_state = State::ShippingMethodSelected;
+ send(Messages::WebPaymentCoordinator::DidSelectShippingMethod(shippingMethod));
+}
+
+void WebPaymentCoordinatorProxy::didSelectShippingContact(const WebCore::PaymentContact& shippingContact)
+{
+ ASSERT(m_state == State::Active);
+
+ m_state = State::ShippingContactSelected;
+ send(Messages::WebPaymentCoordinator::DidSelectShippingContact(shippingContact));
+}
+
+void WebPaymentCoordinatorProxy::didSelectPaymentMethod(const WebCore::PaymentMethod& paymentMethod)
+{
+ ASSERT(m_state == State::Active);
+
+ m_state = State::PaymentMethodSelected;
+ send(Messages::WebPaymentCoordinator::DidSelectPaymentMethod(paymentMethod));
+}
+
+bool WebPaymentCoordinatorProxy::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 WebPaymentCoordinatorProxy::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 WebPaymentCoordinatorProxy::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 WebPaymentCoordinatorProxy::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 WebPaymentCoordinatorProxy::didReachFinalState()
+{
+ m_state = State::Idle;
+ m_merchantValidationState = MerchantValidationState::Idle;
+
+ ASSERT(activePaymentCoordinatorProxy() == this);
+ activePaymentCoordinatorProxy() = nullptr;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitSharedApplePayWebPaymentCoordinatorProxyhfromrev242355trunkSourceWebKitUIProcessApplePayWebPaymentCoordinatorProxyh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h (from rev 242355, trunk/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h) (0 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h (rev 0)
+++ trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -0,0 +1,195 @@
</span><ins>+/*
+ * Copyright (C) 2015-2019 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)
+
+#include "MessageReceiver.h"
+#include "MessageSender.h"
+#include <WebCore/PaymentHeaders.h>
+#include <wtf/Forward.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/WeakPtr.h>
+
+#if USE(APPLE_INTERNAL_SDK)
+#include <WebKitAdditions/WebPaymentCoordinatorProxyAdditions.h>
+#endif
+
+namespace IPC {
+class Connection;
+class MessageReceiverMap;
+}
+
+namespace WebCore {
+enum class PaymentAuthorizationStatus;
+class Payment;
+class PaymentContact;
+class PaymentMerchantSession;
+class PaymentMethod;
+}
+
+OBJC_CLASS NSObject;
+OBJC_CLASS NSWindow;
+OBJC_CLASS PKPaymentAuthorizationViewController;
+OBJC_CLASS PKPaymentRequest;
+OBJC_CLASS UIViewController;
+OBJC_CLASS WKPaymentAuthorizationViewControllerDelegate;
+
+namespace WebKit {
+
+class WebPageProxy;
+
+class WebPaymentCoordinatorProxy : private IPC::MessageReceiver, private IPC::MessageSender, public CanMakeWeakPtr<WebPaymentCoordinatorProxy> {
+public:
+ struct Client {
+ virtual ~Client() = default;
+
+ virtual IPC::Connection* paymentCoordinatorConnection(const WebPaymentCoordinatorProxy&) = 0;
+ virtual IPC::MessageReceiverMap& paymentCoordinatorMessageReceiver(const WebPaymentCoordinatorProxy&) = 0;
+ virtual const String& paymentCoordinatorSourceApplicationBundleIdentifier(const WebPaymentCoordinatorProxy&) = 0;
+ virtual const String& paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&) = 0;
+ virtual uint64_t paymentCoordinatorDestinationID(const WebPaymentCoordinatorProxy&) = 0;
+#if PLATFORM(IOS_FAMILY)
+ virtual UIViewController *paymentCoordinatorPresentingViewController(const WebPaymentCoordinatorProxy&) = 0;
+ virtual const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&) = 0;
+#endif
+#if PLATFORM(MAC)
+ virtual NSWindow *paymentCoordinatorPresentingWindow(const WebPaymentCoordinatorProxy&) = 0;
+#endif
+ };
+
+ explicit WebPaymentCoordinatorProxy(Client&);
+ ~WebPaymentCoordinatorProxy();
+
+ void didCancelPaymentSession();
+ void validateMerchant(const URL&);
+ void didAuthorizePayment(const WebCore::Payment&);
+ void didSelectShippingMethod(const WebCore::ApplePaySessionPaymentRequest::ShippingMethod&);
+ void didSelectShippingContact(const WebCore::PaymentContact&);
+ void didSelectPaymentMethod(const WebCore::PaymentMethod&);
+
+ void hidePaymentUI();
+
+private:
+ // IPC::MessageReceiver
+ void didReceiveMessage(IPC::Connection&, IPC::Decoder&) override;
+ void didReceiveSyncMessage(IPC::Connection&, IPC::Decoder&, std::unique_ptr<IPC::Encoder>&) override;
+
+ // IPC::MessageSender
+ IPC::Connection* messageSenderConnection() const final;
+ uint64_t messageSenderDestinationID() const final;
+
+ // Message handlers
+ void availablePaymentNetworks(CompletionHandler<void(Vector<String>&&)>&&);
+ void canMakePayments(CompletionHandler<void(bool)>&&);
+ 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&, CompletionHandler<void(bool)>&&);
+ void completeMerchantValidation(const WebCore::PaymentMerchantSession&);
+ void completeShippingMethodSelection(const Optional<WebCore::ShippingMethodUpdate>&);
+ void completeShippingContactSelection(const Optional<WebCore::ShippingContactUpdate>&);
+ void completePaymentMethodSelection(const Optional<WebCore::PaymentMethodUpdate>&);
+ void completePaymentSession(const 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 URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&, CompletionHandler<void(bool)>&&);
+ void platformCompleteMerchantValidation(const WebCore::PaymentMerchantSession&);
+ void platformCompleteShippingMethodSelection(const Optional<WebCore::ShippingMethodUpdate>&);
+ void platformCompleteShippingContactSelection(const Optional<WebCore::ShippingContactUpdate>&);
+ void platformCompletePaymentMethodSelection(const Optional<WebCore::PaymentMethodUpdate>&);
+ void platformCompletePaymentSession(const Optional<WebCore::PaymentAuthorizationResult>&);
+#if PLATFORM(COCOA)
+ RetainPtr<PKPaymentRequest> platformPaymentRequest(const URL& originatingURL, const Vector<URL>& linkIconURLs, const WebCore::ApplePaySessionPaymentRequest&);
+#endif
+
+ Client& m_client;
+
+ 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 { State::Idle };
+
+ 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 { MerchantValidationState::Idle };
+
+ RetainPtr<PKPaymentAuthorizationViewController> m_paymentAuthorizationViewController;
+ RetainPtr<WKPaymentAuthorizationViewControllerDelegate> m_paymentAuthorizationViewControllerDelegate;
+
+#if PLATFORM(MAC)
+ uint64_t m_showPaymentUIRequestSeed { 0 };
+ RetainPtr<NSWindow> m_sheetWindow;
+ RetainPtr<NSObject> m_sheetWindowWillCloseObserver;
+#endif
+
+#if defined(WEBPAYMENTCOORDINATORPROXY_ADDITIONS)
+WEBPAYMENTCOORDINATORPROXY_ADDITIONS
+#undef WEBPAYMENTCOORDINATORPROXY_ADDITIONS
+#else
+ void finishConstruction(WebPaymentCoordinatorProxy&) { }
+#endif
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitSharedApplePayWebPaymentCoordinatorProxymessagesinfromrev242355trunkSourceWebKitUIProcessApplePayWebPaymentCoordinatorProxymessagesin"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in (from rev 242355, trunk/Source/WebKit/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in) (0 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in (rev 0)
+++ trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -0,0 +1,44 @@
</span><ins>+# Copyright (C) 2015-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)
+
+messages -> WebPaymentCoordinatorProxy {
+
+ AvailablePaymentNetworks() -> (Vector<String> availablePaymentNetworks) Delayed
+ CanMakePayments() -> (bool result) Delayed
+ 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) Delayed
+ CompleteMerchantValidation(WebCore::PaymentMerchantSession paymentMerchantSession)
+ CompleteShippingMethodSelection(Optional<WebCore::ShippingMethodUpdate> update)
+ CompleteShippingContactSelection(Optional<WebCore::ShippingContactUpdate> update)
+ CompletePaymentMethodSelection(Optional<WebCore::PaymentMethodUpdate> update)
+ CompletePaymentSession(Optional<WebCore::PaymentAuthorizationResult> result)
+ AbortPaymentSession()
+ CancelPaymentSession()
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitSharedApplePaycocoaWebPaymentCoordinatorProxyCocoahfromrev242355trunkSourceWebKitUIProcessApplePaycocoaWebPaymentCoordinatorProxyCocoah"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h (from rev 242355, trunk/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h) (0 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h (rev 0)
+++ trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2016-2019 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)
+
+#import "WebPaymentCoordinatorProxy.h"
+#import <WebCore/PaymentHeaders.h>
+#import <pal/spi/cocoa/PassKitSPI.h>
+#import <wtf/BlockPtr.h>
+
+@interface WKPaymentAuthorizationViewControllerDelegate : NSObject <PKPaymentAuthorizationViewControllerDelegate, PKPaymentAuthorizationViewControllerPrivateDelegate> {
+@package
+ WebKit::WebPaymentCoordinatorProxy* _webPaymentCoordinatorProxy;
+ RetainPtr<NSArray> _paymentSummaryItems;
+ RetainPtr<NSArray> _shippingMethods;
+
+ BlockPtr<void(PKPaymentMerchantSession *, NSError *)> _sessionBlock;
+
+ BOOL _didReachFinalState;
+#if HAVE(PASSKIT_GRANULAR_ERRORS)
+ 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::WebPaymentCoordinatorProxy&)webPaymentCoordinatorProxy;
+
+- (void)invalidate;
+
+@end
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitSharedApplePaycocoaWebPaymentCoordinatorProxyCocoammfromrev242355trunkSourceWebKitUIProcessApplePaycocoaWebPaymentCoordinatorProxyCocoamm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (from rev 242355, trunk/Source/WebKit/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm) (0 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (rev 0)
+++ trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -0,0 +1,802 @@
</span><ins>+/*
+ * Copyright (C) 2016-2019 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 "WebPaymentCoordinatorProxyCocoa.h"
+
+#if ENABLE(APPLE_PAY)
+
+#import "WebPaymentCoordinatorProxy.h"
+#import "WebProcessPool.h"
+#import <WebCore/PaymentAuthorizationStatus.h>
+#import <WebCore/PaymentHeaders.h>
+#import <pal/cocoa/PassKitSoftLink.h>
+#import <wtf/BlockPtr.h>
+#import <wtf/RunLoop.h>
+#import <wtf/URL.h>
+
+#if HAVE(PASSKIT_GRANULAR_ERRORS)
+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 WKPaymentAuthorizationViewControllerDelegate
+
+- (instancetype)initWithPaymentCoordinatorProxy:(WebKit::WebPaymentCoordinatorProxy&)webPaymentCoordinatorProxy
+{
+ if (!(self = [super init]))
+ return nullptr;
+
+ _webPaymentCoordinatorProxy = &webPaymentCoordinatorProxy;
+
+ return self;
+}
+
+- (void)invalidate
+{
+ _webPaymentCoordinatorProxy = nullptr;
+ if (_paymentAuthorizedCompletion) {
+#if HAVE(PASSKIT_GRANULAR_ERRORS)
+ _paymentAuthorizedCompletion(adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get());
+#else
+ _paymentAuthorizedCompletion(PKPaymentAuthorizationStatusFailure);
+#endif
+ _paymentAuthorizedCompletion = nullptr;
+ }
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller willFinishWithError:(NSError *)error
+{
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)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 (!_webPaymentCoordinatorProxy) {
+ _sessionBlock(nullptr, nullptr);
+ return;
+ }
+
+ _webPaymentCoordinatorProxy->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 HAVE(PASSKIT_GRANULAR_ERRORS)
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didAuthorizePayment:(PKPayment *)payment handler:(void (^)(PKPaymentAuthorizationResult *result))completion
+{
+ if (!_webPaymentCoordinatorProxy) {
+ completion(adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:PKPaymentAuthorizationStatusFailure errors:@[ ]]).get());
+ return;
+ }
+
+ ASSERT(!_paymentAuthorizedCompletion);
+ _paymentAuthorizedCompletion = completion;
+
+ _webPaymentCoordinatorProxy->didAuthorizePayment(WebCore::Payment(payment));
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectPaymentMethod:(PKPaymentMethod *)paymentMethod handler:(void (^)(PKPaymentRequestPaymentMethodUpdate *update))completion
+{
+ if (!_webPaymentCoordinatorProxy) {
+ completion(adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());
+ return;
+ }
+
+ ASSERT(!_didSelectPaymentMethodCompletion);
+ _didSelectPaymentMethodCompletion = completion;
+ _webPaymentCoordinatorProxy->didSelectPaymentMethod(WebCore::PaymentMethod(paymentMethod));
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectShippingMethod:(PKShippingMethod *)shippingMethod handler:(void (^)(PKPaymentRequestShippingMethodUpdate *update))completion {
+ if (!_webPaymentCoordinatorProxy) {
+ completion(adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:@[ ]]).get());
+ return;
+ }
+
+ ASSERT(!_didSelectShippingMethodCompletion);
+ _didSelectShippingMethodCompletion = completion;
+ _webPaymentCoordinatorProxy->didSelectShippingMethod(toShippingMethod(shippingMethod));
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectShippingContact:(PKContact *)contact handler:(void (^)(PKPaymentRequestShippingContactUpdate *update))completion
+{
+ if (!_webPaymentCoordinatorProxy) {
+ completion(adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:@[ ] paymentSummaryItems:@[ ] shippingMethods:@[ ]]).get());
+ return;
+ }
+
+ ASSERT(!_didSelectShippingContactCompletion);
+ _didSelectShippingContactCompletion = completion;
+ _webPaymentCoordinatorProxy->didSelectShippingContact(WebCore::PaymentContact(contact));
+}
+
+#endif
+
+#if !HAVE(PASSKIT_GRANULAR_ERRORS)
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didAuthorizePayment:(PKPayment *)payment completion:(void (^)(PKPaymentAuthorizationStatus))completion
+{
+ if (!_webPaymentCoordinatorProxy) {
+ completion(PKPaymentAuthorizationStatusFailure);
+ return;
+ }
+
+ ASSERT(!_paymentAuthorizedCompletion);
+ _paymentAuthorizedCompletion = completion;
+
+ _webPaymentCoordinatorProxy->didAuthorizePayment(WebCore::Payment(payment));
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectShippingMethod:(PKShippingMethod *)shippingMethod completion:(void (^)(PKPaymentAuthorizationStatus status, NSArray<PKPaymentSummaryItem *> *summaryItems))completion
+{
+ if (!_webPaymentCoordinatorProxy) {
+ completion(PKPaymentAuthorizationStatusFailure, @[ ]);
+ return;
+ }
+
+ ASSERT(!_didSelectShippingMethodCompletion);
+ _didSelectShippingMethodCompletion = completion;
+ _webPaymentCoordinatorProxy->didSelectShippingMethod(toShippingMethod(shippingMethod));
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectPaymentMethod:(PKPaymentMethod *)paymentMethod completion:(void (^)(NSArray<PKPaymentSummaryItem *> *summaryItems))completion
+{
+ if (!_webPaymentCoordinatorProxy) {
+ completion(@[ ]);
+ return;
+ }
+
+ ASSERT(!_didSelectPaymentMethodCompletion);
+ _didSelectPaymentMethodCompletion = completion;
+
+ _webPaymentCoordinatorProxy->didSelectPaymentMethod(WebCore::PaymentMethod(paymentMethod));
+}
+
+- (void)paymentAuthorizationViewController:(PKPaymentAuthorizationViewController *)controller didSelectShippingContact:(PKContact *)contact completion:(void (^)(PKPaymentAuthorizationStatus status, NSArray<PKShippingMethod *> *shippingMethods, NSArray<PKPaymentSummaryItem *> *summaryItems))completion
+{
+ if (!_webPaymentCoordinatorProxy) {
+ completion(PKPaymentAuthorizationStatusFailure, @[ ], @[ ]);
+ return;
+ }
+
+ ASSERT(!_didSelectShippingContactCompletion);
+ _didSelectShippingContactCompletion = completion;
+ _webPaymentCoordinatorProxy->didSelectShippingContact(WebCore::PaymentContact(contact));
+}
+
+#endif
+
+- (void)paymentAuthorizationViewControllerDidFinish:(PKPaymentAuthorizationViewController *)controller
+{
+ if (!_webPaymentCoordinatorProxy)
+ return;
+
+ if (!_didReachFinalState)
+ _webPaymentCoordinatorProxy->didCancelPaymentSession();
+
+ _webPaymentCoordinatorProxy->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 WebPaymentCoordinatorProxy::platformCanMakePayments()
+{
+ return [PAL::getPKPaymentAuthorizationViewControllerClass() canMakePayments];
+}
+
+void WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler)
+{
+#if HAVE(PASSKIT_GRANULAR_ERRORS)
+ PKCanMakePaymentsWithMerchantIdentifierDomainAndSourceApplication(merchantIdentifier, domainName, m_client.paymentCoordinatorSourceApplicationSecondaryIdentifier(*this), makeBlockPtr([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, makeBlockPtr([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 WebPaymentCoordinatorProxy::platformOpenPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler)
+{
+ auto passLibrary = adoptNS([PAL::allocPKPassLibraryInstance() init]);
+ [passLibrary openPaymentSetupForMerchantIdentifier:merchantIdentifier domain:domainName completion:makeBlockPtr([completionHandler = WTFMove(completionHandler)](BOOL result) mutable {
+ RunLoop::main().dispatch([completionHandler = WTFMove(completionHandler), result] {
+ completionHandler(result);
+ });
+ }).get()];
+}
+
+#if HAVE(PASSKIT_GRANULAR_ERRORS)
+static RetainPtr<NSSet> toPKContactFields(const WebCore::ApplePaySessionPaymentRequest::ContactFields& contactFields)
+{
+ Vector<NSString *> result;
+
+ if (contactFields.postalAddress)
+ result.append(PAL::get_PassKit_PKContactFieldPostalAddress());
+ if (contactFields.phone)
+ result.append(PAL::get_PassKit_PKContactFieldPhoneNumber());
+ if (contactFields.email)
+ result.append(PAL::get_PassKit_PKContactFieldEmailAddress());
+ if (contactFields.name)
+ result.append(PAL::get_PassKit_PKContactFieldName());
+ if (contactFields.phoneticName)
+ result.append(PAL::get_PassKit_PKContactFieldPhoneticName());
+
+ return adoptNS([[NSSet alloc] initWithObjects:result.data() count:result.size()]);
+}
+#else
+static PKAddressField toPKAddressField(const WebCore::ApplePaySessionPaymentRequest::ContactFields& contactFields)
+{
+ PKAddressField result = 0;
+
+ if (contactFields.postalAddress)
+ result |= PKAddressFieldPostalAddress;
+ if (contactFields.phone)
+ result |= PKAddressFieldPhone;
+ if (contactFields.email)
+ result |= PKAddressFieldEmail;
+ if (contactFields.name)
+ result |= PKAddressFieldName;
+
+ return result;
+}
+#endif
+
+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 PKMerchantCapability toPKMerchantCapabilities(const WebCore::ApplePaySessionPaymentRequest::MerchantCapabilities& merchantCapabilities)
+{
+ PKMerchantCapability result = 0;
+ if (merchantCapabilities.supports3DS)
+ result |= PKMerchantCapability3DS;
+ if (merchantCapabilities.supportsEMV)
+ result |= PKMerchantCapabilityEMV;
+ if (merchantCapabilities.supportsCredit)
+ result |= PKMerchantCapabilityCredit;
+ if (merchantCapabilities.supportsDebit)
+ result |= PKMerchantCapabilityDebit;
+
+ return result;
+}
+
+static RetainPtr<NSArray> toSupportedNetworks(const Vector<String>& supportedNetworks)
+{
+ auto result = adoptNS([[NSMutableArray alloc] initWithCapacity:supportedNetworks.size()]);
+ for (auto& supportedNetwork : supportedNetworks)
+ [result addObject:supportedNetwork];
+ return result;
+}
+
+static PKShippingType toPKShippingType(WebCore::ApplePaySessionPaymentRequest::ShippingType shippingType)
+{
+ switch (shippingType) {
+ case WebCore::ApplePaySessionPaymentRequest::ShippingType::Shipping:
+ return PKShippingTypeShipping;
+
+ case WebCore::ApplePaySessionPaymentRequest::ShippingType::Delivery:
+ return PKShippingTypeDelivery;
+
+ case WebCore::ApplePaySessionPaymentRequest::ShippingType::StorePickup:
+ return PKShippingTypeStorePickup;
+
+ case WebCore::ApplePaySessionPaymentRequest::ShippingType::ServicePickup:
+ return PKShippingTypeServicePickup;
+ }
+}
+
+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;
+}
+
+#if HAVE(PASSKIT_GRANULAR_ERRORS)
+static RetainPtr<NSSet> toNSSet(const Vector<String>& strings)
+{
+ if (strings.isEmpty())
+ return nil;
+
+ auto mutableSet = adoptNS([[NSMutableSet alloc] initWithCapacity:strings.size()]);
+ for (auto& string : strings)
+ [mutableSet addObject:string];
+
+ return WTFMove(mutableSet);
+}
+
+static PKPaymentRequestAPIType toAPIType(WebCore::ApplePaySessionPaymentRequest::Requester requester)
+{
+ switch (requester) {
+ case WebCore::ApplePaySessionPaymentRequest::Requester::ApplePayJS:
+ return PKPaymentRequestAPITypeWebJS;
+ case WebCore::ApplePaySessionPaymentRequest::Requester::PaymentRequest:
+ return PKPaymentRequestAPITypeWebPaymentRequest;
+ }
+}
+#endif
+
+RetainPtr<PKPaymentRequest> WebPaymentCoordinatorProxy::platformPaymentRequest(const URL& originatingURL, const Vector<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 HAVE(PASSKIT_GRANULAR_ERRORS)
+ [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 HAVE(PASSKIT_GRANULAR_ERRORS)
+ [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 HAVE(PASSKIT_GRANULAR_ERRORS)
+ [result setSupportedCountries:toNSSet(paymentRequest.supportedCountries()).get()];
+#endif
+
+ // FIXME: Instead of using respondsToSelector, this should use a proper #if version check.
+ auto& bundleIdentifier = m_client.paymentCoordinatorSourceApplicationBundleIdentifier(*this);
+ if (!bundleIdentifier.isEmpty() && [result respondsToSelector:@selector(setSourceApplicationBundleIdentifier:)])
+ [result setSourceApplicationBundleIdentifier:bundleIdentifier];
+
+ auto& secondaryIdentifier = m_client.paymentCoordinatorSourceApplicationSecondaryIdentifier(*this);
+ if (!secondaryIdentifier.isEmpty() && [result respondsToSelector:@selector(setSourceApplicationSecondaryIdentifier:)])
+ [result setSourceApplicationSecondaryIdentifier:secondaryIdentifier];
+
+#if PLATFORM(IOS_FAMILY)
+ auto& serviceType = m_client.paymentCoordinatorCTDataConnectionServiceType(*this);
+ if (!serviceType.isEmpty() && [result respondsToSelector:@selector(setCTDataConnectionServiceType:)])
+ [result setCTDataConnectionServiceType:serviceType];
+#endif
+
+ return result;
+}
+
+#if HAVE(PASSKIT_GRANULAR_ERRORS)
+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 (const auto& error : errors) {
+ if (auto nsError = toNSError(error))
+ [result addObject:nsError.get()];
+ }
+
+ return result;
+}
+#else
+static PKPaymentAuthorizationStatus toPKPaymentAuthorizationStatus(const 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 WebPaymentCoordinatorProxy::platformCompletePaymentSession(const Optional<WebCore::PaymentAuthorizationResult>& result)
+{
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+
+ m_paymentAuthorizationViewControllerDelegate->_didReachFinalState = WebCore::isFinalStateResult(result);
+
+#if HAVE(PASSKIT_GRANULAR_ERRORS)
+ auto status = result ? result->status : WebCore::PaymentAuthorizationStatus::Success;
+ auto pkPaymentAuthorizationResult = adoptNS([PAL::allocPKPaymentAuthorizationResultInstance() initWithStatus:toPKPaymentAuthorizationStatus(status) errors:result ? toNSErrors(result->errors).get() : @[ ]]);
+ m_paymentAuthorizationViewControllerDelegate->_paymentAuthorizedCompletion(pkPaymentAuthorizationResult.get());
+#else
+ m_paymentAuthorizationViewControllerDelegate->_paymentAuthorizedCompletion(toPKPaymentAuthorizationStatus(result));
+#endif
+ m_paymentAuthorizationViewControllerDelegate->_paymentAuthorizedCompletion = nullptr;
+}
+
+void WebPaymentCoordinatorProxy::platformCompleteMerchantValidation(const WebCore::PaymentMerchantSession& paymentMerchantSession)
+{
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+
+ m_paymentAuthorizationViewControllerDelegate->_sessionBlock(paymentMerchantSession.pkPaymentMerchantSession(), nullptr);
+ m_paymentAuthorizationViewControllerDelegate->_sessionBlock = nullptr;
+}
+
+void WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection(const Optional<WebCore::ShippingMethodUpdate>& update)
+{
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+
+ if (update)
+ m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = toPKPaymentSummaryItems(update->newTotalAndLineItems);
+
+#if HAVE(PASSKIT_GRANULAR_ERRORS)
+ auto pkShippingMethodUpdate = adoptNS([PAL::allocPKPaymentRequestShippingMethodUpdateInstance() initWithPaymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get()]);
+ m_paymentAuthorizationViewControllerDelegate->_didSelectShippingMethodCompletion(pkShippingMethodUpdate.get());
+#else
+ m_paymentAuthorizationViewControllerDelegate->_didSelectShippingMethodCompletion(PKPaymentAuthorizationStatusSuccess, m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get());
+#endif
+ m_paymentAuthorizationViewControllerDelegate->_didSelectShippingMethodCompletion = nullptr;
+}
+
+#if !HAVE(PASSKIT_GRANULAR_ERRORS)
+static PKPaymentAuthorizationStatus toPKPaymentAuthorizationStatus(const 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 WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection(const Optional<WebCore::ShippingContactUpdate>& update)
+{
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+
+ if (update) {
+ m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = toPKPaymentSummaryItems(update->newTotalAndLineItems);
+
+ auto shippingMethods = adoptNS([[NSMutableArray alloc] init]);
+ for (auto& shippingMethod : update->newShippingMethods)
+ [shippingMethods addObject:toPKShippingMethod(shippingMethod).get()];
+
+ m_paymentAuthorizationViewControllerDelegate->_shippingMethods = WTFMove(shippingMethods);
+ }
+
+#if HAVE(PASSKIT_GRANULAR_ERRORS)
+ auto pkShippingContactUpdate = adoptNS([PAL::allocPKPaymentRequestShippingContactUpdateInstance() initWithErrors:update ? toNSErrors(update->errors).get() : @[ ] paymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get() shippingMethods:m_paymentAuthorizationViewControllerDelegate->_shippingMethods.get()]);
+ m_paymentAuthorizationViewControllerDelegate->_didSelectShippingContactCompletion(pkShippingContactUpdate.get());
+#else
+ m_paymentAuthorizationViewControllerDelegate->_didSelectShippingContactCompletion(toPKPaymentAuthorizationStatus(update), m_paymentAuthorizationViewControllerDelegate->_shippingMethods.get(), m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get());
+#endif
+ m_paymentAuthorizationViewControllerDelegate->_didSelectShippingContactCompletion = nullptr;
+}
+
+void WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection(const Optional<WebCore::PaymentMethodUpdate>& update)
+{
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+
+ if (update)
+ m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = toPKPaymentSummaryItems(update->newTotalAndLineItems);
+
+#if HAVE(PASSKIT_GRANULAR_ERRORS)
+ auto pkPaymentMethodUpdate = adoptNS([PAL::allocPKPaymentRequestPaymentMethodUpdateInstance() initWithPaymentSummaryItems:m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get()]);
+ m_paymentAuthorizationViewControllerDelegate->_didSelectPaymentMethodCompletion(pkPaymentMethodUpdate.get());
+#else
+ m_paymentAuthorizationViewControllerDelegate->_didSelectPaymentMethodCompletion(m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems.get());
+#endif
+ m_paymentAuthorizationViewControllerDelegate->_didSelectPaymentMethodCompletion = nullptr;
+}
+
+Vector<String> WebPaymentCoordinatorProxy::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)
</ins></span></pre></div>
<a id="trunkSourceWebKitSharedApplePayiosWebPaymentCoordinatorProxyIOSmmfromrev242355trunkSourceWebKitUIProcessApplePayiosWebPaymentCoordinatorProxyIOSmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm (from rev 242355, trunk/Source/WebKit/UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm) (0 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm (rev 0)
+++ trunk/Source/WebKit/Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+/*
+ * Copyright (C) 2016-2019 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 "WebPaymentCoordinatorProxy.h"
+
+#if PLATFORM(IOS_FAMILY) && ENABLE(APPLE_PAY)
+
+#import "APIUIClient.h"
+#import "WebPageProxy.h"
+#import "WebPaymentCoordinatorProxyCocoa.h"
+#import <PassKit/PassKit.h>
+#import <UIKit/UIViewController.h>
+#import <WebCore/PaymentAuthorizationStatus.h>
+#import <pal/cocoa/PassKitSoftLink.h>
+
+namespace WebKit {
+
+void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler)
+{
+ UIViewController *presentingViewController = m_client.paymentCoordinatorPresentingViewController(*this);
+
+ if (!presentingViewController) {
+ completionHandler(false);
+ return;
+ }
+
+ ASSERT(!m_paymentAuthorizationViewController);
+
+ auto paymentRequest = platformPaymentRequest(originatingURL, linkIconURLStrings, request);
+
+ m_paymentAuthorizationViewController = adoptNS([PAL::allocPKPaymentAuthorizationViewControllerInstance() initWithPaymentRequest:paymentRequest.get()]);
+ if (!m_paymentAuthorizationViewController) {
+ completionHandler(false);
+ return;
+ }
+
+ m_paymentAuthorizationViewControllerDelegate = adoptNS([[WKPaymentAuthorizationViewControllerDelegate alloc] initWithPaymentCoordinatorProxy:*this]);
+ m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = [paymentRequest paymentSummaryItems];
+ m_paymentAuthorizationViewControllerDelegate->_shippingMethods = [paymentRequest shippingMethods];
+
+ [m_paymentAuthorizationViewController setDelegate:m_paymentAuthorizationViewControllerDelegate.get()];
+ [m_paymentAuthorizationViewController setPrivateDelegate:m_paymentAuthorizationViewControllerDelegate.get()];
+
+ [presentingViewController presentViewController:m_paymentAuthorizationViewController.get() animated:YES completion:nullptr];
+
+ completionHandler(true);
+}
+
+void WebPaymentCoordinatorProxy::hidePaymentUI()
+{
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+
+ [[m_paymentAuthorizationViewController presentingViewController] dismissViewControllerAnimated:YES completion:nullptr];
+ [m_paymentAuthorizationViewController setDelegate:nil];
+ [m_paymentAuthorizationViewController setPrivateDelegate:nil];
+ m_paymentAuthorizationViewController = nullptr;
+
+ [m_paymentAuthorizationViewControllerDelegate invalidate];
+ m_paymentAuthorizationViewControllerDelegate = nullptr;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitSharedApplePaymacWebPaymentCoordinatorProxyMacmmfromrev242355trunkSourceWebKitUIProcessApplePaymacWebPaymentCoordinatorProxyMacmm"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebKit/Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm (from rev 242355, trunk/Source/WebKit/UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm) (0 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm (rev 0)
+++ trunk/Source/WebKit/Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -0,0 +1,119 @@
</span><ins>+/*
+ * Copyright (C) 2016-2019 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 "WebPaymentCoordinatorProxy.h"
+
+#if PLATFORM(MAC) && ENABLE(APPLE_PAY)
+
+#import "WebPageProxy.h"
+#import "WebPaymentCoordinatorProxyCocoa.h"
+#import <pal/cocoa/PassKitSoftLink.h>
+#import <wtf/BlockPtr.h>
+
+namespace WebKit {
+
+void WebPaymentCoordinatorProxy::platformShowPaymentUI(const URL& originatingURL, const Vector<URL>& linkIconURLStrings, const WebCore::ApplePaySessionPaymentRequest& request, CompletionHandler<void(bool)>&& completionHandler)
+{
+ auto paymentRequest = platformPaymentRequest(originatingURL, linkIconURLStrings, request);
+
+ auto showPaymentUIRequestSeed = m_showPaymentUIRequestSeed;
+ auto weakThis = makeWeakPtr(*this);
+ [PAL::getPKPaymentAuthorizationViewControllerClass() requestViewControllerWithPaymentRequest:paymentRequest.get() completion:makeBlockPtr([paymentRequest, showPaymentUIRequestSeed, weakThis, completionHandler = WTFMove(completionHandler)](PKPaymentAuthorizationViewController *viewController, NSError *error) mutable {
+ auto paymentCoordinatorProxy = weakThis.get();
+ if (!paymentCoordinatorProxy)
+ return completionHandler(false);
+
+ if (error) {
+ LOG_ERROR("+[PKPaymentAuthorizationViewController requestViewControllerWithPaymentRequest:completion:] error %@", error);
+
+ completionHandler(false);
+ return;
+ }
+
+ if (showPaymentUIRequestSeed != paymentCoordinatorProxy->m_showPaymentUIRequestSeed) {
+ // We've already been asked to hide the payment UI. Don't attempt to show it.
+ return completionHandler(false);
+ }
+
+ NSWindow *presentingWindow = paymentCoordinatorProxy->m_client.paymentCoordinatorPresentingWindow(*paymentCoordinatorProxy);
+ if (!presentingWindow)
+ return completionHandler(false);
+
+ ASSERT(viewController);
+
+ paymentCoordinatorProxy->m_paymentAuthorizationViewControllerDelegate = adoptNS([[WKPaymentAuthorizationViewControllerDelegate alloc] initWithPaymentCoordinatorProxy:*paymentCoordinatorProxy]);
+ paymentCoordinatorProxy->m_paymentAuthorizationViewControllerDelegate->_paymentSummaryItems = [paymentRequest paymentSummaryItems];
+ paymentCoordinatorProxy->m_paymentAuthorizationViewControllerDelegate->_shippingMethods = [paymentRequest shippingMethods];
+ paymentCoordinatorProxy->m_paymentAuthorizationViewController = viewController;
+ [paymentCoordinatorProxy->m_paymentAuthorizationViewController setDelegate:paymentCoordinatorProxy->m_paymentAuthorizationViewControllerDelegate.get()];
+ [paymentCoordinatorProxy->m_paymentAuthorizationViewController setPrivateDelegate:paymentCoordinatorProxy->m_paymentAuthorizationViewControllerDelegate.get()];
+
+ ASSERT(!paymentCoordinatorProxy->m_sheetWindow);
+ paymentCoordinatorProxy->m_sheetWindow = [NSWindow windowWithContentViewController:viewController];
+
+ paymentCoordinatorProxy->m_sheetWindowWillCloseObserver = [[NSNotificationCenter defaultCenter] addObserverForName:NSWindowWillCloseNotification object:paymentCoordinatorProxy->m_sheetWindow.get() queue:nil usingBlock:[paymentCoordinatorProxy](NSNotification *) {
+ paymentCoordinatorProxy->hidePaymentUI();
+ paymentCoordinatorProxy->didReachFinalState();
+ }];
+
+ [presentingWindow beginSheet:paymentCoordinatorProxy->m_sheetWindow.get() completionHandler:nullptr];
+
+ completionHandler(true);
+ }).get()];
+}
+
+void WebPaymentCoordinatorProxy::hidePaymentUI()
+{
+ if (m_state == State::Activating) {
+ ++m_showPaymentUIRequestSeed;
+
+ ASSERT(!m_paymentAuthorizationViewController);
+ ASSERT(!m_paymentAuthorizationViewControllerDelegate);
+ ASSERT(!m_sheetWindow);
+ return;
+ }
+
+ ASSERT(m_paymentAuthorizationViewController);
+ ASSERT(m_paymentAuthorizationViewControllerDelegate);
+ ASSERT(m_sheetWindow);
+
+ [[NSNotificationCenter defaultCenter] removeObserver:m_sheetWindowWillCloseObserver.get()];
+ m_sheetWindowWillCloseObserver = nullptr;
+
+ [[m_sheetWindow sheetParent] endSheet:m_sheetWindow.get()];
+ [m_paymentAuthorizationViewController setDelegate:nil];
+ [m_paymentAuthorizationViewController setPrivateDelegate:nil];
+ m_paymentAuthorizationViewController = nullptr;
+
+ [m_paymentAuthorizationViewControllerDelegate invalidate];
+ m_paymentAuthorizationViewControllerDelegate = nullptr;
+
+ m_sheetWindow = nullptr;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitSharedmacWebHitTestResultDatamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/mac/WebHitTestResultData.mm (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/mac/WebHitTestResultData.mm 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WebKit/Shared/mac/WebHitTestResultData.mm 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx">
</span><span class="cx"> #import "ArgumentCodersCF.h"
</span><ins>+#import "ArgumentCodersCocoa.h"
</ins><span class="cx"> #import "Decoder.h"
</span><span class="cx"> #import "Encoder.h"
</span><span class="cx"> #import "WebCoreArgumentCoders.h"
</span></span></pre></div>
<a id="trunkSourceWebKitSourcesCocoatxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/SourcesCocoa.txt (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/SourcesCocoa.txt 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WebKit/SourcesCocoa.txt 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -113,6 +113,11 @@
</span><span class="cx"> Shared/API/Cocoa/WKRemoteObject.mm
</span><span class="cx"> Shared/API/Cocoa/WKRemoteObjectCoder.mm
</span><span class="cx">
</span><ins>+Shared/ApplePay/WebPaymentCoordinatorProxy.cpp
+Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
+Shared/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm
+Shared/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm
+
</ins><span class="cx"> Shared/APIWebArchive.mm
</span><span class="cx"> Shared/APIWebArchiveResource.mm
</span><span class="cx"> Shared/FocusedElementInformation.cpp
</span><span class="lines">@@ -214,8 +219,6 @@
</span><span class="cx"> UIProcess/WKImagePreviewViewController.mm
</span><span class="cx"> UIProcess/WKInspectorHighlightView.mm
</span><span class="cx">
</span><del>-UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp
-
</del><span class="cx"> UIProcess/API/APIWebsiteDataRecord.cpp
</span><span class="cx">
</span><span class="cx"> UIProcess/API/C/WKContextMenuListener.cpp
</span><span class="lines">@@ -302,12 +305,6 @@
</span><span class="cx">
</span><span class="cx"> UIProcess/API/mac/WKView.mm
</span><span class="cx">
</span><del>-UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
-
-UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm
-
-UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm
-
</del><span class="cx"> UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm
</span><span class="cx"> UIProcess/Authentication/cocoa/SecKeyProxyStore.mm
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeFrameScrollingNodeRemoteIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -44,8 +44,8 @@
</span><span class="cx"> void commitStateBeforeChildren(const WebCore::ScrollingStateNode&) override;
</span><span class="cx"> void commitStateAfterChildren(const WebCore::ScrollingStateNode&) override;
</span><span class="cx">
</span><del>- FloatPoint minimumScrollPosition() const override;
- FloatPoint maximumScrollPosition() const override;
</del><ins>+ WebCore::FloatPoint minimumScrollPosition() const override;
+ WebCore::FloatPoint maximumScrollPosition() const override;
</ins><span class="cx">
</span><span class="cx"> void repositionScrollingLayers() override;
</span><span class="cx"> void repositionRelatedLayers() override;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeFrameScrollingNodeRemoteIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -29,7 +29,9 @@
</span><span class="cx"> #if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)
</span><span class="cx">
</span><span class="cx"> #import "ScrollingTreeScrollingNodeDelegateIOS.h"
</span><ins>+#import <WebCore/ScrollingStateFrameScrollingNode.h>
</ins><span class="cx"> #import <WebCore/ScrollingStateScrollingNode.h>
</span><ins>+#import <WebCore/ScrollingTree.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> using namespace WebCore;
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeScrollingNodeDelegateIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.h 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> void repositionScrollingLayers();
</span><span class="cx">
</span><span class="cx"> #if ENABLE(POINTER_EVENTS)
</span><del>- Optional<TouchActionData> touchActionData() const;
</del><ins>+ Optional<WebCore::TouchActionData> touchActionData() const;
</ins><span class="cx"> void cancelPointersForGestureRecognizer(UIGestureRecognizer*);
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessRemoteLayerTreeiosScrollingTreeScrollingNodeDelegateIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeScrollingNodeDelegateIOS.mm 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -28,6 +28,10 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS_FAMILY) && ENABLE(ASYNC_SCROLLING)
</span><span class="cx">
</span><ins>+#import "RemoteScrollingCoordinatorProxy.h"
+#import "RemoteScrollingTree.h"
+#import "UIKitSPI.h"
+#import "WebPageProxy.h"
</ins><span class="cx"> #import <QuartzCore/QuartzCore.h>
</span><span class="cx"> #import <UIKit/UIPanGestureRecognizer.h>
</span><span class="cx"> #import <UIKit/UIScrollView.h>
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (242355 => 242356)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2019-03-04 16:44:51 UTC (rev 242355)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj 2019-03-04 16:47:58 UTC (rev 242356)
</span><span class="lines">@@ -4993,6 +4993,7 @@
</span><span class="cx"> isa = PBXGroup;
</span><span class="cx"> children = (
</span><span class="cx"> BCDDB314124EBCEF0048D13C /* API */,
</span><ins>+ 1AB1F7761D1B30A9007C9BD1 /* ApplePay */,
</ins><span class="cx"> 518E8EF116B208F000E91429 /* Authentication */,
</span><span class="cx"> 1AAF0C4712B16328008E49E2 /* cf */,
</span><span class="cx"> C01A25FF12662F2100C9ED55 /* cg */,
</span><span class="lines">@@ -7333,7 +7334,6 @@
</span><span class="cx"> isa = PBXGroup;
</span><span class="cx"> children = (
</span><span class="cx"> BC032DC410F4387C0058C15A /* API */,
</span><del>- 1AB1F7761D1B30A9007C9BD1 /* ApplePay */,
</del><span class="cx"> 512F588D12A8836F00629530 /* Authentication */,
</span><span class="cx"> 9955A6E81C79809000EB6A93 /* Automation */,
</span><span class="cx"> 1ABC3DF21899E415004F0626 /* Cocoa */,
</span></span></pre>
</div>
</div>
</body>
</html>