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

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

Issue 2191533003: Refactor Timer classes in preparation for landing FrameTimers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android build fix Created 4 years, 5 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 14ee907247ac45fc3ef7835e73de28cb590fddbc..dbe82a7f50fa10885934be80048dd1914d120a85 100644
--- a/third_party/WebKit/Source/platform/Timer.cpp
+++ b/third_party/WebKit/Source/platform/Timer.cpp
@@ -40,8 +40,6 @@
namespace blink {
-TimerBase::TimerBase() : TimerBase(Platform::current()->currentThread()->scheduler()->timerTaskRunner()) { }
-
TimerBase::TimerBase(WebTaskRunner* webTaskRunner)
: m_nextFireTime(0)
, m_repeatInterval(0)
@@ -88,6 +86,18 @@ double TimerBase::nextFireInterval() const
return m_nextFireTime - current;
}
+// static
+WebTaskRunner* TimerBase::getTimerTaskRunner()
+{
+ return Platform::current()->currentThread()->scheduler()->timerTaskRunner();
+}
+
+// static
+WebTaskRunner* TimerBase::getDefaultTaskRunner()
haraken 2016/07/28 14:44:46 getDefaultTaskRunner => getUnthrottledTaskRunner ?
Sami 2016/07/28 16:38:55 +1
dcheng 2016/07/29 02:23:18 Done.
+{
+ return Platform::current()->currentThread()->getWebTaskRunner();
+}
+
WebTaskRunner* TimerBase::timerTaskRunner() const
{
return m_webTaskRunner;
@@ -143,11 +153,6 @@ bool TimerBase::Comparator::operator()(const TimerBase* a, const TimerBase* b) c
}
// static
-WebTaskRunner* TimerBase::UnthrottledWebTaskRunner()
-{
- return Platform::current()->currentThread()->getWebTaskRunner();
-}
-
double TimerBase::timerMonotonicallyIncreasingTime() const
{
return timerTaskRunner()->monotonicallyIncreasingVirtualTimeSeconds();

Powered by Google App Engine
This is Rietveld 408576698