OLD | NEW |
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" |
| 11 #include "modules/ModulesExport.h" |
11 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
| 13 #include "public/platform/modules/payments/payment_request.mojom-wtf.h" |
12 #include "wtf/Noncopyable.h" | 14 #include "wtf/Noncopyable.h" |
13 #include "wtf/text/WTFString.h" | 15 #include "wtf/text/WTFString.h" |
14 | 16 |
15 namespace blink { | 17 namespace blink { |
16 | 18 |
17 class ExceptionState; | 19 class ExceptionState; |
| 20 class PaymentCompleter; |
18 class ScriptState; | 21 class ScriptState; |
19 | 22 |
20 class PaymentResponse final : public GarbageCollectedFinalized<PaymentResponse>,
public ScriptWrappable { | 23 class MODULES_EXPORT PaymentResponse final : public GarbageCollectedFinalized<Pa
ymentResponse>, public ScriptWrappable { |
21 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
22 WTF_MAKE_NONCOPYABLE(PaymentResponse); | 25 WTF_MAKE_NONCOPYABLE(PaymentResponse); |
23 | 26 |
24 public: | 27 public: |
25 PaymentResponse(); | 28 PaymentResponse(mojom::wtf::PaymentResponsePtr, PaymentCompleter*); |
26 virtual ~PaymentResponse(); | 29 virtual ~PaymentResponse(); |
27 | 30 |
28 const String& methodName() const { return m_methodName; } | 31 const String& methodName() const { return m_methodName; } |
29 ScriptValue details(ScriptState*, ExceptionState&) const; | 32 ScriptValue details(ScriptState*, ExceptionState&) const; |
30 | 33 |
31 ScriptPromise complete(ScriptState*, bool success); | 34 ScriptPromise complete(ScriptState*, bool success); |
32 | 35 |
33 DEFINE_INLINE_TRACE() {} | 36 DECLARE_TRACE(); |
34 | 37 |
35 private: | 38 private: |
36 String m_methodName; | 39 String m_methodName; |
37 String m_stringifiedDetails; | 40 String m_stringifiedDetails; |
| 41 Member<PaymentCompleter> m_paymentCompleter; |
38 }; | 42 }; |
39 | 43 |
40 } // namespace blink | 44 } // namespace blink |
41 | 45 |
42 #endif // PaymentResponse_h | 46 #endif // PaymentResponse_h |
OLD | NEW |