Index: third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.cpp |
diff --git a/third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.cpp b/third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.cpp |
index d04dd8b983de79b8b739c1e8e234ca1952eccfe4..17e2728a7dfc93bcde266fda97ff9f59a7836d60 100644 |
--- a/third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.cpp |
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.cpp |
@@ -93,6 +93,7 @@ PaymentRequestUpdateEvent* PaymentRequestUpdateEvent::create(const AtomicString& |
void PaymentRequestUpdateEvent::setPaymentDetailsUpdater(PaymentUpdater* updater) |
{ |
+ m_abortTimer.startOneShot(s_abortTimeout, BLINK_FROM_HERE); |
please use gerrit instead
2016/07/21 16:35:24
#include "public/platform/WebTraceLocation.h"
Thi
haraken
2016/07/21 16:37:27
What happens if you hit setPaymentDetailsUpdater b
please use gerrit instead
2016/07/21 16:46:42
Should not happen. setPaymentDetailsUpdater is inv
pals
2016/07/22 04:06:19
Done.
|
m_updater = updater; |
} |
@@ -113,11 +114,20 @@ void PaymentRequestUpdateEvent::updateWith(ScriptState* scriptState, ScriptPromi |
stopImmediatePropagation(); |
m_waitForUpdate = true; |
+ m_abortTimer.stop(); |
promise.then(UpdatePaymentDetailsFunction::createFunction(scriptState, m_updater), |
UpdatePaymentDetailsErrorFunction::createFunction(scriptState, m_updater)); |
} |
+void PaymentRequestUpdateEvent::onTimerFired(Timer<PaymentRequestUpdateEvent>*) |
+{ |
+ if (!m_updater) |
+ return; |
+ |
+ m_updater->onUpdatePaymentDetailsFailure(ScriptValue()); |
+} |
+ |
DEFINE_TRACE(PaymentRequestUpdateEvent) |
{ |
visitor->trace(m_updater); |
@@ -126,12 +136,14 @@ DEFINE_TRACE(PaymentRequestUpdateEvent) |
PaymentRequestUpdateEvent::PaymentRequestUpdateEvent() |
: m_waitForUpdate(false) |
+ , m_abortTimer(this, &PaymentRequestUpdateEvent::onTimerFired) |
{ |
} |
PaymentRequestUpdateEvent::PaymentRequestUpdateEvent(const AtomicString& type, const PaymentRequestUpdateEventInit& init) |
: Event(type, init) |
, m_waitForUpdate(false) |
+ , m_abortTimer(this, &PaymentRequestUpdateEvent::onTimerFired) |
{ |
} |