| 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; | |
| 20 class PaymentUpdater; | 19 class PaymentUpdater; |
| 21 class ScriptState; | 20 class ScriptState; |
| 22 | 21 |
| 23 class MODULES_EXPORT PaymentRequestUpdateEvent final : public Event { | 22 class MODULES_EXPORT PaymentRequestUpdateEvent final : public Event { |
| 24 DEFINE_WRAPPERTYPEINFO(); | 23 DEFINE_WRAPPERTYPEINFO(); |
| 25 | 24 |
| 26 public: | 25 public: |
| 27 ~PaymentRequestUpdateEvent() override; | 26 ~PaymentRequestUpdateEvent() override; |
| 28 | 27 |
| 29 static PaymentRequestUpdateEvent* create( | 28 static PaymentRequestUpdateEvent* create( |
| 30 ExecutionContext*, | 29 ScriptState*, |
| 31 const AtomicString& type, | 30 const AtomicString& type, |
| 32 const PaymentRequestUpdateEventInit& = PaymentRequestUpdateEventInit()); | 31 const PaymentRequestUpdateEventInit& = PaymentRequestUpdateEventInit()); |
| 33 | 32 |
| 34 void setPaymentDetailsUpdater(PaymentUpdater*); | 33 void setPaymentDetailsUpdater(PaymentUpdater*); |
| 35 | 34 |
| 36 void updateWith(ScriptState*, ScriptPromise, ExceptionState&); | 35 void updateWith(ScriptState*, ScriptPromise, ExceptionState&); |
| 37 | 36 |
| 38 DECLARE_VIRTUAL_TRACE(); | 37 DECLARE_VIRTUAL_TRACE(); |
| 39 | 38 |
| 40 void onUpdateEventTimeoutForTesting(); | 39 void onUpdateEventTimeoutForTesting(); |
| 41 | 40 |
| 42 private: | 41 private: |
| 43 PaymentRequestUpdateEvent(ExecutionContext*, | 42 PaymentRequestUpdateEvent(ScriptState*, |
| 44 const AtomicString& type, | 43 const AtomicString& type, |
| 45 const PaymentRequestUpdateEventInit&); | 44 const PaymentRequestUpdateEventInit&); |
| 46 | 45 |
| 47 void onUpdateEventTimeout(TimerBase*); | 46 void onUpdateEventTimeout(TimerBase*); |
| 48 | 47 |
| 49 Member<PaymentUpdater> m_updater; | 48 Member<PaymentUpdater> m_updater; |
| 50 bool m_waitForUpdate; | 49 bool m_waitForUpdate; |
| 51 TaskRunnerTimer<PaymentRequestUpdateEvent> m_abortTimer; | 50 TaskRunnerTimer<PaymentRequestUpdateEvent> m_abortTimer; |
| 52 }; | 51 }; |
| 53 | 52 |
| 54 } // namespace blink | 53 } // namespace blink |
| 55 | 54 |
| 56 #endif // PaymentRequestUpdateEvent_h | 55 #endif // PaymentRequestUpdateEvent_h |
| OLD | NEW |