Move thread-related functionalities in Platform to Thread.

This CL moves the most of implementation for Thread in Platform to
Thread, so the Platform would contain less implementation (ideally,
Platform should be a pure interface to embedders).

Previously the global state of threads was stored in Platform, and
this CL moves it to Thread. Now the thread-local storage for Blink
threads and the main and compositor thread objects are stored as
the global variable in thread.cc. This way, the threads state is
completely separated from Platform. Old threading functions in
Platform are deprecated now, and they will be migrated to Thread ones
later.

Due to those changes, some test utilities need to be updated. As the
state of threads is not stored in Platform, the tests that need to
override their main thread have to do that by themselves. To
facilitate this, two new utility classes, ScopedMainThreadOverrider
and ScopedSchedulerOverrider, are introduced, and TestingPlatform-
SupportWithCustomScheduler is removed in favor of the new utilities.

Bug: 826203
Change-Id: Ieb702dc85b7ffd75991055038f1165c2bfd7d058
Reviewed-on: https://chromium-review.googlesource.com/c/1273115
Commit-Queue: Yuta Kitamura <yutak@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599133}
17 files changed