[notification_helper.exe] Add UMA support and log its runtime

Since notification_helper is a standalone executable, adding UMA support for
it needs extra work. We need to create persistent histograms in memory and
write the memory to a file upon exit of the process. These files are
accumulated inside a new directory called NotificationHelperMetrics under User
Data directory, and will eventually be reported by the browser process.

This CL moves persistent_histogram_storage.{h,cc} from chrome/installer/setup
to base/metrics as the class is now also used by notification_helper.exe, in
addition to setup.exe. This CL updates this class for general-purpose usage,
and adds unit tests for it.

This CL also logs the runtime of the notification_helper process to UMA.

Bug: 734095
Change-Id: Ia95f002378718b0e033f8da1aa7c260ec04030c3
Reviewed-on: https://chromium-review.googlesource.com/959543
Commit-Queue: Xi Cheng <chengx@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Brian White <bcwhite@chromium.org>
Reviewed-by: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547052}

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