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

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentResponse.h

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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PaymentResponse_h 5 #ifndef PaymentResponse_h
6 #define PaymentResponse_h 6 #define PaymentResponse_h
7 7
8 #include "bindings/core/v8/ScriptPromise.h" 8 #include "bindings/core/v8/ScriptPromise.h"
9 #include "bindings/core/v8/ScriptValue.h" 9 #include "bindings/core/v8/ScriptValue.h"
10 #include "bindings/core/v8/ScriptWrappable.h" 10 #include "bindings/core/v8/ScriptWrappable.h"
(...skipping 12 matching lines...) Expand all
23 class ScriptState; 23 class ScriptState;
24 24
25 class MODULES_EXPORT PaymentResponse final : public GarbageCollectedFinalized<Pa ymentResponse>, public ScriptWrappable { 25 class MODULES_EXPORT PaymentResponse final : public GarbageCollectedFinalized<Pa ymentResponse>, public ScriptWrappable {
26 DEFINE_WRAPPERTYPEINFO(); 26 DEFINE_WRAPPERTYPEINFO();
27 WTF_MAKE_NONCOPYABLE(PaymentResponse); 27 WTF_MAKE_NONCOPYABLE(PaymentResponse);
28 28
29 public: 29 public:
30 PaymentResponse(mojom::blink::PaymentResponsePtr, PaymentCompleter*); 30 PaymentResponse(mojom::blink::PaymentResponsePtr, PaymentCompleter*);
31 virtual ~PaymentResponse(); 31 virtual ~PaymentResponse();
32 32
33 ScriptValue toJSONForBinding(ScriptState*) const;
34
33 const String& methodName() const { return m_methodName; } 35 const String& methodName() const { return m_methodName; }
34 ScriptValue details(ScriptState*, ExceptionState&) const; 36 ScriptValue details(ScriptState*, ExceptionState&) const;
35 PaymentAddress* shippingAddress() const { return m_shippingAddress.get(); } 37 PaymentAddress* shippingAddress() const { return m_shippingAddress.get(); }
36 const String& shippingOption() const { return m_shippingOption; } 38 const String& shippingOption() const { return m_shippingOption; }
37 const String& payerName() const { return m_payerName; } 39 const String& payerName() const { return m_payerName; }
38 const String& payerEmail() const { return m_payerEmail; } 40 const String& payerEmail() const { return m_payerEmail; }
39 const String& payerPhone() const { return m_payerPhone; } 41 const String& payerPhone() const { return m_payerPhone; }
40 42
41 ScriptPromise complete(ScriptState*, const String& result = ""); 43 ScriptPromise complete(ScriptState*, const String& result = "");
42 44
43 DECLARE_TRACE(); 45 DECLARE_TRACE();
44 46
45 private: 47 private:
46 String m_methodName; 48 String m_methodName;
47 String m_stringifiedDetails; 49 String m_stringifiedDetails;
48 Member<PaymentAddress> m_shippingAddress; 50 Member<PaymentAddress> m_shippingAddress;
49 String m_shippingOption; 51 String m_shippingOption;
50 String m_payerName; 52 String m_payerName;
51 String m_payerEmail; 53 String m_payerEmail;
52 String m_payerPhone; 54 String m_payerPhone;
53 Member<PaymentCompleter> m_paymentCompleter; 55 Member<PaymentCompleter> m_paymentCompleter;
54 }; 56 };
55 57
56 } // namespace blink 58 } // namespace blink
57 59
58 #endif // PaymentResponse_h 60 #endif // PaymentResponse_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698