arc: Persist stability metrics into local state

In case of a crash, metrics from previous session is not available when
generating initial stability logs, which is probably why aggregated
crash counts on UMA don't have ARC state associated.

This patch introduces StabilityMetricsManager, which persists stability
metrics into local state and record value from local state to UMA when
needed.

Bug: 929583
Change-Id: I747493f2462454baa7fc187421932ea71d52c9a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1469810
Commit-Queue: Shao-Chuan Lee <shaochuan@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Yury Khmel <khmel@chromium.org>
Reviewed-by: Mark Pearson <mpearson@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637591}
19 files changed