[tracing] Fix MemoryDumpManager to support startup tracing

This CL simplifies a lot the design of the MemoryDumpManager (MDM)
initialization (\o/). Before this change the MDM had a two-stage
initialization: 1. Initialize() that was registering to the
TraceLog enabled stateobserver; 2. SetDelegate() that was setting
the inversion-of-control delegate.
This design was fragile as it required to think about the two possible
sequences of events (1 -> 2 or 2 -> 1) and not really necessary.
The simplification herein introduced consists in:
 - Drop the IsCoordinatorProcess() method from the delegate. That
   information is not supposed to change over time and is known
   at MDM initialization time.
 - Merge the SetDelegate() into the Initialize() call. There is no
   point allowing to initialize the MDM without a delegate, so
   why bother? Moved all the initialization to the point where the
   delegate (concretelly the TracingControllerImpl) is ready.

As a side effect, startup tracing now works properly (tests are
coming in a separate CL).

BUG=524057
TEST=--trace-startup=-*,disabled-by-default-memory-infra --trace-startup-file=/tmp/startup.json

Review URL: https://codereview.chromium.org/1333873002

Cr-Commit-Position: refs/heads/master@{#348168}


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