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

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

Issue 2349133002: PaymentRequest: Make the PaymentResponse interface serializable. (Closed)
Patch Set: PaymentRequest: Make the PaymentResponse interface serializable. Created 4 years, 3 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/PaymentAddress.cpp
diff --git a/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp b/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp
index fea61124fe053db5ece1068b381675bf26e49f04..ded6d4c01c834fd31e4527257997b09a8ea722c6 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp
@@ -4,6 +4,7 @@
#include "modules/payments/PaymentAddress.h"
+#include "bindings/core/v8/V8ObjectBuilder.h"
#include "wtf/text/StringBuilder.h"
namespace blink {
@@ -33,4 +34,21 @@ PaymentAddress::PaymentAddress(mojom::blink::PaymentAddressPtr address)
PaymentAddress::~PaymentAddress() {}
+ScriptValue PaymentAddress::toJSONForBinding(ScriptState* scriptState) const
+{
+ V8ObjectBuilder result(scriptState);
+ result.addString("country", country());
+ result.add("addressLine", addressLine());
+ result.addString("region", region());
+ result.addString("city", city());
+ result.addString("dependentLocality", dependentLocality());
+ result.addString("postalCode", postalCode());
+ result.addString("sortingCode", sortingCode());
+ result.addString("languageCode", languageCode());
+ result.addString("organization", organization());
+ result.addString("recipient", recipient());
+ result.addString("phone", phone());
+ return result.scriptValue();
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698