Chromium Code Reviews| 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..c469066f9062fb53bc524613c52483b0fa1d771a 100644 |
| --- a/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp |
| +++ b/third_party/WebKit/Source/modules/payments/PaymentAddress.cpp |
| @@ -4,6 +4,8 @@ |
| #include "modules/payments/PaymentAddress.h" |
| +#include "bindings/core/v8/ExceptionStatePlaceholder.h" |
|
please use gerrit instead
2016/09/20 08:15:46
Why is this included?
zino
2016/09/20 16:55:43
Done.
|
| +#include "bindings/core/v8/V8ObjectBuilder.h" |
| #include "wtf/text/StringBuilder.h" |
| namespace blink { |
| @@ -33,4 +35,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 |