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
tree: df4bc95936813fb3d913e25a1e3a801cd369aade
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/