[TaskScheduler] Introduce HeartbeatLatencyMicroseconds metric.

Put the timer on the service thread to avoid depending on the main
thread (want to record the metric even if -- especially if -- the main
thread is too busy for its timers to fire).

Move the impl to service_thread.cc to be able to use post_task.h and
test the full stack (also allows documenting "service thread" in its
new header which was never a well documented concept of task scheduler's
internals).

Kept reporting logic in task_tracker.cc to centralize traits-based
metrics reporting logic.

R=fdoray@chromium.org, jwd@chromium.org

Bug: 810746
Change-Id: Ie866d521c734bc63941836319d6c1258253cb8c5
Reviewed-on: https://chromium-review.googlesource.com/1059459
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Jesse Doherty <jwd@chromium.org>
Reviewed-by: Timothy Dresser <tdresser@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560052}
10 files changed