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

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

Issue 2410143003: Add currencySystem field to PaymentCurrencyAmount (Closed)
Patch Set: Fix tests in Win builds Created 4 years, 2 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 exceptionState.throwTypeError("Currency code required"); 194 exceptionState.throwTypeError("Currency code required");
195 return; 195 return;
196 } 196 }
197 197
198 if (!item.amount().hasValue()) { 198 if (!item.amount().hasValue()) {
199 exceptionState.throwTypeError("Currency value required"); 199 exceptionState.throwTypeError("Currency value required");
200 return; 200 return;
201 } 201 }
202 202
203 String errorMessage; 203 String errorMessage;
204 if (!PaymentsValidators::isValidCurrencyCodeFormat(item.amount().currency(), 204 if (!PaymentsValidators::isValidCurrencyCodeFormat(
205 &errorMessage)) { 205 item.amount().currency(), item.amount().currencySystem(),
206 &errorMessage)) {
206 exceptionState.throwTypeError(errorMessage); 207 exceptionState.throwTypeError(errorMessage);
207 return; 208 return;
208 } 209 }
209 210
210 if (!PaymentsValidators::isValidAmountFormat(item.amount().value(), 211 if (!PaymentsValidators::isValidAmountFormat(item.amount().value(),
211 &errorMessage)) { 212 &errorMessage)) {
212 exceptionState.throwTypeError(errorMessage); 213 exceptionState.throwTypeError(errorMessage);
213 return; 214 return;
214 } 215 }
215 } 216 }
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 m_completeTimer.stop(); 787 m_completeTimer.stop();
787 m_completeResolver.clear(); 788 m_completeResolver.clear();
788 m_showResolver.clear(); 789 m_showResolver.clear();
789 m_abortResolver.clear(); 790 m_abortResolver.clear();
790 if (m_clientBinding.is_bound()) 791 if (m_clientBinding.is_bound())
791 m_clientBinding.Close(); 792 m_clientBinding.Close();
792 m_paymentProvider.reset(); 793 m_paymentProvider.reset();
793 } 794 }
794 795
795 } // namespace blink 796 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698