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..aed5ab76fea9353d80a7c0b328534c2f029e3721 |
| --- /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> { |
|
haraken
2016/10/19 03:07:47
What's your plan in the end? Are you planning to m
dcheng
2016/10/19 03:47:44
The idea for FrameTimer is to make it easy to see
haraken
2016/10/19 09:07:12
Yeah, I'd prefer not mixing postCancellableTask, F
|
| + public: |
| + using TimerFiredFunction = |
| + typename TaskRunnerTimer<TimerFiredClass>::TimerFiredFunction; |
| + |
| + FrameTimer(TaskType taskType, |
| + Document* document, |
|
dcheng
2016/10/19 00:08:39
I'll add additional overloads as needed?
haraken
2016/10/19 03:07:48
Sure.
ExecutionContext* might be better since wor
dcheng
2016/10/19 03:47:44
Done.
|
| + TimerFiredClass* timerFiredClass, |
| + TimerFiredFunction timerFiredFunction) |
| + : TaskRunnerTimer<TimerFiredClass>( |
| + TaskRunnerHelper::get(taskType, document), |
| + timerFiredClass, |
| + timerFiredFunction) {} |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // FrameTimer_h |