Title: [261617] trunk/Source/WebKit
Revision
261617
Author
[email protected]
Date
2020-05-13 09:02:31 -0700 (Wed, 13 May 2020)

Log Message

REGRESSION (r261254): Broke Apple Pay on macOS
https://bugs.webkit.org/show_bug.cgi?id=211826
<rdar://problem/63161750>

Reviewed by Alex Christensen.

r261254 dropped the code needed to add the WebPaymentCoordinatorProxy as an IPC message receiver.
This patch re-introduces the code in order to address the regression.

No new tests, tested manually on https://applepaydemo.apple.com.

* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
(WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAddMessageReceiver):
(WebKit::NetworkConnectionToWebProcess::paymentCoordinatorRemoveMessageReceiver):
* Shared/ApplePay/WebPaymentCoordinatorProxy.h:
* Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy):
(WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy):
* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver):
(WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver):
* UIProcess/WebPageProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (261616 => 261617)


--- trunk/Source/WebKit/ChangeLog	2020-05-13 14:42:45 UTC (rev 261616)
+++ trunk/Source/WebKit/ChangeLog	2020-05-13 16:02:31 UTC (rev 261617)
@@ -1,3 +1,29 @@
+2020-05-13  Chris Dumez  <[email protected]>
+
+        REGRESSION (r261254): Broke Apple Pay on macOS
+        https://bugs.webkit.org/show_bug.cgi?id=211826
+        <rdar://problem/63161750>
+
+        Reviewed by Alex Christensen.
+
+        r261254 dropped the code needed to add the WebPaymentCoordinatorProxy as an IPC message receiver.
+        This patch re-introduces the code in order to address the regression.
+
+        No new tests, tested manually on https://applepaydemo.apple.com.
+
+        * NetworkProcess/NetworkConnectionToWebProcess.h:
+        * NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm:
+        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorAddMessageReceiver):
+        (WebKit::NetworkConnectionToWebProcess::paymentCoordinatorRemoveMessageReceiver):
+        * Shared/ApplePay/WebPaymentCoordinatorProxy.h:
+        * Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
+        (WebKit::WebPaymentCoordinatorProxy::WebPaymentCoordinatorProxy):
+        (WebKit::WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy):
+        * UIProcess/Cocoa/WebPageProxyCocoa.mm:
+        (WebKit::WebPageProxy::paymentCoordinatorAddMessageReceiver):
+        (WebKit::WebPageProxy::paymentCoordinatorRemoveMessageReceiver):
+        * UIProcess/WebPageProxy.h:
+
 2020-05-13  Zan Dobersek  <[email protected]>
 
         REGRESSION(r260571): RequestedScrollPosition doesn't have its scroll change applied to layers anymore

Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h (261616 => 261617)


--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h	2020-05-13 14:42:45 UTC (rev 261616)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h	2020-05-13 16:02:31 UTC (rev 261617)
@@ -326,6 +326,8 @@
     const String& paymentCoordinatorSourceApplicationBundleIdentifier(const WebPaymentCoordinatorProxy&) final;
     const String& paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&) final;
     std::unique_ptr<PaymentAuthorizationPresenter> paymentCoordinatorAuthorizationPresenter(WebPaymentCoordinatorProxy&, PKPaymentRequest *) final;
+    void paymentCoordinatorAddMessageReceiver(WebPaymentCoordinatorProxy&, IPC::ReceiverName, IPC::MessageReceiver&) final;
+    void paymentCoordinatorRemoveMessageReceiver(WebPaymentCoordinatorProxy&, IPC::ReceiverName) final;
 #endif
 
     Ref<IPC::Connection> m_connection;

Modified: trunk/Source/WebKit/NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm (261616 => 261617)


--- trunk/Source/WebKit/NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm	2020-05-13 14:42:45 UTC (rev 261616)
+++ trunk/Source/WebKit/NetworkProcess/ios/NetworkConnectionToWebProcessIOS.mm	2020-05-13 16:02:31 UTC (rev 261617)
@@ -85,6 +85,14 @@
     return makeUnique<PaymentAuthorizationController>(coordinator, request);
 }
 
+void NetworkConnectionToWebProcess::paymentCoordinatorAddMessageReceiver(WebPaymentCoordinatorProxy&, IPC::ReceiverName, IPC::MessageReceiver&)
+{
+}
+
+void NetworkConnectionToWebProcess::paymentCoordinatorRemoveMessageReceiver(WebPaymentCoordinatorProxy&, IPC::ReceiverName)
+{
+}
+
 #endif // ENABLE(APPLE_PAY_REMOTE_UI)
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h (261616 => 261617)


--- trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h	2020-05-13 14:42:45 UTC (rev 261616)
+++ trunk/Source/WebKit/Shared/ApplePay/WebPaymentCoordinatorProxy.h	2020-05-13 16:02:31 UTC (rev 261617)
@@ -86,6 +86,8 @@
         virtual const String& paymentCoordinatorBoundInterfaceIdentifier(const WebPaymentCoordinatorProxy&) = 0;
         virtual const String& paymentCoordinatorSourceApplicationBundleIdentifier(const WebPaymentCoordinatorProxy&) = 0;
         virtual const String& paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&) = 0;
+        virtual void paymentCoordinatorAddMessageReceiver(WebPaymentCoordinatorProxy&, IPC::ReceiverName, IPC::MessageReceiver&) = 0;
+        virtual void paymentCoordinatorRemoveMessageReceiver(WebPaymentCoordinatorProxy&, IPC::ReceiverName) = 0;
 #if PLATFORM(IOS_FAMILY)
         virtual UIViewController *paymentCoordinatorPresentingViewController(const WebPaymentCoordinatorProxy&) = 0;
         virtual const String& paymentCoordinatorCTDataConnectionServiceType(const WebPaymentCoordinatorProxy&) = 0;

Modified: trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm (261616 => 261617)


--- trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2020-05-13 14:42:45 UTC (rev 261616)
+++ trunk/Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm	2020-05-13 16:02:31 UTC (rev 261617)
@@ -79,6 +79,7 @@
     : m_client(client)
     , m_canMakePaymentsQueue(WorkQueue::create("com.apple.WebKit.CanMakePayments"))
 {
+    m_client.paymentCoordinatorAddMessageReceiver(*this, Messages::WebPaymentCoordinatorProxy::messageReceiverName(), *this);
 }
 
 WebPaymentCoordinatorProxy::~WebPaymentCoordinatorProxy()
@@ -85,6 +86,8 @@
 {
     if (m_state != State::Idle)
         hidePaymentUI();
+
+    m_client.paymentCoordinatorRemoveMessageReceiver(*this, Messages::WebPaymentCoordinatorProxy::messageReceiverName());
 }
 
 void WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard(const String& merchantIdentifier, const String& domainName, WTF::Function<void(bool)>&& completionHandler)

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm (261616 => 261617)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2020-05-13 14:42:45 UTC (rev 261616)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm	2020-05-13 16:02:31 UTC (rev 261617)
@@ -284,6 +284,16 @@
     return websiteDataStore().configuration().sourceApplicationSecondaryIdentifier();
 }
 
+void WebPageProxy::paymentCoordinatorAddMessageReceiver(WebPaymentCoordinatorProxy&, IPC::ReceiverName receiverName, IPC::MessageReceiver& messageReceiver)
+{
+    process().addMessageReceiver(receiverName, m_webPageID, messageReceiver);
+}
+
+void WebPageProxy::paymentCoordinatorRemoveMessageReceiver(WebPaymentCoordinatorProxy&, IPC::ReceiverName receiverName)
+{
+    process().removeMessageReceiver(receiverName, m_webPageID);
+}
+
 #endif
 
 #if ENABLE(SPEECH_SYNTHESIS)

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (261616 => 261617)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2020-05-13 14:42:45 UTC (rev 261616)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2020-05-13 16:02:31 UTC (rev 261617)
@@ -2283,6 +2283,8 @@
     const String& paymentCoordinatorBoundInterfaceIdentifier(const WebPaymentCoordinatorProxy&) final;
     const String& paymentCoordinatorSourceApplicationBundleIdentifier(const WebPaymentCoordinatorProxy&) final;
     const String& paymentCoordinatorSourceApplicationSecondaryIdentifier(const WebPaymentCoordinatorProxy&) final;
+    void paymentCoordinatorAddMessageReceiver(WebPaymentCoordinatorProxy&, IPC::ReceiverName, IPC::MessageReceiver&) final;
+    void paymentCoordinatorRemoveMessageReceiver(WebPaymentCoordinatorProxy&, IPC::ReceiverName) final;
 #endif
 #if ENABLE(APPLE_PAY) && PLATFORM(IOS_FAMILY)
     UIViewController *paymentCoordinatorPresentingViewController(const WebPaymentCoordinatorProxy&) final;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to