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 PaymentRequestEvent_h | 5 #ifndef PaymentRequestEvent_h |
6 #define PaymentRequestEvent_h | 6 #define PaymentRequestEvent_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptValue.h" | |
8 #include "modules/EventModules.h" | 9 #include "modules/EventModules.h" |
9 #include "modules/payments/PaymentRequestEventInit.h" | 10 #include "modules/payments/PaymentRequestEventInit.h" |
10 #include "modules/serviceworkers/ExtendableEvent.h" | 11 #include "modules/serviceworkers/ExtendableEvent.h" |
11 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
12 | 13 |
13 namespace WTF { | 14 namespace WTF { |
14 class AtomicString; | 15 class AtomicString; |
15 } | 16 } |
16 | 17 |
17 namespace blink { | 18 namespace blink { |
18 | 19 |
19 class RespondWithObserver; | 20 class RespondWithObserver; |
21 class ScriptState; | |
20 | 22 |
21 class MODULES_EXPORT PaymentRequestEvent final : public ExtendableEvent { | 23 class MODULES_EXPORT PaymentRequestEvent final : public ExtendableEvent { |
22 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
23 WTF_MAKE_NONCOPYABLE(PaymentRequestEvent); | 25 WTF_MAKE_NONCOPYABLE(PaymentRequestEvent); |
24 | 26 |
25 public: | 27 public: |
26 static PaymentRequestEvent* Create(const AtomicString& type, | 28 static PaymentRequestEvent* Create(ScriptState*, |
29 const AtomicString& type, | |
27 const PaymentRequestEventInit&); | 30 const PaymentRequestEventInit&); |
28 static PaymentRequestEvent* Create(const AtomicString& type, | 31 static PaymentRequestEvent* Create(ScriptState*, |
32 const AtomicString& type, | |
29 const PaymentRequestEventInit&, | 33 const PaymentRequestEventInit&, |
30 RespondWithObserver*, | 34 RespondWithObserver*, |
31 WaitUntilObserver*); | 35 WaitUntilObserver*); |
32 ~PaymentRequestEvent() override; | 36 ~PaymentRequestEvent() override; |
33 | 37 |
34 const AtomicString& InterfaceName() const override; | 38 const AtomicString& InterfaceName() const override; |
35 | 39 |
36 const String& topLevelOrigin() const; | 40 const String& topLevelOrigin() const; |
37 const String& paymentRequestOrigin() const; | 41 const String& paymentRequestOrigin() const; |
38 const String& paymentRequestId() const; | 42 const String& paymentRequestId() const; |
39 const HeapVector<PaymentMethodData>& methodData() const; | 43 const HeapVector<PaymentMethodData>& methodData() const; |
40 void total(PaymentItem& value) const; | 44 const ScriptValue& total() const; |
please use gerrit instead
2017/06/12 14:02:34
Does keeping the old signature of total() in here
zino
2017/06/12 15:57:18
The signature is changed by WebIDL compiler becaus
| |
41 const HeapVector<PaymentDetailsModifier>& modifiers() const; | 45 const HeapVector<PaymentDetailsModifier>& modifiers() const; |
42 const String& instrumentKey() const; | 46 const String& instrumentKey() const; |
43 | 47 |
44 ScriptPromise openWindow(ScriptState*, const String& url); | 48 ScriptPromise openWindow(ScriptState*, const String& url); |
45 void respondWith(ScriptState*, ScriptPromise, ExceptionState&); | 49 void respondWith(ScriptState*, ScriptPromise, ExceptionState&); |
46 | 50 |
47 DECLARE_VIRTUAL_TRACE(); | 51 DECLARE_VIRTUAL_TRACE(); |
48 | 52 |
49 private: | 53 private: |
50 PaymentRequestEvent(const AtomicString& type, | 54 PaymentRequestEvent(ScriptState*, |
55 const AtomicString& type, | |
51 const PaymentRequestEventInit&, | 56 const PaymentRequestEventInit&, |
52 RespondWithObserver*, | 57 RespondWithObserver*, |
53 WaitUntilObserver*); | 58 WaitUntilObserver*); |
54 | 59 |
55 String top_level_origin_; | 60 String top_level_origin_; |
56 String payment_request_origin_; | 61 String payment_request_origin_; |
57 String payment_request_id_; | 62 String payment_request_id_; |
58 HeapVector<PaymentMethodData> method_data_; | 63 HeapVector<PaymentMethodData> method_data_; |
59 PaymentItem total_; | 64 ScriptValue total_; |
please use gerrit instead
2017/06/12 14:02:34
Can we try to keep PaymentItem on stack? I don't t
zino
2017/06/12 15:57:18
Done.
| |
60 HeapVector<PaymentDetailsModifier> modifiers_; | 65 HeapVector<PaymentDetailsModifier> modifiers_; |
61 String instrument_key_; | 66 String instrument_key_; |
62 | 67 |
63 Member<RespondWithObserver> observer_; | 68 Member<RespondWithObserver> observer_; |
64 }; | 69 }; |
65 | 70 |
66 } // namespace blink | 71 } // namespace blink |
67 | 72 |
68 #endif // PaymentRequestEvent_h | 73 #endif // PaymentRequestEvent_h |
OLD | NEW |