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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentRequest.cpp

Issue 2451873003: Allow duplicate payment method identifiers. (Closed)
Patch Set: Make modifier total optional 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/payments/payment-request-interface.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 495f73e805dc13310cd77b78dbb345844168c341..50029d323bdf717e491337a84dd95309cfa5aaa5 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
@@ -96,8 +96,6 @@ struct TypeConverter<PaymentDetailsModifierPtr, blink::PaymentDetailsModifier> {
if (input.hasTotal())
output->total = PaymentItem::From(input.total());
- else
- output->total = PaymentItem::New();
if (input.hasAdditionalDisplayItems()) {
for (size_t i = 0; i < input.additionalDisplayItems().size(); ++i) {
@@ -273,7 +271,6 @@ void validatePaymentDetailsModifiers(
return;
}
- HashSet<String> uniqueMethods;
for (const auto& modifier : modifiers) {
if (modifier.supportedMethods().isEmpty()) {
exceptionState.throwTypeError(
@@ -281,15 +278,6 @@ void validatePaymentDetailsModifiers(
return;
}
- for (const auto& method : modifier.supportedMethods()) {
- if (uniqueMethods.contains(method)) {
- exceptionState.throwTypeError(
- "Duplicate payment method identifiers are not allowed");
- return;
- }
- uniqueMethods.add(method);
- }
-
if (modifier.hasTotal()) {
validateShippingOptionOrPaymentItem(modifier.total(), exceptionState);
if (exceptionState.hadException())
@@ -368,7 +356,6 @@ void validateAndConvertPaymentMethodData(
return;
}
- HashSet<String> uniqueMethods;
for (const auto& pmd : paymentMethodData) {
if (pmd.supportedMethods().isEmpty()) {
exceptionState.throwTypeError(
@@ -376,15 +363,6 @@ void validateAndConvertPaymentMethodData(
return;
}
- for (const auto& method : pmd.supportedMethods()) {
- if (uniqueMethods.contains(method)) {
- exceptionState.throwTypeError(
- "Duplicate payment method identifiers are not allowed");
- return;
- }
- uniqueMethods.add(method);
- }
-
String stringifiedData = "";
if (pmd.hasData() && !pmd.data().isEmpty()) {
std::unique_ptr<JSONValue> value =
« no previous file with comments | « third_party/WebKit/LayoutTests/payments/payment-request-interface.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698