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

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

Issue 2491513002: [Payment] Clean up PaymentResponse::toJSONForBinding (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | « no previous file | 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/PaymentResponse.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentResponse.cpp b/third_party/WebKit/Source/modules/payments/PaymentResponse.cpp
index 988cef45b3146fc1a9fcf1d32f1b327dd2d918e9..0ded3ad07026b221dad0b36409708992ba2d321e 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentResponse.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentResponse.cpp
@@ -41,25 +41,10 @@ ScriptValue PaymentResponse::toJSONForBinding(ScriptState* scriptState) const {
else
result.addNull("shippingAddress");
- if (shippingOption().isNull())
- result.addNull("shippingOption");
- else
- result.addString("shippingOption", shippingOption());
-
- if (payerName().isNull())
- result.addNull("payerName");
- else
- result.addString("payerName", payerName());
-
- if (payerEmail().isNull())
- result.addNull("payerEmail");
- else
- result.addString("payerEmail", payerEmail());
-
- if (payerPhone().isNull())
- result.addNull("payerPhone");
- else
- result.addString("payerPhone", payerPhone());
+ result.addStringOrNull("shippingOption", shippingOption())
+ .addStringOrNull("payerName", payerName())
+ .addStringOrNull("payerEmail", payerEmail())
+ .addStringOrNull("payerPhone", payerPhone());
return result.scriptValue();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698