[webkit-changes] [WebKit/WebKit] c9b8f3: Migrate PaymentInstallmentConfiguration to generat...

Alex Christensen noreply at github.com
Wed May 3 13:39:04 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c9b8f3887b04ea13be9d0365da205aec3689bae3
      https://github.com/WebKit/WebKit/commit/c9b8f3887b04ea13be9d0365da205aec3689bae3
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2023-05-03 (Wed, 03 May 2023)

  Changed paths:
    A LayoutTests/http/tests/paymentrequest/installment-configuration.https-expected.txt
    A LayoutTests/http/tests/paymentrequest/installment-configuration.https.html
    M Source/WebCore/Modules/applepay/ApplePaySetupFeatureTypeWebCore.h
    M Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h
    M Source/WebCore/Modules/applepay/PaymentInstallmentConfiguration.mm
    M Source/WebCore/Modules/applepay/PaymentInstallmentConfigurationWebCore.h
    M Source/WebCore/WebCore.xcodeproj/project.pbxproj
    M Source/WebCore/testing/MockPaymentCoordinator.cpp
    M Source/WebCore/testing/MockPaymentCoordinator.h
    M Source/WebCore/testing/MockPaymentCoordinator.idl
    M Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm
    M Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm
    M Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm
    M Source/WebKit/Shared/WebCoreArgumentCoders.h
    M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in

  Log Message:
  -----------
  Migrate PaymentInstallmentConfiguration to generated serialization
https://bugs.webkit.org/show_bug.cgi?id=256264
rdar://108849628

Reviewed by Andy Estes.

A previous attempt at doing this had PaymentInstallmentConfiguration::platformConfiguration
always return a non-null, possibly empty configuration.  That caused an issue so it was reverted.
This attempt is the same as 263335 at main except for the following changes:

1. I store a std::optional<ApplePayInstallmentConfiguration> to capture the nullness of the
   PKPaymentInstallmentConfiguration from the constructor and use that to return null when appropriate.
2. I added a layout test that verifies that null successfully roundtrips through PaymentInstallmentConfiguration
   using an internals function to do the test and return whether it passed or not.
3. addApplicationMetadata takes a ApplePayInstallmentConfiguration instead of a const reference.
   This was feedback given on 263335 at main and is small and only cosmetic.

* LayoutTests/http/tests/paymentrequest/installment-configuration.https-expected.txt: Added.
* LayoutTests/http/tests/paymentrequest/installment-configuration.https.html: Added.
* Source/WebCore/Modules/applepay/ApplePaySetupFeatureTypeWebCore.h:
* Source/WebCore/Modules/applepay/ApplePaySetupFeatureWebCore.h:
* Source/WebCore/Modules/applepay/PaymentInstallmentConfiguration.mm:
(WebCore::applicationMetadataDictionary):
(WebCore::applicationMetadataString):
(WebCore::createPlatformConfiguration):
(WebCore::PaymentInstallmentConfiguration::create):
(WebCore::addApplicationMetadata):
(WebCore::PaymentInstallmentConfiguration::PaymentInstallmentConfiguration):
(WebCore::PaymentInstallmentConfiguration::applePayInstallmentConfiguration const):
(WebCore::PaymentInstallmentConfiguration::platformConfiguration const):
(WebCore::PaymentInstallmentConfiguration::applePayInstallmentConfiguration):
* Source/WebCore/Modules/applepay/PaymentInstallmentConfigurationWebCore.h:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::installmentConfigurationReturnsNil const):
* Source/WebCore/testing/MockPaymentCoordinator.h:
* Source/WebCore/testing/MockPaymentCoordinator.idl:
* Source/WebKit/Shared/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformPaymentRequest):
* Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm:
(IPC::shouldEnableStrictMode):
* Source/WebKit/Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<WebCore::PaymentInstallmentConfiguration>::encode): Deleted.
(IPC::ArgumentCoder<WebCore::PaymentInstallmentConfiguration>::decode): Deleted.
* Source/WebKit/Shared/WebCoreArgumentCoders.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:

Canonical link: https://commits.webkit.org/263647@main




More information about the webkit-changes mailing list