Chromium Code Reviews| Index: third_party/WebKit/Source/core/frame/FrameTimer.h |
| diff --git a/third_party/WebKit/Source/core/frame/FrameTimer.h b/third_party/WebKit/Source/core/frame/FrameTimer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9d2f9e5ad167268e58407021daed03887cb9bcd9 |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/core/frame/FrameTimer.h |
| @@ -0,0 +1,31 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef FrameTimer_h |
| +#define FrameTimer_h |
| + |
| +#include "core/dom/TaskRunnerHelper.h" |
| +#include "platform/Timer.h" |
| + |
| +namespace blink { |
| + |
| +template <typename TimerFiredClass> |
| +class FrameTimer : public TaskRunnerTimer<TimerFiredClass> { |
| + public: |
| + using TimerFiredFunction = |
| + typename TaskRunnerTimer<TimerFiredClass>::TimerFiredFunction; |
| + |
| + FrameTimer(TaskType taskType, |
|
alex clarke (OOO till 29th)
2016/10/19 09:15:51
I suspect it will be somewhat common for the timer
|
| + ExecutionContext* context, |
| + TimerFiredClass* timerFiredClass, |
| + TimerFiredFunction timerFiredFunction) |
| + : TaskRunnerTimer<TimerFiredClass>( |
| + TaskRunnerHelper::get(taskType, context), |
| + timerFiredClass, |
| + timerFiredFunction) {} |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // FrameTimer_h |