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

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

Issue 2028603004: Rename 'items' into 'displayItems' in PaymentDetails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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 49ab6bb0cfdf109ef4ecff3aff69c5b059a47e40..2aab6219a656d5a3042f6ca7782626b30400ae2a 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
@@ -79,7 +79,7 @@ struct TypeConverter<PaymentDetailsPtr, blink::PaymentDetails> {
static PaymentDetailsPtr Convert(const blink::PaymentDetails& input)
{
PaymentDetailsPtr output = PaymentDetails::New();
- output->items = mojo::WTFArray<PaymentItemPtr>::From(input.items());
+ output->display_items = mojo::WTFArray<PaymentItemPtr>::From(input.displayItems());
if (input.hasShippingOptions())
output->shipping_options = mojo::WTFArray<ShippingOptionPtr>::From(input.shippingOptions());
else
@@ -103,7 +103,7 @@ struct TypeConverter<PaymentOptionsPtr, blink::PaymentOptions> {
namespace blink {
namespace {
-// Validates ShippingOption and PaymentItem dictionaries, which happen to have identical fields.
+// Validates ShippingOption and PaymentItem dictionaries, which happen to have identical fields,
// except for "id", which is present only in ShippingOption.
template <typename T>
void validateShippingOptionsOrPaymentItems(HeapVector<T> items, ExceptionState& exceptionState)
@@ -154,17 +154,17 @@ void validateShippingOptionsIds(HeapVector<ShippingOption> options, ExceptionSta
void validatePaymentDetails(const PaymentDetails& details, ExceptionState& exceptionState)
{
- if (!details.hasItems()) {
- exceptionState.throwTypeError("Must specify items");
+ if (!details.hasDisplayItems()) {
+ exceptionState.throwTypeError("Must specify display items");
return;
}
- if (details.items().isEmpty()) {
+ if (details.displayItems().isEmpty()) {
exceptionState.throwTypeError("Must specify at least one item");
return;
}
- validateShippingOptionsOrPaymentItems(details.items(), exceptionState);
+ validateShippingOptionsOrPaymentItems(details.displayItems(), exceptionState);
if (exceptionState.hadException())
return;

Powered by Google App Engine
This is Rietveld 408576698