Pass/store Task by value in TaskScheduler.

MessageLoop and the Blink scheduler pass/store tasks by value. This
avoids having a heap allocation for every task.

With this CL, TaskScheduler also passes/stores tasks by value. This
is a prerequisite to make the TaskScheduler and the Blink scheduler
work together.

ScopedTaskEnvironment refactor and previous review at https://chromium-review.googlesource.com/c/chromium/src/+/764531

Bug: 783309, 795024
TBR: gab@chromium.org
Change-Id: I2ae01bed216f7d4e9c6a2615689df1817a2507d0
Reviewed-on: https://chromium-review.googlesource.com/826569
Commit-Queue: Robert Liao <robliao@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524635}

CrOS-Libchrome-Original-Commit: d07daf95fd73f5fd92f22777e466ed9fa14e538d
23 files changed
tree: cef987c0594c906963db618d35c18038bc72e8a0
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/