Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp

Issue 2193183002: Print proper debug message in case of change event timeout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed review comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 String& error)
460 { 460 {
461 String message;
462 error.toString(message);
463
464 if (m_showResolver) 461 if (m_showResolver)
465 m_showResolver->reject(DOMException::create(AbortError, message)); 462 m_showResolver->reject(DOMException::create(AbortError, error));
466 if (m_completeResolver) 463 if (m_completeResolver)
467 m_completeResolver->reject(DOMException::create(AbortError, message)); 464 m_completeResolver->reject(DOMException::create(AbortError, error));
468 clearResolversAndCloseMojoConnection(); 465 clearResolversAndCloseMojoConnection();
469 } 466 }
470 467
471 DEFINE_TRACE(PaymentRequest) 468 DEFINE_TRACE(PaymentRequest)
472 { 469 {
473 visitor->trace(m_details); 470 visitor->trace(m_details);
474 visitor->trace(m_options); 471 visitor->trace(m_options);
475 visitor->trace(m_shippingAddress); 472 visitor->trace(m_shippingAddress);
476 visitor->trace(m_showResolver); 473 visitor->trace(m_showResolver);
477 visitor->trace(m_completeResolver); 474 visitor->trace(m_completeResolver);
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 { 670 {
674 m_completeResolver.clear(); 671 m_completeResolver.clear();
675 m_showResolver.clear(); 672 m_showResolver.clear();
676 m_abortResolver.clear(); 673 m_abortResolver.clear();
677 if (m_clientBinding.is_bound()) 674 if (m_clientBinding.is_bound())
678 m_clientBinding.Close(); 675 m_clientBinding.Close();
679 m_paymentProvider.reset(); 676 m_paymentProvider.reset();
680 } 677 }
681 678
682 } // namespace blink 679 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698