[base] Move TaskRunner::RunsTasksInCurrentSequence() to SequencedTaskRunner

The vast majority of this CL is about changing code that used
base::TaskRunner and invoked RunsTasksInCurrentSequence() on it.

For the most part this CL is a logical no-op and a semantical
improvement as almost all APIs who loosely took a TaskRunner in fact
required a SequencedTaskRunner (e.g. were accessing unsynchronized
state) but it "worked" because their callers already happened to provide
task runners that were Sequenced/SingleThreadTaskRunners.

Some impls even used single-threaded APIs such as MessageLoopCurrent or
declaring methods invoked from that TaskRunner as "must run on the UI
thread". Those were changed to use SingleThreadTaskRunner (again, all
callers already were providing one but the API was too loose).

In a few cases where a parallel TaskRunner was actually intended, some
DCHECK(task_runner->RunsTasksInCurrentSequence()) were simply removed as
they were mere impl details, already obvious by the context. There was a
single case where it made sense to assert "doesn't run on a core thread"
in wallpaper_resizer.cc; that was migrated to
base::AssertLongCPUWorkAllowed().

Implementations of base::TaskRunner were either promoted to
Sequenced/SingleThreadTaskRunner when that's what it was actually used
as or the RunsTasksInCurrentSequence() override was removed.

The few actual logic changes:
 - ash/.../wallpaper_resizer.cc : base::AssertLongCPUWorkAllowed()
 - base/android/.../task_runner_android.h : TODO to make the same change
       on the Java side, for now things seem happy when always returning
       false from parallel TaskRunnerImpl.

Removed dead code:
 - base::debug::ActivityTracker::SetBackgroundTaskRunner()
 - AfterStartupTaskUtils::Runner
 - net/url_request/test_url_request_interceptor.(h|cc)

Includes were mostly kept as-is (fwd-decls as fwd-decls and
includes-as-includes) except where it was outright wrong or necessary to
make callers happy (remember that foo.h is required in order to have
scoped_refptr<Foo> be fully defined -- and hence required by IWYU if you
have such a member and arguably if taking/returning one by value as part
of your core API).

Pointer semantics are also intentionally unchanged unless 100% incorrect
and easy to update in place (e.g. in some cases raw pointers are used to
return refcounted objects; that should probably be fixed, but not in this
CL).

Bug: 1026641
Change-Id: I1b33744d3a30a05fdb091d3f976270cd59917873
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1957211
Reviewed-by: Anton Bikineev <[email protected]>
Reviewed-by: Miguel Casas <[email protected]>
Reviewed-by: Steven Bennetts <[email protected]>
Reviewed-by: Brian White <[email protected]>
Reviewed-by: Brad Nelson <[email protected]>
Reviewed-by: Nico Weber <[email protected]>
Reviewed-by: Achuith Bhandarkar <[email protected]>
Reviewed-by: Yaron Friedman <[email protected]>
Reviewed-by: Maksim Orlovich <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: Istiaque Ahmed <[email protected]>
Reviewed-by: Ken Rockot <[email protected]>
Reviewed-by: Sorin Jianu <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: Scott Violet <[email protected]>
Reviewed-by: Matt Falkenhagen <[email protected]>
Reviewed-by: Victor Costan <[email protected]>
Reviewed-by: François Doray <[email protected]>
Reviewed-by: Bill Budge <[email protected]>
Reviewed-by: danakj <[email protected]>
Commit-Queue: Gabriel Charette <[email protected]>
Cr-Commit-Position: refs/heads/master@{#725203}
160 files changed