TaskScheduler: Delegate instead of callbacks for SchedulerWorkerThread.
Instead of requiring multiple callbacks in the SchedulerWorkerThread's
constructor, require a single delegate with these methods:
- OnMainEntry
- OnMainExit (no callback equivalent before this CL)
- GetWork
- RanTaskFromSequence
In a previous CL, we decided that it was better to use callbacks than
a delegate because OnMainEntry/GetWork were handled by
SchedulerThreadPool while RanTaskFromSequence was handled by
TaskScheduler. Now that we've added OnMainExit
(handled by SchedulerThreadPool), we believe that it's better to make
SchedulerThreadPool a delegate of SchedulerWorkerThread.
SchedulerThreadPool will invoke a callback bound to TaskScheduler when
its RanTaskFromSequence method is called.
BUG=553459
Review URL: https://codereview.chromium.org/1864333002
Cr-Commit-Position: refs/heads/master@{#385888}
CrOS-Libchrome-Original-Commit: 80c05e2c9df0f5085bd90748e2239cc41aef24c5
3 files changed