<!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>[243443] trunk/Source/WebKit</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/243443">243443</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2019-03-25 11:26:10 -0700 (Mon, 25 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Apple Pay] Remove the AvailablePaymentNetworks synchronous message
https://bugs.webkit.org/show_bug.cgi?id=196180

Reviewed by Youenn Fablet.

Unlike many PassKit interactions, it's ok to call +[PKPaymentRequest availableNetworks]
without an entitlement. Therefore, we can call it from the web process directly rather than
synchronously messaging the entitled UI or networking process.

* Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
* Shared/ApplePay/WebPaymentCoordinatorProxy.h:
* Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
* SourcesCocoa.txt:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::availablePaymentNetworks):
* WebProcess/ApplePay/WebPaymentCoordinator.h:
* WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm: Added.
(WebKit::WebPaymentCoordinator::platformAvailablePaymentNetworks const):
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
(-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
(-[WKAccessibilityWebPageObjectBase setWebPage:]):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></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><a href="#trunkSourceWebKitSharedApplePaycocoaWebPaymentCoordinatorProxyCocoamm">trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm</a></li>
<li><a href="#trunkSourceWebKitSourcesCocoatxt">trunk/Source/WebKit/SourcesCocoa.txt</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitWebProcessApplePayWebPaymentCoordinatorcpp">trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessApplePayWebPaymentCoordinatorh">trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h</a></li>
<li><a href="#trunkSourceWebKitWebProcessWebPagemacWKAccessibilityWebPageObjectBasemm">trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebKit/WebProcess/ApplePay/cocoa/</li>
<li><a href="#trunkSourceWebKitWebProcessApplePaycocoaWebPaymentCoordinatorCocoamm">trunk/Source/WebKit/WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (243442 => 243443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2019-03-25 18:13:09 UTC (rev 243442)
+++ trunk/Source/WebKit/ChangeLog       2019-03-25 18:26:10 UTC (rev 243443)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2019-03-25  Andy Estes  <aestes@apple.com>
+
+        [Apple Pay] Remove the AvailablePaymentNetworks synchronous message
+        https://bugs.webkit.org/show_bug.cgi?id=196180
+
+        Reviewed by Youenn Fablet.
+
+        Unlike many PassKit interactions, it's ok to call +[PKPaymentRequest availableNetworks]
+        without an entitlement. Therefore, we can call it from the web process directly rather than
+        synchronously messaging the entitled UI or networking process.
+
+        * Shared/ApplePay/WebPaymentCoordinatorProxy.cpp:
+        * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
+        * Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in:
+        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+        * SourcesCocoa.txt:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
+        (WebKit::WebPaymentCoordinator::availablePaymentNetworks):
+        * WebProcess/ApplePay/WebPaymentCoordinator.h:
+        * WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm: Added.
+        (WebKit::WebPaymentCoordinator::platformAvailablePaymentNetworks const):
+        * WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm:
+        (-[WKAccessibilityWebPageObjectBase accessibilityRootObjectWrapper]):
+        (-[WKAccessibilityWebPageObjectBase setWebPage:]):
+
</ins><span class="cx"> 2019-03-25  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, tiny fix after r243388 to address API test failures on iOS
</span></span></pre></div>
<a id="trunkSourceWebKitSharedApplePayWebPaymentCoordinatorProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.cpp (243442 => 243443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.cpp       2019-03-25 18:13:09 UTC (rev 243442)
+++ trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.cpp  2019-03-25 18:26:10 UTC (rev 243443)
</span><span class="lines">@@ -68,11 +68,6 @@
</span><span class="cx">     return *m_destinationID;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPaymentCoordinatorProxy::availablePaymentNetworks(CompletionHandler<void(Vector<String>&&)>&& completionHandler)
-{
-    completionHandler(platformAvailablePaymentNetworks());
-}
-
</del><span class="cx"> void WebPaymentCoordinatorProxy::canMakePayments(CompletionHandler<void(bool)>&& reply)
</span><span class="cx"> {
</span><span class="cx">     reply(platformCanMakePayments());
</span></span></pre></div>
<a id="trunkSourceWebKitSharedApplePayWebPaymentCoordinatorProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h (243442 => 243443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h 2019-03-25 18:13:09 UTC (rev 243442)
+++ trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h    2019-03-25 18:26:10 UTC (rev 243443)
</span><span class="lines">@@ -111,7 +111,6 @@
</span><span class="cx">     void presenterWillValidateMerchant(PaymentAuthorizationPresenter&, const URL&) final;
</span><span class="cx"> 
</span><span class="cx">     // Message handlers
</span><del>-    void availablePaymentNetworks(CompletionHandler<void(Vector<String>&&)>&&);
</del><span class="cx">     void canMakePayments(CompletionHandler<void(bool)>&&);
</span><span class="cx">     void canMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, PAL::SessionID, CompletionHandler<void(bool)>&&);
</span><span class="cx">     void openPaymentSetup(const String& merchantIdentifier, const String& domainName, CompletionHandler<void(bool)>&&);
</span><span class="lines">@@ -133,7 +132,6 @@
</span><span class="cx">     void didReachFinalState();
</span><span class="cx">     void hidePaymentUI();
</span><span class="cx"> 
</span><del>-    Vector<String> platformAvailablePaymentNetworks();
</del><span class="cx">     bool platformCanMakePayments();
</span><span class="cx">     void platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, PAL::SessionID, WTF::Function<void(bool)>&& completionHandler);
</span><span class="cx">     void platformOpenPaymentSetup(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler);
</span></span></pre></div>
<a id="trunkSourceWebKitSharedApplePayWebPaymentCoordinatorProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in (243442 => 243443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in       2019-03-25 18:13:09 UTC (rev 243442)
+++ trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.messages.in  2019-03-25 18:26:10 UTC (rev 243443)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> 
</span><span class="cx"> messages -> WebPaymentCoordinatorProxy {
</span><span class="cx"> 
</span><del>-    AvailablePaymentNetworks() -> (Vector<String> availablePaymentNetworks) Synchronous
</del><span class="cx">     CanMakePayments() -> (bool result) Synchronous
</span><span class="cx">     CanMakePaymentsWithActiveCard(String merchantIdentifier, String domainName, PAL::SessionID sessionID) -> (bool canMakePayments) Async
</span><span class="cx">     OpenPaymentSetup(String merchantIdentifier, String domainName) -> (bool result) Async
</span></span></pre></div>
<a id="trunkSourceWebKitSharedApplePaycocoaWebPaymentCoordinatorProxyCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (243442 => 243443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm     2019-03-25 18:13:09 UTC (rev 243442)
+++ trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm        2019-03-25 18:26:10 UTC (rev 243443)
</span><span class="lines">@@ -349,21 +349,6 @@
</span><span class="cx">     m_authorizationPresenter->completePaymentMethodSelection(update);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector<String> WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks()
-{
-#if PLATFORM(MAC)
-    if (!PAL::isPassKitFrameworkAvailable())
-        return { };
-#endif
-
-    NSArray<PKPaymentNetwork> *availableNetworks = [PAL::getPKPaymentRequestClass() availableNetworks];
-    Vector<String> result;
-    result.reserveInitialCapacity(availableNetworks.count);
-    for (PKPaymentNetwork network in availableNetworks)
-        result.uncheckedAppend(network);
-    return result;
-}
-
</del><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(APPLE_PAY)
</span></span></pre></div>
<a id="trunkSourceWebKitSourcesCocoatxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/SourcesCocoa.txt (243442 => 243443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/SourcesCocoa.txt     2019-03-25 18:13:09 UTC (rev 243442)
+++ trunk/Source/WebKit/SourcesCocoa.txt        2019-03-25 18:26:10 UTC (rev 243443)
</span><span class="lines">@@ -494,6 +494,8 @@
</span><span class="cx"> 
</span><span class="cx"> WebProcess/ApplePay/WebPaymentCoordinator.cpp
</span><span class="cx"> 
</span><ins>+WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm
+
</ins><span class="cx"> WebProcess/cocoa/PlaybackSessionManager.mm
</span><span class="cx"> WebProcess/cocoa/UserMediaCaptureManager.cpp
</span><span class="cx"> WebProcess/cocoa/VideoFullscreenManager.mm
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (243442 => 243443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj     2019-03-25 18:13:09 UTC (rev 243442)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2019-03-25 18:26:10 UTC (rev 243443)
</span><span class="lines">@@ -3903,6 +3903,7 @@
</span><span class="cx">          A1A4FE5918DCE9FA00B5EA8A /* _WKDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKDownloadInternal.h; sourceTree = "<group>"; };
</span><span class="cx">          A1A4FE6018DD54A400B5EA8A /* _WKDownloadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKDownloadDelegate.h; sourceTree = "<group>"; };
</span><span class="cx">          A1B89B92221E023300EB4CEA /* SDKVariant.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = SDKVariant.xcconfig; sourceTree = "<group>"; };
</span><ins>+               A1B9CA382246E54A003D6DCA /* WebPaymentCoordinatorCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPaymentCoordinatorCocoa.mm; sourceTree = "<group>"; };
</ins><span class="cx">           A1C512C6190656E500448914 /* WebPreviewLoaderClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebPreviewLoaderClient.cpp; path = ios/WebPreviewLoaderClient.cpp; sourceTree = "<group>"; };
</span><span class="cx">          A1C512C7190656E500448914 /* WebPreviewLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebPreviewLoaderClient.h; path = ios/WebPreviewLoaderClient.h; sourceTree = "<group>"; };
</span><span class="cx">          A1DF631018E0B7C8003A3E2A /* DownloadClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DownloadClient.mm; sourceTree = "<group>"; };
</span><span class="lines">@@ -5296,6 +5297,7 @@
</span><span class="cx">          1AB1F7701D1B2F5D007C9BD1 /* ApplePay */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span><ins>+                               A1B9CA372246E525003D6DCA /* cocoa */,
</ins><span class="cx">                           1AB1F7711D1B2F7E007C9BD1 /* WebPaymentCoordinator.cpp */,
</span><span class="cx">                          1AB1F7721D1B2F7E007C9BD1 /* WebPaymentCoordinator.h */,
</span><span class="cx">                          1AB1F7731D1B2F7E007C9BD1 /* WebPaymentCoordinator.messages.in */,
</span><span class="lines">@@ -7190,6 +7192,14 @@
</span><span class="cx">                  path = ios;
</span><span class="cx">                  sourceTree = "<group>";
</span><span class="cx">          };
</span><ins>+               A1B9CA372246E525003D6DCA /* cocoa */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A1B9CA382246E54A003D6DCA /* WebPaymentCoordinatorCocoa.mm */,
+                       );
+                       path = cocoa;
+                       sourceTree = "<group>";
+               };
</ins><span class="cx">           A1E6886E1F6E2B82007006A6 /* mac */ = {
</span><span class="cx">                  isa = PBXGroup;
</span><span class="cx">                  children = (
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessApplePayWebPaymentCoordinatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp (243442 => 243443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp        2019-03-25 18:13:09 UTC (rev 243442)
+++ trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.cpp   2019-03-25 18:26:10 UTC (rev 243443)
</span><span class="lines">@@ -59,28 +59,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-const WebPaymentCoordinator::AvailablePaymentNetworksSet& WebPaymentCoordinator::availablePaymentNetworks()
</del><ins>+Optional<String> WebPaymentCoordinator::validatedPaymentNetwork(const String& paymentNetwork)
</ins><span class="cx"> {
</span><del>-    if (m_availablePaymentNetworks)
-        return *m_availablePaymentNetworks;
</del><ins>+    if (!m_availablePaymentNetworks)
+        m_availablePaymentNetworks = platformAvailablePaymentNetworks();
</ins><span class="cx"> 
</span><del>-    m_availablePaymentNetworks = WebPaymentCoordinator::AvailablePaymentNetworksSet();
-
-    Vector<String> availablePaymentNetworks;
-    using AvailablePaymentNetworksMessage = Messages::WebPaymentCoordinatorProxy::AvailablePaymentNetworks;
-    if (sendSync(AvailablePaymentNetworksMessage(), AvailablePaymentNetworksMessage::Reply(availablePaymentNetworks))) {
-        for (auto& network : availablePaymentNetworks)
-            m_availablePaymentNetworks->add(network);
-    }
-
-    return *m_availablePaymentNetworks;
-}
-
-Optional<String> WebPaymentCoordinator::validatedPaymentNetwork(const String& paymentNetwork)
-{
-    auto& paymentNetworks = availablePaymentNetworks();
-    auto result = paymentNetworks.find(paymentNetwork);
-    if (result == paymentNetworks.end())
</del><ins>+    auto result = m_availablePaymentNetworks->find(paymentNetwork);
+    if (result == m_availablePaymentNetworks->end())
</ins><span class="cx">         return WTF::nullopt;
</span><span class="cx">     return *result;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessApplePayWebPaymentCoordinatorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h (243442 => 243443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h  2019-03-25 18:13:09 UTC (rev 243442)
+++ trunk/Source/WebKit/WebProcess/ApplePay/WebPaymentCoordinator.h     2019-03-25 18:26:10 UTC (rev 243443)
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     using AvailablePaymentNetworksSet = HashSet<String, ASCIICaseInsensitiveHash>;
</span><del>-    const AvailablePaymentNetworksSet& availablePaymentNetworks();
</del><ins>+    static AvailablePaymentNetworksSet platformAvailablePaymentNetworks();
</ins><span class="cx"> 
</span><span class="cx">     WebPage& m_webPage;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessApplePaycocoaWebPaymentCoordinatorCocoamm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm (0 => 243443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm                              (rev 0)
+++ trunk/Source/WebKit/WebProcess/ApplePay/cocoa/WebPaymentCoordinatorCocoa.mm 2019-03-25 18:26:10 UTC (rev 243443)
</span><span class="lines">@@ -0,0 +1,50 @@
</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 "WebPaymentCoordinator.h"
+
+#if ENABLE(APPLE_PAY) && PLATFORM(COCOA)
+
+#import <pal/cocoa/PassKitSoftLink.h>
+
+namespace WebKit {
+
+WebPaymentCoordinator::AvailablePaymentNetworksSet WebPaymentCoordinator::platformAvailablePaymentNetworks()
+{
+#if PLATFORM(MAC)
+    if (!PAL::isPassKitFrameworkAvailable())
+        return { };
+#endif
+
+    WebPaymentCoordinator::AvailablePaymentNetworksSet availableNetworks;
+    for (PKPaymentNetwork network in [PAL::getPKPaymentRequestClass() availableNetworks])
+        availableNetworks.add(network);
+    return availableNetworks;
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(APPLE_PAY) && PLATFORM(COCOA)
</ins></span></pre></div>
<a id="trunkSourceWebKitWebProcessWebPagemacWKAccessibilityWebPageObjectBasemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm (243442 => 243443)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm   2019-03-25 18:13:09 UTC (rev 243442)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/WKAccessibilityWebPageObjectBase.mm      2019-03-25 18:26:10 UTC (rev 243443)
</span><span class="lines">@@ -44,8 +44,6 @@
</span><span class="cx"> #import <WebCore/Scrollbar.h>
</span><span class="cx"> #import <wtf/ObjCRuntimeExtras.h>
</span><span class="cx"> 
</span><del>-using namespace WebKit;
-
</del><span class="cx"> @implementation WKAccessibilityWebPageObjectBase
</span><span class="cx"> 
</span><span class="cx"> - (WebCore::AXObjectCache*)axObjectCache
</span><span class="lines">@@ -132,7 +130,7 @@
</span><span class="cx">         return [self isolatedTreeRootObject];
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (AXObjectCache* cache = [self axObjectCache]) {
</del><ins>+    if (auto cache = [self axObjectCache]) {
</ins><span class="cx">         if (WebCore::AccessibilityObject* root = cache->rootObject())
</span><span class="cx">             return root->wrapper();
</span><span class="cx">     }
</span><span class="lines">@@ -140,7 +138,7 @@
</span><span class="cx">     return nil;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)setWebPage:(WebPage*)page
</del><ins>+- (void)setWebPage:(WebKit::WebPage*)page
</ins><span class="cx"> {
</span><span class="cx">     m_page = page;
</span><span class="cx">     
</span></span></pre>
</div>
</div>

</body>
</html>