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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 "Cannot update details when the event is not being dispatched"); | 109 "Cannot update details when the event is not being dispatched"); |
110 return; | 110 return; |
111 } | 111 } |
112 | 112 |
113 if (m_waitForUpdate) { | 113 if (m_waitForUpdate) { |
114 exceptionState.throwDOMException(InvalidStateError, | 114 exceptionState.throwDOMException(InvalidStateError, |
115 "Cannot update details twice"); | 115 "Cannot update details twice"); |
116 return; | 116 return; |
117 } | 117 } |
118 | 118 |
| 119 stopPropagation(); |
119 stopImmediatePropagation(); | 120 stopImmediatePropagation(); |
120 m_waitForUpdate = true; | 121 m_waitForUpdate = true; |
121 m_abortTimer.stop(); | 122 m_abortTimer.stop(); |
122 | 123 |
123 promise.then( | 124 promise.then( |
124 UpdatePaymentDetailsFunction::createFunction(scriptState, m_updater), | 125 UpdatePaymentDetailsFunction::createFunction(scriptState, m_updater), |
125 UpdatePaymentDetailsErrorFunction::createFunction(scriptState, | 126 UpdatePaymentDetailsErrorFunction::createFunction(scriptState, |
126 m_updater)); | 127 m_updater)); |
127 } | 128 } |
128 | 129 |
(...skipping 15 matching lines...) Expand all Loading... |
144 } | 145 } |
145 | 146 |
146 PaymentRequestUpdateEvent::PaymentRequestUpdateEvent( | 147 PaymentRequestUpdateEvent::PaymentRequestUpdateEvent( |
147 const AtomicString& type, | 148 const AtomicString& type, |
148 const PaymentRequestUpdateEventInit& init) | 149 const PaymentRequestUpdateEventInit& init) |
149 : Event(type, init), | 150 : Event(type, init), |
150 m_waitForUpdate(false), | 151 m_waitForUpdate(false), |
151 m_abortTimer(this, &PaymentRequestUpdateEvent::onUpdateEventTimeout) {} | 152 m_abortTimer(this, &PaymentRequestUpdateEvent::onUpdateEventTimeout) {} |
152 | 153 |
153 } // namespace blink | 154 } // namespace blink |
OLD | NEW |