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

Unified Diff: third_party/WebKit/Source/platform/TimerTest.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/TimerTest.cpp
diff --git a/third_party/WebKit/Source/platform/TimerTest.cpp b/third_party/WebKit/Source/platform/TimerTest.cpp
index 1c9f9f12490bc613b2ae01413c23883a39ed76a8..0c2266800a2d2feafa7b27608f34faecae70111a 100644
--- a/third_party/WebKit/Source/platform/TimerTest.cpp
+++ b/third_party/WebKit/Source/platform/TimerTest.cpp
@@ -302,12 +302,12 @@ public:
m_startTime = gCurrentTimeSecs;
}
- void countingTask(Timer<TimerTest>*)
+ void countingTask(TimerBase*)
{
m_runTimes.append(gCurrentTimeSecs);
}
- void recordNextFireTimeTask(Timer<TimerTest>* timer)
+ void recordNextFireTimeTask(TimerBase* timer)
{
m_nextFireTimes.append(gCurrentTimeSecs + timer->nextFireInterval());
}
@@ -765,14 +765,14 @@ TEST_F(TimerTest, RepeatingTimerDoesNotDrift)
}
template <typename TimerFiredClass>
-class TimerForTest : public Timer<TimerFiredClass> {
+class TimerForTest : public TaskRunnerTimer<TimerFiredClass> {
public:
- using TimerFiredFunction = void (TimerFiredClass::*)(Timer<TimerFiredClass>*);
+ using TimerFiredFunction = typename TaskRunnerTimer<TimerFiredClass>::TimerFiredFunction;
~TimerForTest() override { }
- TimerForTest(TimerFiredClass* timerFiredClass, TimerFiredFunction timerFiredFunction, WebTaskRunner* webTaskRunner)
- : Timer<TimerFiredClass>(timerFiredClass, timerFiredFunction, webTaskRunner)
+ TimerForTest(WebTaskRunner* webTaskRunner, TimerFiredClass* timerFiredClass, TimerFiredFunction timerFiredFunction)
+ : TaskRunnerTimer<TimerFiredClass>(webTaskRunner, timerFiredClass, timerFiredFunction)
{
}
};
@@ -781,7 +781,7 @@ TEST_F(TimerTest, UserSuppliedWebTaskRunner)
{
std::priority_queue<DelayedTask> timerTasks;
MockWebTaskRunner taskRunner(&timerTasks);
- TimerForTest<TimerTest> timer(this, &TimerTest::countingTask, &taskRunner);
+ TimerForTest<TimerTest> timer(&taskRunner, this, &TimerTest::countingTask);
timer.startOneShot(0, BLINK_FROM_HERE);
// Make sure the task was posted on taskRunner.

Powered by Google App Engine
This is Rietveld 408576698