Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.cpp

Issue 2495713002: [Web Payments] Should set stop propagation flag. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698