Chromium Code Reviews| Index: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
| diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
| index 386f630876a9c71a1349abdb661c91fee410b93f..106a1ef683bf74c246ec1c420579a8aa666e5ea1 100644 |
| --- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
| +++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
| @@ -206,11 +206,17 @@ void validateDisplayItems(const HeapVector<PaymentItem>& items, ExceptionState& |
| void validateShippingOptions(const HeapVector<PaymentShippingOption>& options, ExceptionState& exceptionState) |
| { |
| + HashSet<String> uniqueIds; |
| for (const auto& option : options) { |
| if (!option.hasId() || option.id().isEmpty()) { |
| exceptionState.throwTypeError("ShippingOption id required"); |
| return; |
| } |
|
please use gerrit instead
2016/07/12 10:01:16
nit: newline between the blocks.
|
| + if (uniqueIds.contains(option.id())) { |
| + exceptionState.throwTypeError("Duplicate shipping option identifiers are not allowed"); |
| + return; |
| + } |
| + uniqueIds.add(option.id()); |
| validateShippingOptionOrPaymentItem(option, exceptionState); |
| if (exceptionState.hadException()) |