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

Unified Diff: third_party/WebKit/Source/platform/Timer.cpp

Issue 2876513002: Use WTF::TimeDelta to specify delays on WebTaskRunner (Closed)
Patch Set: Created 3 years, 7 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/platform/Timer.cpp
diff --git a/third_party/WebKit/Source/platform/Timer.cpp b/third_party/WebKit/Source/platform/Timer.cpp
index 5f543f0ff20b03ce8cc185ce618eac90807408cd..b79bbd16dd92887f70702b8ab939331a13402acf 100644
--- a/third_party/WebKit/Source/platform/Timer.cpp
+++ b/third_party/WebKit/Source/platform/Timer.cpp
@@ -137,11 +137,10 @@ void TimerBase::SetNextFireTime(double now, double delay) {
// Cancel any previously posted task.
weak_ptr_factory_.RevokeAll();
- double delay_ms = 1000.0 * delay;
- TimerTaskRunner()->PostDelayedTask(
+ TimerTaskRunner()->ToSingleThreadTaskRunner()->PostDelayedTask(
location_,
base::Bind(&TimerBase::RunInternal, weak_ptr_factory_.CreateWeakPtr()),
- delay_ms);
+ WTF::TimeDelta::FromSecondsD(delay));
}
}

Powered by Google App Engine
This is Rietveld 408576698