OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/payments/PaymentRequest.h" | 5 #include "modules/payments/PaymentRequest.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
10 #include "bindings/core/v8/V8StringResource.h" | 10 #include "bindings/core/v8/V8StringResource.h" |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 | 700 |
701 if (details.hasError()) { | 701 if (details.hasError()) { |
702 exceptionState.throwTypeError("Error message not allowed in constructor"); | 702 exceptionState.throwTypeError("Error message not allowed in constructor"); |
703 return; | 703 return; |
704 } | 704 } |
705 | 705 |
706 if (m_options.requestShipping()) | 706 if (m_options.requestShipping()) |
707 m_shippingType = getValidShippingType(m_options.shippingType()); | 707 m_shippingType = getValidShippingType(m_options.shippingType()); |
708 | 708 |
709 document.frame()->interfaceProvider()->getInterface( | 709 document.frame()->interfaceProvider()->getInterface( |
710 mojo::GetProxy(&m_paymentProvider)); | 710 mojo::MakeRequest(&m_paymentProvider)); |
711 m_paymentProvider.set_connection_error_handler(convertToBaseCallback( | 711 m_paymentProvider.set_connection_error_handler(convertToBaseCallback( |
712 WTF::bind(&PaymentRequest::OnError, wrapWeakPersistent(this), | 712 WTF::bind(&PaymentRequest::OnError, wrapWeakPersistent(this), |
713 PaymentErrorReason::UNKNOWN))); | 713 PaymentErrorReason::UNKNOWN))); |
714 m_paymentProvider->Init( | 714 m_paymentProvider->Init( |
715 m_clientBinding.CreateInterfacePtrAndBind(), | 715 m_clientBinding.CreateInterfacePtrAndBind(), |
716 std::move(validatedMethodData), std::move(validatedDetails), | 716 std::move(validatedMethodData), std::move(validatedDetails), |
717 payments::mojom::blink::PaymentOptions::From(m_options)); | 717 payments::mojom::blink::PaymentOptions::From(m_options)); |
718 } | 718 } |
719 | 719 |
720 void PaymentRequest::contextDestroyed() { | 720 void PaymentRequest::contextDestroyed() { |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 m_completeResolver.clear(); | 913 m_completeResolver.clear(); |
914 m_showResolver.clear(); | 914 m_showResolver.clear(); |
915 m_abortResolver.clear(); | 915 m_abortResolver.clear(); |
916 m_canMakePaymentResolver.clear(); | 916 m_canMakePaymentResolver.clear(); |
917 if (m_clientBinding.is_bound()) | 917 if (m_clientBinding.is_bound()) |
918 m_clientBinding.Close(); | 918 m_clientBinding.Close(); |
919 m_paymentProvider.reset(); | 919 m_paymentProvider.reset(); |
920 } | 920 } |
921 | 921 |
922 } // namespace blink | 922 } // namespace blink |
OLD | NEW |