Chromium Code Reviews| 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/JSONValuesForV8.h" | 8 #include "bindings/core/v8/JSONValuesForV8.h" |
| 9 #include "bindings/core/v8/ScriptPromiseResolver.h" | 9 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 10 #include "bindings/core/v8/ScriptState.h" | 10 #include "bindings/core/v8/ScriptState.h" |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 449 clearResolversAndCloseMojoConnection(); | 449 clearResolversAndCloseMojoConnection(); |
| 450 return; | 450 return; |
| 451 } | 451 } |
| 452 | 452 |
| 453 if (m_options.requestShipping()) | 453 if (m_options.requestShipping()) |
| 454 m_shippingOption = getSelectedShippingOption(details); | 454 m_shippingOption = getSelectedShippingOption(details); |
| 455 | 455 |
| 456 m_paymentProvider->UpdateWith(mojom::blink::PaymentDetails::From(details)); | 456 m_paymentProvider->UpdateWith(mojom::blink::PaymentDetails::From(details)); |
| 457 } | 457 } |
| 458 | 458 |
| 459 void PaymentRequest::onUpdatePaymentDetailsFailure(const ScriptValue& error) | 459 void PaymentRequest::onUpdatePaymentDetailsFailure(const ScriptValue& error) |
|
please use gerrit instead
2016/07/29 15:40:50
Change ScriptValue to String
pals
2016/08/01 11:18:23
Done.
| |
| 460 { | 460 { |
| 461 String message; | 461 String message; |
| 462 error.toString(message); | 462 error.toString(message); |
| 463 | 463 |
| 464 abortPaymentRequest(message); | |
| 465 } | |
| 466 | |
| 467 void PaymentRequest::abortPaymentRequest(const String& message) | |
| 468 { | |
|
please use gerrit instead
2016/07/29 15:40:50
Remove lines 461-468.
pals
2016/08/01 11:18:23
Done.
| |
| 464 if (m_showResolver) | 469 if (m_showResolver) |
| 465 m_showResolver->reject(DOMException::create(AbortError, message)); | 470 m_showResolver->reject(DOMException::create(AbortError, message)); |
| 466 if (m_completeResolver) | 471 if (m_completeResolver) |
| 467 m_completeResolver->reject(DOMException::create(AbortError, message)); | 472 m_completeResolver->reject(DOMException::create(AbortError, message)); |
| 468 clearResolversAndCloseMojoConnection(); | 473 clearResolversAndCloseMojoConnection(); |
| 469 } | 474 } |
| 470 | 475 |
| 471 DEFINE_TRACE(PaymentRequest) | 476 DEFINE_TRACE(PaymentRequest) |
| 472 { | 477 { |
| 473 visitor->trace(m_details); | 478 visitor->trace(m_details); |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 673 { | 678 { |
| 674 m_completeResolver.clear(); | 679 m_completeResolver.clear(); |
| 675 m_showResolver.clear(); | 680 m_showResolver.clear(); |
| 676 m_abortResolver.clear(); | 681 m_abortResolver.clear(); |
| 677 if (m_clientBinding.is_bound()) | 682 if (m_clientBinding.is_bound()) |
| 678 m_clientBinding.Close(); | 683 m_clientBinding.Close(); |
| 679 m_paymentProvider.reset(); | 684 m_paymentProvider.reset(); |
| 680 } | 685 } |
| 681 | 686 |
| 682 } // namespace blink | 687 } // namespace blink |
| OLD | NEW |