| 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 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 m_completeTimer.stop(); | 658 m_completeTimer.stop(); |
| 659 onCompleteTimeout(0); | 659 onCompleteTimeout(0); |
| 660 } | 660 } |
| 661 | 661 |
| 662 PaymentRequest::PaymentRequest(Document& document, | 662 PaymentRequest::PaymentRequest(Document& document, |
| 663 const HeapVector<PaymentMethodData>& methodData, | 663 const HeapVector<PaymentMethodData>& methodData, |
| 664 const PaymentDetails& details, | 664 const PaymentDetails& details, |
| 665 const PaymentOptions& options, | 665 const PaymentOptions& options, |
| 666 ExceptionState& exceptionState) | 666 ExceptionState& exceptionState) |
| 667 : ContextLifecycleObserver(&document), | 667 : ContextLifecycleObserver(&document), |
| 668 ActiveScriptWrappable(this), | 668 ActiveScriptWrappable<PaymentRequest>(this), |
| 669 m_options(options), | 669 m_options(options), |
| 670 m_clientBinding(this), | 670 m_clientBinding(this), |
| 671 m_completeTimer(this, &PaymentRequest::onCompleteTimeout) { | 671 m_completeTimer(this, &PaymentRequest::onCompleteTimeout) { |
| 672 Vector<payments::mojom::blink::PaymentMethodDataPtr> validatedMethodData; | 672 Vector<payments::mojom::blink::PaymentMethodDataPtr> validatedMethodData; |
| 673 validateAndConvertPaymentMethodData(methodData, validatedMethodData, | 673 validateAndConvertPaymentMethodData(methodData, validatedMethodData, |
| 674 exceptionState); | 674 exceptionState); |
| 675 if (exceptionState.hadException()) | 675 if (exceptionState.hadException()) |
| 676 return; | 676 return; |
| 677 | 677 |
| 678 if (!document.isSecureContext()) { | 678 if (!document.isSecureContext()) { |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 m_completeResolver.clear(); | 912 m_completeResolver.clear(); |
| 913 m_showResolver.clear(); | 913 m_showResolver.clear(); |
| 914 m_abortResolver.clear(); | 914 m_abortResolver.clear(); |
| 915 m_canMakePaymentResolver.clear(); | 915 m_canMakePaymentResolver.clear(); |
| 916 if (m_clientBinding.is_bound()) | 916 if (m_clientBinding.is_bound()) |
| 917 m_clientBinding.Close(); | 917 m_clientBinding.Close(); |
| 918 m_paymentProvider.reset(); | 918 m_paymentProvider.reset(); |
| 919 } | 919 } |
| 920 | 920 |
| 921 } // namespace blink | 921 } // namespace blink |
| OLD | NEW |