Move ApplePaySession from legacy to new DOM exceptions
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Oct 2016 02:14:05 +0000 (02:14 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 10 Oct 2016 02:14:05 +0000 (02:14 +0000)
commit717001408adf9c145b9e3bc6099b4364c6524759
tree8a527b6e117ac9870d38c8f3040528175e688419
parent7f19652898ab57af89cb3713f179ab60a4557ca2
Move ApplePaySession from legacy to new DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=163191

Reviewed by Sam Weinig.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::create): Use ExceptionOr.
(WebCore::ApplePaySession::ApplePaySession): Moved initialization
of two of the data members to class definition.
(WebCore::ApplePaySession::supportsVersion): Use ExceptionOr.
(WebCore::ApplePaySession::canMakePayments): Ditto.
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard): Ditto.
(WebCore::ApplePaySession::openPaymentSetup): Ditto.
(WebCore::ApplePaySession::begin): Ditto.
(WebCore::ApplePaySession::abort): Ditto.
(WebCore::ApplePaySession::completeMerchantValidation): Ditto.
(WebCore::ApplePaySession::completeShippingMethodSelection): Ditto.
(WebCore::ApplePaySession::completeShippingContactSelection): Ditto.
(WebCore::ApplePaySession::completePaymentMethodSelection): Ditto.
(WebCore::ApplePaySession::completePayment): Ditto.
(WebCore::ApplePaySession::validateMerchant): Use auto and get instead of
using a RefPtr type and * for event dispatching.
(WebCore::ApplePaySession::didAuthorizePayment): Ditto.
(WebCore::ApplePaySession::didSelectShippingMethod): Ditto.
(WebCore::ApplePaySession::didSelectShippingContact): Ditto.
(WebCore::ApplePaySession::didSelectPaymentMethod): Ditto.
(WebCore::ApplePaySession::didCancelPayment): Ditto.
(WebCore::ApplePaySession::paymentCoordinator): Moved dereferencing
inside the downcast.

* Modules/applepay/ApplePaySession.h: Updated for changes above.

* Modules/applepay/ApplePaySession.idl: Use MayThrowException.

* bindings/js/JSApplePaySessionCustom.cpp:
(WebCore::JSApplePaySession::completeShippingMethodSelection):
Use propagateException.
(WebCore::JSApplePaySession::completeShippingContactSelection): Ditto.
(WebCore::JSApplePaySession::completePaymentMethodSelection): Ditto.

* bindings/js/JSDOMBinding.h: Added implementation of toJSBoolean.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorDefinition): Generate the different arguments for
toJSNewlyCreated when ConstructorMayThrowException is specified that
activate the version of that function that handles exceptions.

* bindings/scripts/IDLAttributes.txt: Added ConstructorMayThrowException.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@206977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/Modules/applepay/ApplePaySession.cpp
Source/WebCore/Modules/applepay/ApplePaySession.h
Source/WebCore/Modules/applepay/ApplePaySession.idl
Source/WebCore/bindings/js/JSApplePaySessionCustom.cpp
Source/WebCore/bindings/js/JSDOMBinding.h
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/IDLAttributes.txt