[TaskScheduler] Make TaskTracker be tracked by a TrackedRefFactory.

Managing TaskTracker through TrackedRefs instead of raw pointers is the
final bandaid for issues like crbug.com/827615.

It will now be impossible for SchedulerWorkers to outlive their
TaskTracker. A test may hang if its shutdown logic is flawed (out of
order) but the blamed test will always be the one with the poor logic
(instead of a random test in whose context an errand SchedulerWorker makes
a use-after-free).

In fact, a few tests had to be fixed to land this change (while they
weren't necessarily flawed per se per being properly joined, the logic
is easier to grasp with TrackedRefs).

R=fdoray@chromium.org

Bug: 827615
Change-Id: I5bff8c55b4edb9fef8c5232bddf36da2afd33078
Reviewed-on: https://chromium-review.googlesource.com/1013597
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552160}

CrOS-Libchrome-Original-Commit: 881ffae1819eff75cf0329aac9882ba1fe6d3194
18 files changed
tree: 398a4d46af1281d6e30a2343da0d71290ea8ebc9
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/