| 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 #include "modules/payments/PaymentRequestUpdateEvent.h" | 5 #include "modules/payments/PaymentRequestUpdateEvent.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ExceptionState.h" | 7 #include "bindings/core/v8/ExceptionState.h" |
| 8 #include "bindings/core/v8/ScriptFunction.h" | 8 #include "bindings/core/v8/ScriptFunction.h" |
| 9 #include "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
| 10 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 | 118 |
| 119 stopImmediatePropagation(); | 119 stopImmediatePropagation(); |
| 120 m_waitForUpdate = true; | 120 m_waitForUpdate = true; |
| 121 m_abortTimer.stop(); | 121 m_abortTimer.stop(); |
| 122 | 122 |
| 123 promise.then(UpdatePaymentDetailsFunction::createFunction(scriptState, m_upd
ater), | 123 promise.then(UpdatePaymentDetailsFunction::createFunction(scriptState, m_upd
ater), |
| 124 UpdatePaymentDetailsErrorFunction::createFunction(scriptState, m_updater
)); | 124 UpdatePaymentDetailsErrorFunction::createFunction(scriptState, m_updater
)); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void PaymentRequestUpdateEvent::onTimerFired(Timer<PaymentRequestUpdateEvent>*) | 127 void PaymentRequestUpdateEvent::onTimerFired(TimerBase*) |
| 128 { | 128 { |
| 129 if (!m_updater) | 129 if (!m_updater) |
| 130 return; | 130 return; |
| 131 | 131 |
| 132 m_updater->onUpdatePaymentDetailsFailure(ScriptValue()); | 132 m_updater->onUpdatePaymentDetailsFailure(ScriptValue()); |
| 133 } | 133 } |
| 134 | 134 |
| 135 DEFINE_TRACE(PaymentRequestUpdateEvent) | 135 DEFINE_TRACE(PaymentRequestUpdateEvent) |
| 136 { | 136 { |
| 137 visitor->trace(m_updater); | 137 visitor->trace(m_updater); |
| 138 Event::trace(visitor); | 138 Event::trace(visitor); |
| 139 } | 139 } |
| 140 | 140 |
| 141 PaymentRequestUpdateEvent::PaymentRequestUpdateEvent() | 141 PaymentRequestUpdateEvent::PaymentRequestUpdateEvent() |
| 142 : m_waitForUpdate(false) | 142 : m_waitForUpdate(false) |
| 143 , m_abortTimer(this, &PaymentRequestUpdateEvent::onTimerFired) | 143 , m_abortTimer(this, &PaymentRequestUpdateEvent::onTimerFired) |
| 144 { | 144 { |
| 145 } | 145 } |
| 146 | 146 |
| 147 PaymentRequestUpdateEvent::PaymentRequestUpdateEvent(const AtomicString& type, c
onst PaymentRequestUpdateEventInit& init) | 147 PaymentRequestUpdateEvent::PaymentRequestUpdateEvent(const AtomicString& type, c
onst PaymentRequestUpdateEventInit& init) |
| 148 : Event(type, init) | 148 : Event(type, init) |
| 149 , m_waitForUpdate(false) | 149 , m_waitForUpdate(false) |
| 150 , m_abortTimer(this, &PaymentRequestUpdateEvent::onTimerFired) | 150 , m_abortTimer(this, &PaymentRequestUpdateEvent::onTimerFired) |
| 151 { | 151 { |
| 152 } | 152 } |
| 153 | 153 |
| 154 } // namespace blink | 154 } // namespace blink |
| OLD | NEW |