[Payment Request] Events cleanup
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2018 21:48:13 +0000 (21:48 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Sep 2018 21:48:13 +0000 (21:48 +0000)
commit986c7d474c742a5681286f51a4fffded6cd3599d
treead264cd128cd6561f1b3409227ac501e96f78cfb
parente5eb87c6ed433a309d4c2cb801289f22f26a4a21
[Payment Request] Events cleanup
https://bugs.webkit.org/show_bug.cgi?id=189925

Reviewed by Simon Fraser.

1. Constructed MerchantValidationEvents (and ApplePayValidateMerchantEvents) with rvalue
references to validationURLs.
2. Instead of MerchantValidationEvent and PaymentRequestUpdateEvent having a
RefPtr<PaymentRequest>, downcasted their target to a PaymentRequest. Trusted versions of
these events are always dispatched to a PaymentRequest object.
3. Defined MerchantValidationEventInit in MerchantValidationEvent.idl instead of having a
separate .idl and .h for this dictionary.

No new tests. No change in behavior.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::validateMerchant):
* Modules/applepay/ApplePaySession.h:
* Modules/applepay/ApplePayValidateMerchantEvent.cpp:
(WebCore::ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent):
* Modules/applepay/ApplePayValidateMerchantEvent.h:
(WebCore::ApplePayValidateMerchantEvent::create):
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::validateMerchant):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentSession.h:
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::validateMerchant):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/MerchantValidationEvent.cpp:
(WebCore::MerchantValidationEvent::create):
(WebCore::MerchantValidationEvent::MerchantValidationEvent):
(WebCore::MerchantValidationEvent::complete):
* Modules/paymentrequest/MerchantValidationEvent.h:
* Modules/paymentrequest/MerchantValidationEvent.idl:
* Modules/paymentrequest/MerchantValidationEventInit.h: Removed.
* Modules/paymentrequest/MerchantValidationEventInit.idl: Removed.
* Modules/paymentrequest/PaymentMethodChangeEvent.cpp:
(WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent):
* Modules/paymentrequest/PaymentMethodChangeEvent.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::shippingAddressChanged):
(WebCore::PaymentRequest::shippingOptionChanged):
(WebCore::PaymentRequest::paymentMethodChanged):
* Modules/paymentrequest/PaymentRequest.h:
(isType):
* Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
(WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
(WebCore::PaymentRequestUpdateEvent::updateWith):
* Modules/paymentrequest/PaymentRequestUpdateEvent.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventTarget.cpp:
(WebCore::EventTarget::isPaymentRequest const):
* dom/EventTarget.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/applepay/ApplePaySession.cpp
Source/WebCore/Modules/applepay/ApplePaySession.h
Source/WebCore/Modules/applepay/ApplePayValidateMerchantEvent.cpp
Source/WebCore/Modules/applepay/ApplePayValidateMerchantEvent.h
Source/WebCore/Modules/applepay/PaymentCoordinator.cpp
Source/WebCore/Modules/applepay/PaymentCoordinator.h
Source/WebCore/Modules/applepay/PaymentSession.h
Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp
Source/WebCore/Modules/applepay/paymentrequest/ApplePayPaymentHandler.h
Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.cpp
Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.h
Source/WebCore/Modules/paymentrequest/MerchantValidationEvent.idl
Source/WebCore/Modules/paymentrequest/MerchantValidationEventInit.h [deleted file]
Source/WebCore/Modules/paymentrequest/MerchantValidationEventInit.idl [deleted file]
Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.cpp
Source/WebCore/Modules/paymentrequest/PaymentMethodChangeEvent.h
Source/WebCore/Modules/paymentrequest/PaymentRequest.cpp
Source/WebCore/Modules/paymentrequest/PaymentRequest.h
Source/WebCore/Modules/paymentrequest/PaymentRequestUpdateEvent.cpp
Source/WebCore/Modules/paymentrequest/PaymentRequestUpdateEvent.h
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/EventTarget.cpp
Source/WebCore/dom/EventTarget.h