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 e517e71e3e26d6b59b090553dcefd9581db49931..0ac60d196717bfdda576691f62b0c4ee4734ef17 100644 |
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp |
@@ -186,6 +186,7 @@ void ValidateAndConvertDisplayItems(const HeapVector<PaymentItem>& input, |
void ValidateAndConvertShippingOptions( |
const HeapVector<PaymentShippingOption>& input, |
Vector<PaymentShippingOptionPtr>& output, |
+ ExecutionContext& execution_context, |
ExceptionState& exception_state) { |
HashSet<String> unique_ids; |
for (const PaymentShippingOption& option : input) { |
@@ -195,6 +196,10 @@ void ValidateAndConvertShippingOptions( |
} |
if (unique_ids.Contains(option.id())) { |
+ execution_context.AddConsoleMessage( |
+ ConsoleMessage::Create(kJSMessageSource, kWarningMessageLevel, |
+ "Duplicate shipping option identifiers are " |
Marijn Kruisselbrink
2017/04/19 19:03:48
nit: would it make sense to include which id cause
please use gerrit instead
2017/04/19 19:46:01
Good idea. Done.
|
+ "treated as an invalid address indicator.")); |
// Clear |output| instead of throwing an exception. |
output.clear(); |
return; |
@@ -492,8 +497,9 @@ void ValidateAndConvertPaymentDetailsBase(const PaymentDetailsBase& input, |
} |
if (input.hasShippingOptions() && request_shipping) { |
- ValidateAndConvertShippingOptions( |
- input.shippingOptions(), output->shipping_options, exception_state); |
+ ValidateAndConvertShippingOptions(input.shippingOptions(), |
+ output->shipping_options, |
+ execution_context, exception_state); |
if (exception_state.HadException()) |
return; |
} |