Here's the current work in progress for timers:
- Require a TaskRunner argument to TimerBase.
- Rename the current Timer template to TaskRunnerTimer and require the TaskRunner argument.
- Add a new Timer template which defaults to the current behavior of using the thread task runner.
- Rename the current UnthrottledTimer to UnthrottledThreadTimer
In followups, I propose doing the following:
1. Rename the Timer template which takes no TaskRunner arguments to LegacyTimer or DeprecatedTimer or ThrottledThreadTimer.
2. Add frame-specific timers in FrameTimer.h that use the task scheduler of the corresponding frame. These will mirror the current helpers exposed by TaskRunnerHelpers:
- LoadingTimer
- TimerTimer / DefaultTimer / ThrottledTimer (I don't have good ideas for this one; maybe it'll be easier once we get rid of the Timer with no TaskRunner argument?)
- UnthrottledTimer
- Add documentation about which task runner queue is appropriate (I guess we should add this to WebFrameScheduler and reference it from TaskRunnerHelper / FrameTimer.h)
- Any others as we deem appropriate
3. Convert all uses of UnthrottledThreadTImer to UnthrottledTimer (this should be easy, there are relatively few uses)
4. Convert DOMTimer / SuspendableTimer to use frame timers: this should be easy, since they already have an execution context.
-5. Convert everything else.
Comment 1 by bugdroid1@chromium.org
, Jul 26 2016