<!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>[213601] 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/213601">213601</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2017-03-08 14:56:22 -0800 (Wed, 08 Mar 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Simplify the PaymentCoordinator interface
https://bugs.webkit.org/show_bug.cgi?id=169382
Part of rdar://problem/28880714.

Reviewed by Tim Horton.

Source/WebCore:

Add four new structs: PaymentAuthorizationResult, PaymentMethodUpdate, ShippingContactUpdate and ShippingMethodUpdate.
Change the various PaymentCoordinator and PaymentCoordinatorClient functions to take these new objects instead of multiple parameters.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
(WebCore::ApplePaySession::completePayment):
(WebCore::ApplePaySession::didSelectShippingMethod):
(WebCore::ApplePaySession::didSelectShippingContact):
* Modules/applepay/PaymentAuthorizationStatus.h:
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::completeShippingMethodSelection):
(WebCore::PaymentCoordinator::completeShippingContactSelection):
(WebCore::PaymentCoordinator::completePaymentMethodSelection):
(WebCore::PaymentCoordinator::completePaymentSession):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/applepay/PaymentRequest.h:
* loader/EmptyClients.cpp:

Source/WebKit/mac:

Update for PaymentCoordinatorClient changes.

* WebCoreSupport/WebPaymentCoordinatorClient.h:
* WebCoreSupport/WebPaymentCoordinatorClient.mm:
(WebPaymentCoordinatorClient::completeShippingMethodSelection):
(WebPaymentCoordinatorClient::completeShippingContactSelection):
(WebPaymentCoordinatorClient::completePaymentMethodSelection):
(WebPaymentCoordinatorClient::completePaymentSession):

Source/WebKit2:

Send the new structs over the wire to the UI process and update the various proxy object to take them instead of
multiple parameters.

