Sync: store FakeServer as WeakPtr
This CL changes the FakeServerNetworkResources stack to store FakeServer
as a WeakPtr. This is done because FakeServerHttpPostProvider posts a
task to another thread and FakeServer may be deleted before the task
executes.
This CL adds a ThreadChecker to FakeServer to ensure that all actions
(especially AsWeakPtr() and destruction) happen on the same thread. As
a result of this thread restriction, FakeServerHelper has been changed
to call all FakeServer methods on the UI thread.
FakeServerHttpPostProvider's task-posting has also been reconfigured to
be cleaner. This class now calls PostTask (instead of unnecessarily
calling PostNonNestableTask previously) and has removed the possibility
of FakeServer::HandleCommand (UI thread) calling a method on
FakeServerHttpPostProvider (Sync thread).
BUG=481192
Review URL: https://codereview.chromium.org/
1149723007
Cr-Commit-Position: refs/heads/master@{#336422}