StatisticsRecorder doesn't need to be explicitly initialized.

StatisticsRecorder automatically and lazily initializes itself when necessary.
This simplifies its API and makes it less tricky to use. It removes pitfalls
where some methods were a no-op or would crash when StatisticsRecorder wasn't
initialized whereas the same methods had side effects when StatisticsRecorder
was initialized. Now, all methods always act as advertised.

This also means that histograms like Security.TreatInsecureOriginAsSecure that
used to be registered before StatisticsRecorder was initialized are not lost
anymore and are now correctly recorded.

Added comments.

Change-Id: Iac359538f0dba6169a6fc3f7f3b71b8e8d682944
Bug: 798603
Reviewed-on: https://chromium-review.googlesource.com/846586
Commit-Queue: François Degros <fdegros@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527553}

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