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

Unified Diff: third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.cpp

Issue 2222883002: Properly name the timeout callback for update event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
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 d03e5d7852f6b6d5375882c23d064ce56cb2768d..71410841503daa6480c211178ea4eb5d0a75da9c 100644
--- a/third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.cpp
+++ b/third_party/WebKit/Source/modules/payments/PaymentRequestUpdateEvent.cpp
@@ -120,24 +120,29 @@ void PaymentRequestUpdateEvent::updateWith(ScriptState* scriptState, ScriptPromi
UpdatePaymentDetailsErrorFunction::createFunction(scriptState, m_updater));
}
-void PaymentRequestUpdateEvent::onTimerFired(TimerBase*)
+DEFINE_TRACE(PaymentRequestUpdateEvent)
{
- if (!m_updater)
- return;
+ visitor->trace(m_updater);
+ Event::trace(visitor);
+}
- m_updater->onUpdatePaymentDetailsFailure("Timed out as the page didn't resolve the promise from change event");
+void PaymentRequestUpdateEvent::onUpdateEventTimeoutForTesting()
+{
+ onUpdateEventTimeout(0);
}
-DEFINE_TRACE(PaymentRequestUpdateEvent)
+void PaymentRequestUpdateEvent::onUpdateEventTimeout(TimerBase*)
{
- visitor->trace(m_updater);
- Event::trace(visitor);
+ if (!m_updater)
+ return;
+
+ m_updater->onUpdatePaymentDetailsFailure("Timed out as the page didn't resolve the promise from change event");
}
PaymentRequestUpdateEvent::PaymentRequestUpdateEvent(const AtomicString& type, const PaymentRequestUpdateEventInit& init)
: Event(type, init)
, m_waitForUpdate(false)
- , m_abortTimer(this, &PaymentRequestUpdateEvent::onTimerFired)
+ , m_abortTimer(this, &PaymentRequestUpdateEvent::onUpdateEventTimeout)
{
}

Powered by Google App Engine
This is Rietveld 408576698