* Scripts/webkit/messages.py:
(headers_for_type):
* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder&lt;WebCore::PaymentAuthorizationResult&gt;::encode):
(IPC::ArgumentCoder&lt;WebCore::PaymentAuthorizationResult&gt;::decode):
(IPC::ArgumentCoder&lt;WebCore::PaymentError&gt;::encode):
(IPC::ArgumentCoder&lt;WebCore::PaymentError&gt;::decode):
(IPC::ArgumentCoder&lt;WebCore::PaymentMethodUpdate&gt;::encode):
(IPC::ArgumentCoder&lt;WebCore::PaymentMethodUpdate&gt;::decode):
(IPC::ArgumentCoder&lt;WebCore::ShippingContactUpdate&gt;::encode):
(IPC::ArgumentCoder&lt;WebCore::ShippingContactUpdate&gt;::decode):
(IPC::ArgumentCoder&lt;WebCore::ShippingMethodUpdate&gt;::encode):
(IPC::ArgumentCoder&lt;WebCore::ShippingMethodUpdate&gt;::decode):
* Shared/WebCoreArgumentCoders.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
(WebKit::isValidEnum): Deleted.
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
(WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
(WebKit::WebPaymentCoordinator::completeShippingContactSelection):
(WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
(WebKit::WebPaymentCoordinator::completePaymentSession):
* WebProcess/ApplePay/WebPaymentCoordinator.h:

Source/WTF:

* wtf/EnumTraits.h:
Fix a build warning.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtfEnumTraitsh">trunk/Source/WTF/wtf/EnumTraits.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepayApplePaySessioncpp">trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepayPaymentAuthorizationStatush">trunk/Source/WebCore/Modules/applepay/PaymentAuthorizationStatus.h</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepayPaymentCoordinatorcpp">trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepayPaymentCoordinatorh">trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.h</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepayPaymentCoordinatorClienth">trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h</a></li>
<li><a href="#trunkSourceWebCoreModulesapplepayPaymentRequesth">trunk/Source/WebCore/Modules/applepay/PaymentRequest.h</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientscpp">trunk/Source/WebCore/loader/EmptyClients.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebPaymentCoordinatorClienth">trunk/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebPaymentCoordinatorClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2Scriptswebkitmessagespy">trunk/Source/WebKit2/Scripts/webkit/messages.py</a></li>
<li><a href="#trunkSourceWebKit2SharedCocoaWebCoreArgumentCodersCocoamm">trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2SharedWebCoreArgumentCodersh">trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessApplePayWebPaymentCoordinatorProxycpp">trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessApplePayWebPaymentCoordinatorProxyh">trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessApplePayWebPaymentCoordinatorProxymessagesin">trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessApplePaycocoaWebPaymentCoordinatorProxyCocoamm">trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessApplePayWebPaymentCoordinatorcpp">trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessApplePayWebPaymentCoordinatorh">trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WTF/ChangeLog        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2017-03-08  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Simplify the PaymentCoordinator interface
+        https://bugs.webkit.org/show_bug.cgi?id=169382
+        Part of rdar://problem/28880714.
+
+        Reviewed by Tim Horton.
+
+        * wtf/EnumTraits.h:
+        Fix a build warning.
+
</ins><span class="cx"> 2017-03-06  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [iOS] Report domains crashing under memory pressure via enhanced privacy logging.
</span></span></pre></div>
<a id="trunkSourceWTFwtfEnumTraitsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/EnumTraits.h (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/EnumTraits.h        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WTF/wtf/EnumTraits.h        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T, typename E&gt;
</span><span class="cx"> struct EnumValueChecker&lt;T, EnumValues&lt;E&gt;&gt; {
</span><del>-    static constexpr bool isValidEnum(T t)
</del><ins>+    static constexpr bool isValidEnum(T)
</ins><span class="cx">     {
</span><span class="cx">         return false;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebCore/ChangeLog        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2017-03-08  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Simplify the PaymentCoordinator interface
+        https://bugs.webkit.org/show_bug.cgi?id=169382
+        Part of rdar://problem/28880714.
+
+        Reviewed by Tim Horton.
+
+        Add four new structs: PaymentAuthorizationResult, PaymentMethodUpdate, ShippingContactUpdate and ShippingMethodUpdate.
+        Change the various PaymentCoordinator and PaymentCoordinatorClient functions to take these new objects instead of multiple parameters.
+
+        * Modules/applepay/ApplePaySession.cpp:
+        (WebCore::ApplePaySession::completeShippingMethodSelection):
+        (WebCore::ApplePaySession::completeShippingContactSelection):
+        (WebCore::ApplePaySession::completePaymentMethodSelection):
+        (WebCore::ApplePaySession::completePayment):
+        (WebCore::ApplePaySession::didSelectShippingMethod):
+        (WebCore::ApplePaySession::didSelectShippingContact):
+        * Modules/applepay/PaymentAuthorizationStatus.h:
+        * Modules/applepay/PaymentCoordinator.cpp:
+        (WebCore::PaymentCoordinator::completeShippingMethodSelection):
+        (WebCore::PaymentCoordinator::completeShippingContactSelection):
+        (WebCore::PaymentCoordinator::completePaymentMethodSelection):
+        (WebCore::PaymentCoordinator::completePaymentSession):
+        * Modules/applepay/PaymentCoordinator.h:
+        * Modules/applepay/PaymentCoordinatorClient.h:
+        * Modules/applepay/PaymentRequest.h:
+        * loader/EmptyClients.cpp:
+
</ins><span class="cx"> 2017-03-08  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Change determineNonLayerDescendantsPaintedContent to max out based on renderers traversed
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepayApplePaySessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebCore/Modules/applepay/ApplePaySession.cpp        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -645,8 +645,12 @@
</span><span class="cx"> 
</span><span class="cx">     totalAndLineItems.lineItems = convertedNewLineItems.releaseReturnValue();
</span><span class="cx"> 
</span><ins>+    ShippingMethodUpdate update;
+    update.status = *authorizationStatus;
+    update.newTotalAndLineItems = WTFMove(totalAndLineItems);
+
</ins><span class="cx">     m_state = State::Active;
</span><del>-    paymentCoordinator().completeShippingMethodSelection(*authorizationStatus, totalAndLineItems);
</del><ins>+    paymentCoordinator().completeShippingMethodSelection(WTFMove(update));
</ins><span class="cx"> 
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="lines">@@ -682,8 +686,13 @@
</span><span class="cx"> 
</span><span class="cx">     totalAndLineItems.lineItems = convertedNewLineItems.releaseReturnValue();
</span><span class="cx"> 
</span><ins>+    ShippingContactUpdate update;
+    update.status = *authorizationStatus;
+    update.newShippingMethods = convertedNewShippingMethods.releaseReturnValue();
+    update.newTotalAndLineItems = WTFMove(totalAndLineItems);
+
</ins><span class="cx">     m_state = State::Active;
</span><del>-    paymentCoordinator().completeShippingContactSelection(*authorizationStatus, convertedNewShippingMethods.releaseReturnValue(), totalAndLineItems);
</del><ins>+    paymentCoordinator().completeShippingContactSelection(WTFMove(update));
</ins><span class="cx"> 
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="lines">@@ -711,8 +720,12 @@
</span><span class="cx"> 
</span><span class="cx">     totalAndLineItems.lineItems = convertedNewLineItems.releaseReturnValue();
</span><span class="cx"> 
</span><ins>+    PaymentMethodUpdate update;
+    update.status = PaymentAuthorizationStatus::Success;
+    update.newTotalAndLineItems = WTFMove(totalAndLineItems);
+
</ins><span class="cx">     m_state = State::Active;
</span><del>-    paymentCoordinator().completePaymentMethodSelection(totalAndLineItems);
</del><ins>+    paymentCoordinator().completePaymentMethodSelection(WTFMove(update));
</ins><span class="cx"> 
</span><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="lines">@@ -726,8 +739,11 @@
</span><span class="cx">     if (!authorizationStatus)
</span><span class="cx">         return Exception { INVALID_ACCESS_ERR };
</span><span class="cx"> 
</span><del>-    paymentCoordinator().completePaymentSession(*authorizationStatus);
</del><ins>+    PaymentAuthorizationResult result;
+    result.status = *authorizationStatus;
</ins><span class="cx"> 
</span><ins>+    paymentCoordinator().completePaymentSession(WTFMove(result));
+
</ins><span class="cx">     if (!isFinalStateStatus(*authorizationStatus)) {
</span><span class="cx">         m_state = State::Active;
</span><span class="cx">         return { };
</span><span class="lines">@@ -775,7 +791,7 @@
</span><span class="cx">     ASSERT(m_state == State::Active);
</span><span class="cx"> 
</span><span class="cx">     if (!hasEventListeners(eventNames().shippingmethodselectedEvent)) {
</span><del>-        paymentCoordinator().completeShippingMethodSelection(PaymentAuthorizationStatus::Success, { });
</del><ins>+        paymentCoordinator().completeShippingMethodSelection({ });
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -789,7 +805,7 @@
</span><span class="cx">     ASSERT(m_state == State::Active);
</span><span class="cx"> 
</span><span class="cx">     if (!hasEventListeners(eventNames().shippingcontactselectedEvent)) {
</span><del>-        paymentCoordinator().completeShippingContactSelection(PaymentAuthorizationStatus::Success, { }, { });
</del><ins>+        paymentCoordinator().completeShippingContactSelection({ });
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepayPaymentAuthorizationStatush"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/PaymentAuthorizationStatus.h (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/PaymentAuthorizationStatus.h        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebCore/Modules/applepay/PaymentAuthorizationStatus.h        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -27,6 +27,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(APPLE_PAY)
</span><span class="cx"> 
</span><ins>+#include &lt;wtf/EnumTraits.h&gt;
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> enum class PaymentAuthorizationStatus {
</span><span class="lines">@@ -59,4 +61,20 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+namespace WTF {
+template&lt;&gt; struct EnumTraits&lt;WebCore::PaymentAuthorizationStatus&gt; {
+    using values = EnumValues&lt;
+        WebCore::PaymentAuthorizationStatus,
+        WebCore::PaymentAuthorizationStatus::Success,
+        WebCore::PaymentAuthorizationStatus::Failure,
+        WebCore::PaymentAuthorizationStatus::InvalidBillingPostalAddress,
+        WebCore::PaymentAuthorizationStatus::InvalidShippingPostalAddress,
+        WebCore::PaymentAuthorizationStatus::InvalidShippingContact,
+        WebCore::PaymentAuthorizationStatus::PINRequired,
+        WebCore::PaymentAuthorizationStatus::PINIncorrect,
+        WebCore::PaymentAuthorizationStatus::PINLockout
+    &gt;;
+};
+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepayPaymentCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.cpp        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -83,33 +83,35 @@
</span><span class="cx">     m_client.completeMerchantValidation(paymentMerchantSession);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PaymentCoordinator::completeShippingMethodSelection(PaymentAuthorizationStatus status, std::optional&lt;PaymentRequest::TotalAndLineItems&gt; newTotalAndItems)
</del><ins>+void PaymentCoordinator::completeShippingMethodSelection(std::optional&lt;ShippingMethodUpdate&gt;&amp;&amp; update)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_activeSession);
</span><span class="cx"> 
</span><del>-    m_client.completeShippingMethodSelection(status, WTFMove(newTotalAndItems));
</del><ins>+    m_client.completeShippingMethodSelection(WTFMove(update));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PaymentCoordinator::completeShippingContactSelection(PaymentAuthorizationStatus status, const Vector&lt;PaymentRequest::ShippingMethod&gt;&amp; newShippingMethods, std::optional&lt;PaymentRequest::TotalAndLineItems&gt; newTotalAndItems)
</del><ins>+void PaymentCoordinator::completeShippingContactSelection(std::optional&lt;ShippingContactUpdate&gt;&amp;&amp; update)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_activeSession);
</span><span class="cx"> 
</span><del>-    m_client.completeShippingContactSelection(status, newShippingMethods, WTFMove(newTotalAndItems));
</del><ins>+    m_client.completeShippingContactSelection(WTFMove(update));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PaymentCoordinator::completePaymentMethodSelection(std::optional&lt;PaymentRequest::TotalAndLineItems&gt; newTotalAndItems)
</del><ins>+void PaymentCoordinator::completePaymentMethodSelection(std::optional&lt;PaymentMethodUpdate&gt;&amp;&amp; update)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_activeSession);
</span><span class="cx"> 
</span><del>-    m_client.completePaymentMethodSelection(WTFMove(newTotalAndItems));
</del><ins>+    m_client.completePaymentMethodSelection(WTFMove(update));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PaymentCoordinator::completePaymentSession(PaymentAuthorizationStatus status)
</del><ins>+void PaymentCoordinator::completePaymentSession(std::optional&lt;PaymentAuthorizationResult&gt;&amp;&amp; result)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_activeSession);
</span><span class="cx"> 
</span><del>-    m_client.completePaymentSession(status);
</del><ins>+    auto status = result ? result-&gt;status : PaymentAuthorizationStatus::Success;
</ins><span class="cx"> 
</span><ins>+    m_client.completePaymentSession(WTFMove(result));
+
</ins><span class="cx">     if (!isFinalStateStatus(status))
</span><span class="cx">         return;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepayPaymentCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.h (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.h        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebCore/Modules/applepay/PaymentCoordinator.h        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -40,6 +40,10 @@
</span><span class="cx"> class PaymentMethod;
</span><span class="cx"> class URL;
</span><span class="cx"> enum class PaymentAuthorizationStatus;
</span><ins>+struct PaymentAuthorizationResult;
+struct PaymentMethodUpdate;
+struct ShippingContactUpdate;
+struct ShippingMethodUpdate;
</ins><span class="cx"> 
</span><span class="cx"> class PaymentCoordinator {
</span><span class="cx"> public:
</span><span class="lines">@@ -55,10 +59,10 @@
</span><span class="cx"> 
</span><span class="cx">     bool beginPaymentSession(ApplePaySession&amp;, const URL&amp; originatingURL, const Vector&lt;URL&gt;&amp; linkIconURLs, const PaymentRequest&amp;);
</span><span class="cx">     void completeMerchantValidation(const PaymentMerchantSession&amp;);
</span><del>-    void completeShippingMethodSelection(PaymentAuthorizationStatus, std::optional&lt;PaymentRequest::TotalAndLineItems&gt; newItems);
-    void completeShippingContactSelection(PaymentAuthorizationStatus, const Vector&lt;PaymentRequest::ShippingMethod&gt;&amp; newShippingMethods, std::optional&lt;PaymentRequest::TotalAndLineItems&gt; newItems);
-    void completePaymentMethodSelection(std::optional&lt;PaymentRequest::TotalAndLineItems&gt; newItems);
-    void completePaymentSession(PaymentAuthorizationStatus);
</del><ins>+    void completeShippingMethodSelection(std::optional&lt;ShippingMethodUpdate&gt;&amp;&amp;);
+    void completeShippingContactSelection(std::optional&lt;ShippingContactUpdate&gt;&amp;&amp;);
+    void completePaymentMethodSelection(std::optional&lt;PaymentMethodUpdate&gt;&amp;&amp;);
+    void completePaymentSession(std::optional&lt;PaymentAuthorizationResult&gt;&amp;&amp;);
</ins><span class="cx">     void abortPaymentSession();
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void validateMerchant(const URL&amp; validationURL);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepayPaymentCoordinatorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebCore/Modules/applepay/PaymentCoordinatorClient.h        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -35,7 +35,10 @@
</span><span class="cx"> 
</span><span class="cx"> class PaymentMerchantSession;
</span><span class="cx"> class URL;
</span><del>-enum class PaymentAuthorizationStatus;
</del><ins>+struct PaymentAuthorizationResult;
+struct PaymentMethodUpdate;
+struct ShippingContactUpdate;
+struct ShippingMethodUpdate;
</ins><span class="cx"> 
</span><span class="cx"> class PaymentCoordinatorClient {
</span><span class="cx"> public:
</span><span class="lines">@@ -46,10 +49,10 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool showPaymentUI(const URL&amp; originatingURL, const Vector&lt;URL&gt;&amp; linkIconURLs, const PaymentRequest&amp;) = 0;
</span><span class="cx">     virtual void completeMerchantValidation(const PaymentMerchantSession&amp;) = 0;
</span><del>-    virtual void completeShippingMethodSelection(PaymentAuthorizationStatus, std::optional&lt;PaymentRequest::TotalAndLineItems&gt; newTotalAndItems) = 0;
-    virtual void completeShippingContactSelection(PaymentAuthorizationStatus, const Vector&lt;PaymentRequest::ShippingMethod&gt;&amp; newShippingMethods, std::optional&lt;PaymentRequest::TotalAndLineItems&gt; newTotalAndItems) = 0;
-    virtual void completePaymentMethodSelection(std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt; newTotalAndItems) = 0;
-    virtual void completePaymentSession(PaymentAuthorizationStatus) = 0;
</del><ins>+    virtual void completeShippingMethodSelection(std::optional&lt;ShippingMethodUpdate&gt;&amp;&amp;) = 0;
+    virtual void completeShippingContactSelection(std::optional&lt;ShippingContactUpdate&gt;&amp;&amp;) = 0;
+    virtual void completePaymentMethodSelection(std::optional&lt;PaymentMethodUpdate&gt;&amp;&amp;) = 0;
+    virtual void completePaymentSession(std::optional&lt;PaymentAuthorizationResult&gt;&amp;&amp;) = 0;
</ins><span class="cx">     virtual void abortPaymentSession() = 0;
</span><span class="cx">     virtual void paymentCoordinatorDestroyed() = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesapplepayPaymentRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/applepay/PaymentRequest.h (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/applepay/PaymentRequest.h        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebCore/Modules/applepay/PaymentRequest.h        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> #if ENABLE(APPLE_PAY)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;PaymentContact.h&quot;
</span><ins>+#include &lt;wtf/EnumTraits.h&gt;
</ins><span class="cx"> #include &lt;wtf/Optional.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="lines">@@ -34,6 +35,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+enum class PaymentAuthorizationStatus;
+
</ins><span class="cx"> class PaymentRequest {
</span><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT PaymentRequest();
</span><span class="lines">@@ -147,6 +150,85 @@
</span><span class="cx">     String m_applicationData;
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+struct PaymentError {
+    enum class Code {
+        Unknown,
+        ShippingContactInvalid,
+        BillingContactInvalid,
+        AddressUnservicable,
+    };
+
+    enum class ContactField {
+        PhoneNumber,
+        EmailAddress,
+        GivenName,
+        FamilyName,
+        AddressLines,
+        Locality,
+        PostalCode,
+        AdministrativeArea,
+        Country,
+        CountryCode,
+    };
+
+    Code code;
+    String message;
+    std::optional&lt;ContactField&gt; contactField;
+};
+
+struct PaymentAuthorizationResult {
+    PaymentAuthorizationStatus status;
+    Vector&lt;PaymentError&gt; errors;
+};
+
+struct PaymentMethodUpdate {
+    PaymentAuthorizationStatus status;
+    PaymentRequest::TotalAndLineItems newTotalAndLineItems;
+};
+
+struct ShippingContactUpdate {
+    PaymentAuthorizationStatus status;
+    Vector&lt;PaymentError&gt; errors;
+
+    Vector&lt;PaymentRequest::ShippingMethod&gt; newShippingMethods;
+    PaymentRequest::TotalAndLineItems newTotalAndLineItems;
+};
+
+struct ShippingMethodUpdate {
+    PaymentAuthorizationStatus status;
+    PaymentRequest::TotalAndLineItems newTotalAndLineItems;
+};
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+namespace WTF {
+
+template&lt;&gt; struct EnumTraits&lt;WebCore::PaymentError::Code&gt; {
+    using values = EnumValues&lt;
+        WebCore::PaymentError::Code,
+        WebCore::PaymentError::Code::Unknown,
+        WebCore::PaymentError::Code::ShippingContactInvalid,
+        WebCore::PaymentError::Code::BillingContactInvalid,
+        WebCore::PaymentError::Code::AddressUnservicable
+    &gt;;
+};
+
+template&lt;&gt; struct EnumTraits&lt;WebCore::PaymentError::ContactField&gt; {
+    using values = EnumValues&lt;
+        WebCore::PaymentError::ContactField,
+        WebCore::PaymentError::ContactField::PhoneNumber,
+        WebCore::PaymentError::ContactField::EmailAddress,
+        WebCore::PaymentError::ContactField::GivenName,
+        WebCore::PaymentError::ContactField::FamilyName,
+        WebCore::PaymentError::ContactField::AddressLines,
+        WebCore::PaymentError::ContactField::Locality,
+        WebCore::PaymentError::ContactField::PostalCode,
+        WebCore::PaymentError::ContactField::AdministrativeArea,
+        WebCore::PaymentError::ContactField::Country,
+        WebCore::PaymentError::ContactField::CountryCode
+    &gt;;
+};
+
+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.cpp        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -490,10 +490,10 @@
</span><span class="cx">     void openPaymentSetup(const String&amp;, const String&amp;, std::function&lt;void(bool)&gt; completionHandler) final { callOnMainThread([completionHandler] { completionHandler(false); }); }
</span><span class="cx">     bool showPaymentUI(const URL&amp;, const Vector&lt;URL&gt;&amp;, const PaymentRequest&amp;) final { return false; }
</span><span class="cx">     void completeMerchantValidation(const PaymentMerchantSession&amp;) final { }
</span><del>-    void completeShippingMethodSelection(PaymentAuthorizationStatus, std::optional&lt;PaymentRequest::TotalAndLineItems&gt;) final { }
-    void completeShippingContactSelection(PaymentAuthorizationStatus, const Vector&lt;PaymentRequest::ShippingMethod&gt;&amp;, std::optional&lt;PaymentRequest::TotalAndLineItems&gt;) final { }
-    void completePaymentMethodSelection(std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;) final { }
-    void completePaymentSession(PaymentAuthorizationStatus) final { }
</del><ins>+    void completeShippingMethodSelection(std::optional&lt;ShippingMethodUpdate&gt;&amp;&amp;) final { }
+    void completeShippingContactSelection(std::optional&lt;ShippingContactUpdate&gt;&amp;&amp;) final { }
+    void completePaymentMethodSelection(std::optional&lt;PaymentMethodUpdate&gt;&amp;&amp;) final { }
+    void completePaymentSession(std::optional&lt;PaymentAuthorizationResult&gt;&amp;&amp;) final { }
</ins><span class="cx">     void abortPaymentSession() final { }
</span><span class="cx">     void paymentCoordinatorDestroyed() final { }
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit/mac/ChangeLog        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2017-03-08  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Simplify the PaymentCoordinator interface
+        https://bugs.webkit.org/show_bug.cgi?id=169382
+        Part of rdar://problem/28880714.
+
+        Reviewed by Tim Horton.
+
+        Update for PaymentCoordinatorClient changes.
+
+        * WebCoreSupport/WebPaymentCoordinatorClient.h:
+        * WebCoreSupport/WebPaymentCoordinatorClient.mm:
+        (WebPaymentCoordinatorClient::completeShippingMethodSelection):
+        (WebPaymentCoordinatorClient::completeShippingContactSelection):
+        (WebPaymentCoordinatorClient::completePaymentMethodSelection):
+        (WebPaymentCoordinatorClient::completePaymentSession):
+
</ins><span class="cx"> 2017-03-08  Megan Gardner  &lt;megan_gardner@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix for dependency fix
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebPaymentCoordinatorClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.h (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.h        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.h        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -42,10 +42,10 @@
</span><span class="cx">     void openPaymentSetup(const String&amp; merchantIdentifier, const String&amp; domainName, std::function&lt;void (bool)&gt; completionHandler) override;
</span><span class="cx">     bool showPaymentUI(const WebCore::URL&amp;, const Vector&lt;WebCore::URL&gt;&amp; linkIconURLs, const WebCore::PaymentRequest&amp;) override;
</span><span class="cx">     void completeMerchantValidation(const WebCore::PaymentMerchantSession&amp;) override;
</span><del>-    void completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus, std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt; newTotalAndItems) override;
-    void completeShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector&lt;WebCore::PaymentRequest::ShippingMethod&gt;&amp;, std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt; newTotalAndItems) override;
-    void completePaymentMethodSelection(std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;) override;
-    void completePaymentSession(WebCore::PaymentAuthorizationStatus) override;
</del><ins>+    void completeShippingMethodSelection(std::optional&lt;WebCore::ShippingMethodUpdate&gt;&amp;&amp;) override;
+    void completeShippingContactSelection(std::optional&lt;WebCore::ShippingContactUpdate&gt;&amp;&amp;) override;
+    void completePaymentMethodSelection(std::optional&lt;WebCore::PaymentMethodUpdate&gt;&amp;&amp;) override;
+    void completePaymentSession(std::optional&lt;WebCore::PaymentAuthorizationResult&gt;&amp;&amp;) override;
</ins><span class="cx">     void abortPaymentSession() override;
</span><span class="cx">     void paymentCoordinatorDestroyed() override;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebPaymentCoordinatorClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebPaymentCoordinatorClient.mm        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -71,19 +71,19 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorClient::completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus, std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;)
</del><ins>+void WebPaymentCoordinatorClient::completeShippingMethodSelection(std::optional&lt;WebCore::ShippingMethodUpdate&gt;&amp;&amp;)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorClient::completeShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector&lt;WebCore::PaymentRequest::ShippingMethod&gt;&amp;, std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;)
</del><ins>+void WebPaymentCoordinatorClient::completeShippingContactSelection(std::optional&lt;WebCore::ShippingContactUpdate&gt;&amp;&amp;)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorClient::completePaymentMethodSelection(std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;)
</del><ins>+void WebPaymentCoordinatorClient::completePaymentMethodSelection(std::optional&lt;WebCore::PaymentMethodUpdate&gt;&amp;&amp;)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorClient::completePaymentSession(WebCore::PaymentAuthorizationStatus)
</del><ins>+void WebPaymentCoordinatorClient::completePaymentSession(std::optional&lt;WebCore::PaymentAuthorizationResult&gt;&amp;&amp;)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit2/ChangeLog        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2017-03-08  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Simplify the PaymentCoordinator interface
+        https://bugs.webkit.org/show_bug.cgi?id=169382
+        Part of rdar://problem/28880714.
+
+        Reviewed by Tim Horton.
+
+        Send the new structs over the wire to the UI process and update the various proxy object to take them instead of
+        multiple parameters.
+
+        * Scripts/webkit/messages.py:
+        (headers_for_type):
+        * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
+        (IPC::ArgumentCoder&lt;WebCore::PaymentAuthorizationResult&gt;::encode):
+        (IPC::ArgumentCoder&lt;WebCore::PaymentAuthorizationResult&gt;::decode):
+        (IPC::ArgumentCoder&lt;WebCore::PaymentError&gt;::encode):
+        (IPC::ArgumentCoder&lt;WebCore::PaymentError&gt;::decode):
+        (IPC::ArgumentCoder&lt;WebCore::PaymentMethodUpdate&gt;::encode):
+        (IPC::ArgumentCoder&lt;WebCore::PaymentMethodUpdate&gt;::decode):
+        (IPC::ArgumentCoder&lt;WebCore::ShippingContactUpdate&gt;::encode):
+        (IPC::ArgumentCoder&lt;WebCore::ShippingContactUpdate&gt;::decode):
+        (IPC::ArgumentCoder&lt;WebCore::ShippingMethodUpdate&gt;::encode):
+        (IPC::ArgumentCoder&lt;WebCore::ShippingMethodUpdate&gt;::decode):
+        * Shared/WebCoreArgumentCoders.h:
+        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
+        (WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
+        (WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
+        (WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
+        (WebKit::WebPaymentCoordinatorProxy::completePaymentSession):
+        (WebKit::isValidEnum): Deleted.
+        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
+        * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
+        * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+        (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentSession):
+        (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
+        (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
+        (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
+        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
+        (WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
+        (WebKit::WebPaymentCoordinator::completeShippingContactSelection):
+        (WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
+        (WebKit::WebPaymentCoordinator::completePaymentSession):
+        * WebProcess/ApplePay/WebPaymentCoordinator.h:
+
</ins><span class="cx"> 2017-03-08  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove the trace command from the sandbox profile.
</span></span></pre></div>
<a id="trunkSourceWebKit2Scriptswebkitmessagespy"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Scripts/webkit/messages.py (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Scripts/webkit/messages.py        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit2/Scripts/webkit/messages.py        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -358,8 +358,12 @@
</span><span class="cx">         'WebCore::MediaConstraintsData': ['&lt;WebCore/MediaConstraintsImpl.h&gt;'],
</span><span class="cx">         'WebCore::PasteboardImage': ['&lt;WebCore/Pasteboard.h&gt;'],
</span><span class="cx">         'WebCore::PasteboardWebContent': ['&lt;WebCore/Pasteboard.h&gt;'],
</span><ins>+        'WebCore::PaymentAuthorizationResult': ['&lt;WebCore/PaymentRequest.h&gt;'],
+        'WebCore::PaymentMethodUpdate': ['&lt;WebCore/PaymentRequest.h&gt;'],
</ins><span class="cx">         'WebCore::PluginInfo': ['&lt;WebCore/PluginData.h&gt;'],
</span><span class="cx">         'WebCore::RecentSearch': ['&lt;WebCore/SearchPopupMenu.h&gt;'],
</span><ins>+        'WebCore::ShippingContactUpdate': ['&lt;WebCore/PaymentRequest.h&gt;'],
+        'WebCore::ShippingMethodUpdate': ['&lt;WebCore/PaymentRequest.h&gt;'],
</ins><span class="cx">         'WebCore::ShouldSample': ['&lt;WebCore/DiagnosticLoggingClient.h&gt;'],
</span><span class="cx">         'WebCore::TextCheckingRequestData': ['&lt;WebCore/TextChecking.h&gt;'],
</span><span class="cx">         'WebCore::TextCheckingResult': ['&lt;WebCore/TextCheckerClient.h&gt;'],
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedCocoaWebCoreArgumentCodersCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit2/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #import &quot;DataReference.h&quot;
</span><span class="cx"> #import &lt;WebCore/PassKitSPI.h&gt;
</span><ins>+#import &lt;WebCore/PaymentAuthorizationStatus.h&gt;
</ins><span class="cx"> #import &lt;WebCore/SoftLinking.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -81,6 +82,22 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ArgumentCoder&lt;WebCore::PaymentAuthorizationResult&gt;::encode(Encoder&amp; encoder, const WebCore::PaymentAuthorizationResult&amp; result)
+{
+    encoder &lt;&lt; result.status;
+    encoder &lt;&lt; result.errors;
+}
+
+bool ArgumentCoder&lt;WebCore::PaymentAuthorizationResult&gt;::decode(Decoder&amp; decoder, WebCore::PaymentAuthorizationResult&amp; result)
+{
+    if (!decoder.decode(result.status))
+        return false;
+    if (!decoder.decode(result.errors))
+        return false;
+
+    return true;
+}
+
</ins><span class="cx"> void ArgumentCoder&lt;WebCore::PaymentContact&gt;::encode(Encoder&amp; encoder, const WebCore::PaymentContact&amp; paymentContact)
</span><span class="cx"> {
</span><span class="cx">     auto data = adoptNS([[NSMutableData alloc] init]);
</span><span class="lines">@@ -115,6 +132,25 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ArgumentCoder&lt;WebCore::PaymentError&gt;::encode(Encoder&amp; encoder, const WebCore::PaymentError&amp; error)
+{
+    encoder &lt;&lt; error.code;
+    encoder &lt;&lt; error.message;
+    encoder &lt;&lt; error.contactField;
+}
+
+bool ArgumentCoder&lt;WebCore::PaymentError&gt;::decode(Decoder&amp; decoder, WebCore::PaymentError&amp; error)
+{
+    if (!decoder.decode(error.code))
+        return false;
+    if (!decoder.decode(error.message))
+        return false;
+    if (!decoder.decode(error.contactField))
+        return false;
+
+    return true;
+}
+
</ins><span class="cx"> void ArgumentCoder&lt;WebCore::PaymentMerchantSession&gt;::encode(Encoder&amp; encoder, const WebCore::PaymentMerchantSession&amp; paymentMerchantSession)
</span><span class="cx"> {
</span><span class="cx">     auto data = adoptNS([[NSMutableData alloc] init]);
</span><span class="lines">@@ -184,6 +220,22 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ArgumentCoder&lt;WebCore::PaymentMethodUpdate&gt;::encode(Encoder&amp; encoder, const WebCore::PaymentMethodUpdate&amp; update)
+{
+    encoder &lt;&lt; update.status;
+    encoder &lt;&lt; update.newTotalAndLineItems;
+}
+
+bool ArgumentCoder&lt;WebCore::PaymentMethodUpdate&gt;::decode(Decoder&amp; decoder, WebCore::PaymentMethodUpdate&amp; update)
+{
+    if (!decoder.decode(update.status))
+        return false;
+    if (!decoder.decode(update.newTotalAndLineItems))
+        return false;
+
+    return true;
+}
+
</ins><span class="cx"> void ArgumentCoder&lt;PaymentRequest&gt;::encode(Encoder&amp; encoder, const PaymentRequest&amp; request)
</span><span class="cx"> {
</span><span class="cx">     encoder &lt;&lt; request.countryCode();
</span><span class="lines">@@ -370,6 +422,44 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ArgumentCoder&lt;WebCore::ShippingContactUpdate&gt;::encode(Encoder&amp; encoder, const WebCore::ShippingContactUpdate&amp; update)
+{
+    encoder &lt;&lt; update.status;
+    encoder &lt;&lt; update.errors;
+    encoder &lt;&lt; update.newShippingMethods;
+    encoder &lt;&lt; update.newTotalAndLineItems;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool ArgumentCoder&lt;WebCore::ShippingContactUpdate&gt;::decode(Decoder&amp; decoder, WebCore::ShippingContactUpdate&amp; update)
+{
+    if (!decoder.decode(update.status))
+        return false;
+    if (!decoder.decode(update.errors))
+        return false;
+    if (!decoder.decode(update.newShippingMethods))
+        return false;
+    if (!decoder.decode(update.newTotalAndLineItems))
+        return false;
+
+    return true;
+}
+
+void ArgumentCoder&lt;WebCore::ShippingMethodUpdate&gt;::encode(Encoder&amp; encoder, const WebCore::ShippingMethodUpdate&amp; update)
+{
+    encoder &lt;&lt; update.status;
+    encoder &lt;&lt; update.newTotalAndLineItems;
+}
+
+bool ArgumentCoder&lt;WebCore::ShippingMethodUpdate&gt;::decode(Decoder&amp; decoder, WebCore::ShippingMethodUpdate&amp; update)
+{
+    if (!decoder.decode(update.status))
+        return false;
+    if (!decoder.decode(update.newTotalAndLineItems))
+        return false;
+
+    return true;
+}
+
+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedWebCoreArgumentCodersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.h        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -546,11 +546,21 @@
</span><span class="cx">     static bool decode(Decoder&amp;, WebCore::Payment&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;&gt; struct ArgumentCoder&lt;WebCore::PaymentAuthorizationResult&gt; {
+    static void encode(Encoder&amp;, const WebCore::PaymentAuthorizationResult&amp;);
+    static bool decode(Decoder&amp;, WebCore::PaymentAuthorizationResult&amp;);
+};
+
</ins><span class="cx"> template&lt;&gt; struct ArgumentCoder&lt;WebCore::PaymentContact&gt; {
</span><span class="cx">     static void encode(Encoder&amp;, const WebCore::PaymentContact&amp;);
</span><span class="cx">     static bool decode(Decoder&amp;, WebCore::PaymentContact&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;&gt; struct ArgumentCoder&lt;WebCore::PaymentError&gt; {
+    static void encode(Encoder&amp;, const WebCore::PaymentError&amp;);
+    static bool decode(Decoder&amp;, WebCore::PaymentError&amp;);
+};
+
</ins><span class="cx"> template&lt;&gt; struct ArgumentCoder&lt;WebCore::PaymentMerchantSession&gt; {
</span><span class="cx">     static void encode(Encoder&amp;, const WebCore::PaymentMerchantSession&amp;);
</span><span class="cx">     static bool decode(Decoder&amp;, WebCore::PaymentMerchantSession&amp;);
</span><span class="lines">@@ -561,6 +571,11 @@
</span><span class="cx">     static bool decode(Decoder&amp;, WebCore::PaymentMethod&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;&gt; struct ArgumentCoder&lt;WebCore::PaymentMethodUpdate&gt; {
+    static void encode(Encoder&amp;, const WebCore::PaymentMethodUpdate&amp;);
+    static bool decode(Decoder&amp;, WebCore::PaymentMethodUpdate&amp;);
+};
+
</ins><span class="cx"> template&lt;&gt; struct ArgumentCoder&lt;WebCore::PaymentRequest&gt; {
</span><span class="cx">     static void encode(Encoder&amp;, const WebCore::PaymentRequest&amp;);
</span><span class="cx">     static bool decode(Decoder&amp;, WebCore::PaymentRequest&amp;);
</span><span class="lines">@@ -591,6 +606,16 @@
</span><span class="cx">     static bool decode(Decoder&amp;, WebCore::PaymentRequest::TotalAndLineItems&amp;);
</span><span class="cx"> };
</span><span class="cx"> 
</span><ins>+template&lt;&gt; struct ArgumentCoder&lt;WebCore::ShippingContactUpdate&gt; {
+    static void encode(Encoder&amp;, const WebCore::ShippingContactUpdate&amp;);
+    static bool decode(Decoder&amp;, WebCore::ShippingContactUpdate&amp;);
+};
+
+template&lt;&gt; struct ArgumentCoder&lt;WebCore::ShippingMethodUpdate&gt; {
+    static void encode(Encoder&amp;, const WebCore::ShippingMethodUpdate&amp;);
+    static bool decode(Decoder&amp;, WebCore::ShippingMethodUpdate&amp;);
+};
+
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(MEDIA_STREAM)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplePayWebPaymentCoordinatorProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -120,23 +120,7 @@
</span><span class="cx">     result = true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static bool isValidEnum(WebCore::PaymentAuthorizationStatus status)
-{
-    switch (status) {
-    case WebCore::PaymentAuthorizationStatus::Success:
-    case WebCore::PaymentAuthorizationStatus::Failure:
-    case WebCore::PaymentAuthorizationStatus::InvalidBillingPostalAddress:
-    case WebCore::PaymentAuthorizationStatus::InvalidShippingPostalAddress:
-    case WebCore::PaymentAuthorizationStatus::InvalidShippingContact:
-    case WebCore::PaymentAuthorizationStatus::PINRequired:
-    case WebCore::PaymentAuthorizationStatus::PINIncorrect:
-    case WebCore::PaymentAuthorizationStatus::PINLockout:
-        return true;
-    }
-
-    return false;
-}
-
</del><ins>+    
</ins><span class="cx"> void WebPaymentCoordinatorProxy::completeMerchantValidation(const WebCore::PaymentMerchantSession&amp; paymentMerchantSession)
</span><span class="cx"> {
</span><span class="cx">     // It's possible that the payment has been canceled already.
</span><span class="lines">@@ -150,7 +134,7 @@
</span><span class="cx">     m_merchantValidationState = MerchantValidationState::ValidationComplete;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorProxy::completeShippingMethodSelection(uint32_t opaqueStatus, const std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;&amp; newTotalAndLineItems)
</del><ins>+void WebPaymentCoordinatorProxy::completeShippingMethodSelection(const std::optional&lt;WebCore::ShippingMethodUpdate&gt;&amp; update)
</ins><span class="cx"> {
</span><span class="cx">     // It's possible that the payment has been canceled already.
</span><span class="cx">     if (m_state == State::Idle)
</span><span class="lines">@@ -159,16 +143,11 @@
</span><span class="cx">     // FIXME: This should be a MESSAGE_CHECK.
</span><span class="cx">     ASSERT(m_state == State::ShippingMethodSelected);
</span><span class="cx"> 
</span><del>-    auto status = static_cast&lt;WebCore::PaymentAuthorizationStatus&gt;(opaqueStatus);
-
-    // FIXME: Make this a message check.
-    RELEASE_ASSERT(isValidEnum(status));
-
-    platformCompleteShippingMethodSelection(status, newTotalAndLineItems);
</del><ins>+    platformCompleteShippingMethodSelection(update);
</ins><span class="cx">     m_state = State::Active;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorProxy::completeShippingContactSelection(uint32_t opaqueStatus, const Vector&lt;WebCore::PaymentRequest::ShippingMethod&gt;&amp; newShippingMethods, const std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;&amp; newTotalAndLineItems)
</del><ins>+void WebPaymentCoordinatorProxy::completeShippingContactSelection(const std::optional&lt;WebCore::ShippingContactUpdate&gt;&amp; update)
</ins><span class="cx"> {
</span><span class="cx">     // It's possible that the payment has been canceled already.
</span><span class="cx">     if (m_state == State::Idle)
</span><span class="lines">@@ -177,16 +156,11 @@
</span><span class="cx">     // FIXME: This should be a MESSAGE_CHECK.
</span><span class="cx">     ASSERT(m_state == State::ShippingContactSelected);
</span><span class="cx"> 
</span><del>-    auto status = static_cast&lt;WebCore::PaymentAuthorizationStatus&gt;(opaqueStatus);
-
-    // FIXME: Make this a message check.
-    RELEASE_ASSERT(isValidEnum(status));
-
-    platformCompleteShippingContactSelection(status, newShippingMethods, newTotalAndLineItems);
</del><ins>+    platformCompleteShippingContactSelection(update);
</ins><span class="cx">     m_state = State::Active;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorProxy::completePaymentMethodSelection(const std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;&amp; newTotalAndLineItems)
</del><ins>+void WebPaymentCoordinatorProxy::completePaymentMethodSelection(const std::optional&lt;WebCore::PaymentMethodUpdate&gt;&amp; update)
</ins><span class="cx"> {
</span><span class="cx">     // It's possible that the payment has been canceled already.
</span><span class="cx">     if (m_state == State::Idle)
</span><span class="lines">@@ -195,24 +169,19 @@
</span><span class="cx">     // FIXME: This should be a MESSAGE_CHECK.
</span><span class="cx">     ASSERT(m_state == State::PaymentMethodSelected);
</span><span class="cx"> 
</span><del>-    platformCompletePaymentMethodSelection(newTotalAndLineItems);
</del><ins>+    platformCompletePaymentMethodSelection(update);
</ins><span class="cx">     m_state = State::Active;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorProxy::completePaymentSession(uint32_t opaqueStatus)
</del><ins>+void WebPaymentCoordinatorProxy::completePaymentSession(const std::optional&lt;WebCore::PaymentAuthorizationResult&gt;&amp; result)
</ins><span class="cx"> {
</span><span class="cx">     // It's possible that the payment has been canceled already.
</span><span class="cx">     if (!canCompletePayment())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    auto status = static_cast&lt;WebCore::PaymentAuthorizationStatus&gt;(opaqueStatus);
</del><ins>+    platformCompletePaymentSession(result);
</ins><span class="cx"> 
</span><del>-    // FIXME: Make this a message check.
-    RELEASE_ASSERT(isValidEnum(status));
-
-    platformCompletePaymentSession(status);
-
-    if (!WebCore::isFinalStateStatus(status)) {
</del><ins>+    if (!WebCore::isFinalStateStatus(result ? result-&gt;status : WebCore::PaymentAuthorizationStatus::Success)) {
</ins><span class="cx">         m_state = State::Active;
</span><span class="cx">         return;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplePayWebPaymentCoordinatorProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.h        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -80,10 +80,10 @@
</span><span class="cx">     void openPaymentSetup(const String&amp; merchantIdentifier, const String&amp; domainName, uint64_t requestID);
</span><span class="cx">     void showPaymentUI(const String&amp; originatingURLString, const Vector&lt;String&gt;&amp; linkIconURLStrings, const WebCore::PaymentRequest&amp;, bool&amp; result);
</span><span class="cx">     void completeMerchantValidation(const WebCore::PaymentMerchantSession&amp;);
</span><del>-    void completeShippingMethodSelection(uint32_t opaqueStatus, const std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;&amp;);
-    void completeShippingContactSelection(uint32_t opaqueStatus, const Vector&lt;WebCore::PaymentRequest::ShippingMethod&gt;&amp; newShippingMethods, const std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;&amp;);
-    void completePaymentMethodSelection(const std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;&amp;);
-    void completePaymentSession(uint32_t opaqueStatus);
</del><ins>+    void completeShippingMethodSelection(const std::optional&lt;WebCore::ShippingMethodUpdate&gt;&amp;);
+    void completeShippingContactSelection(const std::optional&lt;WebCore::ShippingContactUpdate&gt;&amp;);
+    void completePaymentMethodSelection(const std::optional&lt;WebCore::PaymentMethodUpdate&gt;&amp;);
+    void completePaymentSession(const std::optional&lt;WebCore::PaymentAuthorizationResult&gt;&amp;);
</ins><span class="cx">     void abortPaymentSession();
</span><span class="cx"> 
</span><span class="cx">     bool canBegin() const;
</span><span class="lines">@@ -98,10 +98,10 @@
</span><span class="cx">     void platformOpenPaymentSetup(const String&amp; merchantIdentifier, const String&amp; domainName, std::function&lt;void (bool)&gt; completionHandler);
</span><span class="cx">     void platformShowPaymentUI(const WebCore::URL&amp; originatingURL, const Vector&lt;WebCore::URL&gt;&amp; linkIconURLs, const WebCore::PaymentRequest&amp;, std::function&lt;void (bool)&gt; completionHandler);
</span><span class="cx">     void platformCompleteMerchantValidation(const WebCore::PaymentMerchantSession&amp;);
</span><del>-    void platformCompleteShippingMethodSelection(WebCore::PaymentAuthorizationStatus, const std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;&amp;);
-    void platformCompleteShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector&lt;WebCore::PaymentRequest::ShippingMethod&gt;&amp; newShippingMethods, const std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;&amp;);
-    void platformCompletePaymentMethodSelection(const std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;&amp;);
-    void platformCompletePaymentSession(WebCore::PaymentAuthorizationStatus);
</del><ins>+    void platformCompleteShippingMethodSelection(const std::optional&lt;WebCore::ShippingMethodUpdate&gt;&amp;);
+    void platformCompleteShippingContactSelection(const std::optional&lt;WebCore::ShippingContactUpdate&gt;&amp;);
+    void platformCompletePaymentMethodSelection(const std::optional&lt;WebCore::PaymentMethodUpdate&gt;&amp;);
+    void platformCompletePaymentSession(const std::optional&lt;WebCore::PaymentAuthorizationResult&gt;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     WebPageProxy&amp; m_webPageProxy;
</span><span class="cx">     WeakPtrFactory&lt;WebPaymentCoordinatorProxy&gt; m_weakPtrFactory;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplePayWebPaymentCoordinatorProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -31,11 +31,11 @@
</span><span class="cx">     OpenPaymentSetup(String merchantIdentifier, String domainName, uint64_t requestID)
</span><span class="cx"> 
</span><span class="cx">     ShowPaymentUI(String originatingURLString, Vector&lt;String&gt; linkIconURLStrings, WebCore::PaymentRequest paymentRequest) -&gt; (bool result)
</span><del>-    CompleteMerchantValidation(WebCore::PaymentMerchantSession paymentMerchantSession);
-    CompleteShippingMethodSelection(uint32_t opaqueStatus, std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt; newTotalAndItems)
-    CompleteShippingContactSelection(uint32_t opaqueStatus, Vector&lt;WebCore::PaymentRequest::ShippingMethod&gt; newShippingMethods, std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt; newTotalAndItems)
-    CompletePaymentMethodSelection(std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt; newTotalAndItems)
-    CompletePaymentSession(uint32_t opaqueStatus)
</del><ins>+    CompleteMerchantValidation(WebCore::PaymentMerchantSession paymentMerchantSession)
+    CompleteShippingMethodSelection(std::optional&lt;WebCore::ShippingMethodUpdate&gt; update)
+    CompleteShippingContactSelection(std::optional&lt;WebCore::ShippingContactUpdate&gt; update)
+    CompletePaymentMethodSelection(std::optional&lt;WebCore::PaymentMethodUpdate&gt; update)
+    CompletePaymentSession(std::optional&lt;WebCore::PaymentAuthorizationResult&gt; result)
</ins><span class="cx">     AbortPaymentSession()
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessApplePaycocoaWebPaymentCoordinatorProxyCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit2/UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -451,11 +451,13 @@
</span><span class="cx"> #pragma clang diagnostic pop
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorProxy::platformCompletePaymentSession(WebCore::PaymentAuthorizationStatus status)
</del><ins>+void WebPaymentCoordinatorProxy::platformCompletePaymentSession(const std::optional&lt;WebCore::PaymentAuthorizationResult&gt;&amp; result)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_paymentAuthorizationViewController);
</span><span class="cx">     ASSERT(m_paymentAuthorizationViewControllerDelegate);
</span><span class="cx"> 
</span><ins>+    auto status = result ? result-&gt;status : WebCore::PaymentAuthorizationStatus::Success;
+
</ins><span class="cx">     m_paymentAuthorizationViewControllerDelegate-&gt;_didReachFinalState = WebCore::isFinalStateStatus(status);
</span><span class="cx">     m_paymentAuthorizationViewControllerDelegate-&gt;_paymentAuthorizedCompletion(toPKPaymentAuthorizationStatus(status));
</span><span class="cx">     m_paymentAuthorizationViewControllerDelegate-&gt;_paymentAuthorizedCompletion = nullptr;
</span><span class="lines">@@ -470,19 +472,21 @@
</span><span class="cx">     m_paymentAuthorizationViewControllerDelegate-&gt;_sessionBlock = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection(WebCore::PaymentAuthorizationStatus status, const std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;&amp; newTotalAndLineItems)
</del><ins>+void WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection(const std::optional&lt;WebCore::ShippingMethodUpdate&gt;&amp; update)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_paymentAuthorizationViewController);
</span><span class="cx">     ASSERT(m_paymentAuthorizationViewControllerDelegate);
</span><span class="cx"> 
</span><del>-    if (newTotalAndLineItems) {
</del><ins>+    auto status = update ? update-&gt;status : WebCore::PaymentAuthorizationStatus::Success;
+
+    if (update) {
</ins><span class="cx">         auto paymentSummaryItems = adoptNS([[NSMutableArray alloc] init]);
</span><del>-        for (auto&amp; lineItem : newTotalAndLineItems-&gt;lineItems) {
</del><ins>+        for (auto&amp; lineItem : update-&gt;newTotalAndLineItems.lineItems) {
</ins><span class="cx">             if (auto summaryItem = toPKPaymentSummaryItem(lineItem))
</span><span class="cx">                 [paymentSummaryItems addObject:summaryItem.get()];
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (auto totalItem = toPKPaymentSummaryItem(newTotalAndLineItems-&gt;total))
</del><ins>+        if (auto totalItem = toPKPaymentSummaryItem(update-&gt;newTotalAndLineItems.total))
</ins><span class="cx">             [paymentSummaryItems addObject:totalItem.get()];
</span><span class="cx"> 
</span><span class="cx">         m_paymentAuthorizationViewControllerDelegate-&gt;_paymentSummaryItems = WTFMove(paymentSummaryItems);
</span><span class="lines">@@ -492,25 +496,27 @@
</span><span class="cx">     m_paymentAuthorizationViewControllerDelegate-&gt;_didSelectShippingMethodCompletion = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection(WebCore::PaymentAuthorizationStatus status, const Vector&lt;WebCore::PaymentRequest::ShippingMethod&gt;&amp; newShippingMethods, const std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;&amp; newTotalAndLineItems)
</del><ins>+void WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection(const std::optional&lt;WebCore::ShippingContactUpdate&gt;&amp; update)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_paymentAuthorizationViewController);
</span><span class="cx">     ASSERT(m_paymentAuthorizationViewControllerDelegate);
</span><span class="cx"> 
</span><del>-    if (newTotalAndLineItems) {
</del><ins>+    auto status = update ? update-&gt;status : WebCore::PaymentAuthorizationStatus::Success;
+
+    if (update) {
</ins><span class="cx">         auto paymentSummaryItems = adoptNS([[NSMutableArray alloc] init]);
</span><del>-        for (auto&amp; lineItem : newTotalAndLineItems-&gt;lineItems) {
</del><ins>+        for (auto&amp; lineItem : update-&gt;newTotalAndLineItems.lineItems) {
</ins><span class="cx">             if (auto summaryItem = toPKPaymentSummaryItem(lineItem))
</span><span class="cx">                 [paymentSummaryItems addObject:summaryItem.get()];
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (auto totalItem = toPKPaymentSummaryItem(newTotalAndLineItems-&gt;total))
</del><ins>+        if (auto totalItem = toPKPaymentSummaryItem(update-&gt;newTotalAndLineItems.total))
</ins><span class="cx">             [paymentSummaryItems addObject:totalItem.get()];
</span><span class="cx"> 
</span><span class="cx">         m_paymentAuthorizationViewControllerDelegate-&gt;_paymentSummaryItems = WTFMove(paymentSummaryItems);
</span><span class="cx"> 
</span><span class="cx">         auto shippingMethods = adoptNS([[NSMutableArray alloc] init]);
</span><del>-        for (auto&amp; shippingMethod : newShippingMethods)
</del><ins>+        for (auto&amp; shippingMethod : update-&gt;newShippingMethods)
</ins><span class="cx">             [shippingMethods addObject:toPKShippingMethod(shippingMethod).get()];
</span><span class="cx"> 
</span><span class="cx">         m_paymentAuthorizationViewControllerDelegate-&gt;_shippingMethods = WTFMove(shippingMethods);
</span><span class="lines">@@ -520,19 +526,19 @@
</span><span class="cx">     m_paymentAuthorizationViewControllerDelegate-&gt;_didSelectShippingContactCompletion = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection(const std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;&amp; newTotalAndLineItems)
</del><ins>+void WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection(const std::optional&lt;WebCore::PaymentMethodUpdate&gt;&amp; update)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_paymentAuthorizationViewController);
</span><span class="cx">     ASSERT(m_paymentAuthorizationViewControllerDelegate);
</span><span class="cx"> 
</span><del>-    if (newTotalAndLineItems) {
</del><ins>+    if (update) {
</ins><span class="cx">         auto paymentSummaryItems = adoptNS([[NSMutableArray alloc] init]);
</span><del>-        for (auto&amp; lineItem : newTotalAndLineItems-&gt;lineItems) {
</del><ins>+        for (auto&amp; lineItem : update-&gt;newTotalAndLineItems.lineItems) {
</ins><span class="cx">             if (auto summaryItem = toPKPaymentSummaryItem(lineItem))
</span><span class="cx">                 [paymentSummaryItems addObject:summaryItem.get()];
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (auto totalItem = toPKPaymentSummaryItem(newTotalAndLineItems-&gt;total))
</del><ins>+        if (auto totalItem = toPKPaymentSummaryItem(update-&gt;newTotalAndLineItems.total))
</ins><span class="cx">             [paymentSummaryItems addObject:totalItem.get()];
</span><span class="cx"> 
</span><span class="cx">         m_paymentAuthorizationViewControllerDelegate-&gt;_paymentSummaryItems = WTFMove(paymentSummaryItems);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessApplePayWebPaymentCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.cpp        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -117,24 +117,24 @@
</span><span class="cx">     m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteMerchantValidation(paymentMerchantSession));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinator::completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus status, std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt; newTotalAndItems)
</del><ins>+void WebPaymentCoordinator::completeShippingMethodSelection(std::optional&lt;WebCore::ShippingMethodUpdate&gt;&amp;&amp; update)
</ins><span class="cx"> {
</span><del>-    m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteShippingMethodSelection(static_cast&lt;uint32_t&gt;(status), newTotalAndItems));
</del><ins>+    m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteShippingMethodSelection(update));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinator::completeShippingContactSelection(WebCore::PaymentAuthorizationStatus status, const Vector&lt;WebCore::PaymentRequest::ShippingMethod&gt;&amp; newShippingMethods, std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt; newTotalAndItems)
</del><ins>+void WebPaymentCoordinator::completeShippingContactSelection(std::optional&lt;WebCore::ShippingContactUpdate&gt;&amp;&amp; update)
</ins><span class="cx"> {
</span><del>-    m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteShippingContactSelection(static_cast&lt;uint32_t&gt;(status), newShippingMethods, newTotalAndItems));
</del><ins>+    m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompleteShippingContactSelection(update));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinator::completePaymentMethodSelection(std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt; newTotalAndItems)
</del><ins>+void WebPaymentCoordinator::completePaymentMethodSelection(std::optional&lt;WebCore::PaymentMethodUpdate&gt;&amp;&amp; update)
</ins><span class="cx"> {
</span><del>-    m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompletePaymentMethodSelection(newTotalAndItems));
</del><ins>+    m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompletePaymentMethodSelection(update));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinator::completePaymentSession(WebCore::PaymentAuthorizationStatus status)
</del><ins>+void WebPaymentCoordinator::completePaymentSession(std::optional&lt;WebCore::PaymentAuthorizationResult&gt;&amp;&amp; result)
</ins><span class="cx"> {
</span><del>-    m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompletePaymentSession(static_cast&lt;uint32_t&gt;(status)));
</del><ins>+    m_webPage.send(Messages::WebPaymentCoordinatorProxy::CompletePaymentSession(result));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPaymentCoordinator::abortPaymentSession()
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessApplePayWebPaymentCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h (213600 => 213601)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h        2017-03-08 22:53:20 UTC (rev 213600)
+++ trunk/Source/WebKit2/WebProcess/ApplePay/WebPaymentCoordinator.h        2017-03-08 22:56:22 UTC (rev 213601)
</span><span class="lines">@@ -59,10 +59,11 @@
</span><span class="cx">     void openPaymentSetup(const String&amp; merchantIdentifier, const String&amp; domainName, std::function&lt;void (bool)&gt; completionHandler) override;
</span><span class="cx">     bool showPaymentUI(const WebCore::URL&amp; originatingURL, const Vector&lt;WebCore::URL&gt;&amp; linkIconURLs, const WebCore::PaymentRequest&amp;) override;
</span><span class="cx">     void completeMerchantValidation(const WebCore::PaymentMerchantSession&amp;) override;
</span><del>-    void completeShippingMethodSelection(WebCore::PaymentAuthorizationStatus, std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt; newTotalAndItems) override;
-    void completeShippingContactSelection(WebCore::PaymentAuthorizationStatus, const Vector&lt;WebCore::PaymentRequest::ShippingMethod&gt;&amp;, std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt; newTotalAndItems) override;
-    void completePaymentMethodSelection(std::optional&lt;WebCore::PaymentRequest::TotalAndLineItems&gt;) override;
-    void completePaymentSession(WebCore::PaymentAuthorizationStatus) override;
</del><ins>+    void completeShippingMethodSelection(std::optional&lt;WebCore::ShippingMethodUpdate&gt;&amp;&amp;) override;
+    void completeShippingContactSelection(std::optional&lt;WebCore::ShippingContactUpdate&gt;&amp;&amp;) override;
+    void completePaymentMethodSelection(std::optional&lt;WebCore::PaymentMethodUpdate&gt;&amp;&amp;) override;
+    void completePaymentSession(std::optional&lt;WebCore::PaymentAuthorizationResult&gt;&amp;&amp;) override;
+
</ins><span class="cx">     void abortPaymentSession() override;
</span><span class="cx"> 
</span><span class="cx">     void paymentCoordinatorDestroyed() override;
</span></span></pre>
</div>
</div>

</body>
</html>