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 PaymentRequestUpdateEvent_h | 5 #ifndef PaymentRequestUpdateEvent_h |
6 #define PaymentRequestUpdateEvent_h | 6 #define PaymentRequestUpdateEvent_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "bindings/core/v8/ScriptWrappable.h" | 9 #include "bindings/core/v8/ScriptWrappable.h" |
10 #include "core/events/Event.h" | 10 #include "core/events/Event.h" |
11 #include "modules/ModulesExport.h" | 11 #include "modules/ModulesExport.h" |
12 #include "modules/payments/PaymentRequestUpdateEventInit.h" | 12 #include "modules/payments/PaymentRequestUpdateEventInit.h" |
13 #include "platform/Timer.h" | 13 #include "platform/Timer.h" |
14 #include "platform/heap/Handle.h" | 14 #include "platform/heap/Handle.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 class ExceptionState; | 18 class ExceptionState; |
| 19 class ExecutionContext; |
19 class PaymentUpdater; | 20 class PaymentUpdater; |
20 class ScriptState; | 21 class ScriptState; |
21 | 22 |
22 class MODULES_EXPORT PaymentRequestUpdateEvent final : public Event { | 23 class MODULES_EXPORT PaymentRequestUpdateEvent final : public Event { |
23 DEFINE_WRAPPERTYPEINFO(); | 24 DEFINE_WRAPPERTYPEINFO(); |
24 | 25 |
25 public: | 26 public: |
26 ~PaymentRequestUpdateEvent() override; | 27 ~PaymentRequestUpdateEvent() override; |
27 | 28 |
28 static PaymentRequestUpdateEvent* create( | 29 static PaymentRequestUpdateEvent* create( |
| 30 ExecutionContext*, |
29 const AtomicString& type, | 31 const AtomicString& type, |
30 const PaymentRequestUpdateEventInit& = PaymentRequestUpdateEventInit()); | 32 const PaymentRequestUpdateEventInit& = PaymentRequestUpdateEventInit()); |
31 | 33 |
32 void setPaymentDetailsUpdater(PaymentUpdater*); | 34 void setPaymentDetailsUpdater(PaymentUpdater*); |
33 | 35 |
34 void updateWith(ScriptState*, ScriptPromise, ExceptionState&); | 36 void updateWith(ScriptState*, ScriptPromise, ExceptionState&); |
35 | 37 |
36 DECLARE_VIRTUAL_TRACE(); | 38 DECLARE_VIRTUAL_TRACE(); |
37 | 39 |
38 void onUpdateEventTimeoutForTesting(); | 40 void onUpdateEventTimeoutForTesting(); |
39 | 41 |
40 private: | 42 private: |
41 PaymentRequestUpdateEvent(const AtomicString& type, | 43 PaymentRequestUpdateEvent(ExecutionContext*, |
| 44 const AtomicString& type, |
42 const PaymentRequestUpdateEventInit&); | 45 const PaymentRequestUpdateEventInit&); |
43 | 46 |
44 void onUpdateEventTimeout(TimerBase*); | 47 void onUpdateEventTimeout(TimerBase*); |
45 | 48 |
46 Member<PaymentUpdater> m_updater; | 49 Member<PaymentUpdater> m_updater; |
47 bool m_waitForUpdate; | 50 bool m_waitForUpdate; |
48 Timer<PaymentRequestUpdateEvent> m_abortTimer; | 51 TaskRunnerTimer<PaymentRequestUpdateEvent> m_abortTimer; |
49 }; | 52 }; |
50 | 53 |
51 } // namespace blink | 54 } // namespace blink |
52 | 55 |
53 #endif // PaymentRequestUpdateEvent_h | 56 #endif // PaymentRequestUpdateEvent_h |
OLD | NEW |