Extract logs persistence code to metrics component.
This extracts the code for storing persisting a list of unsent logs in
preference, and refactors the code that depends on it.
The SerializedLog class is changed to a private type LogHashPair in PersistedLogs.
The PersistedLogs class replaces the MetricsLogSerializer class, and additionally
takes ownership of the list of logs being managed.
With the current implementation, when a log is staged, it is not removed from
the PersistedLogs object, and is instead removed when the staged log is
discarded. This removes the need for provisionally storing the staged log if
it is currently being uploaded when shutting down.
BUG=372911
Review URL: https://codereview.chromium.org/178833004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@270557 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/components/metrics/metrics_pref_names.cc b/components/metrics/metrics_pref_names.cc
new file mode 100644
index 0000000..92a1890
--- /dev/null
+++ b/components/metrics/metrics_pref_names.cc
@@ -0,0 +1,24 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/metrics/metrics_pref_names.h"
+
+namespace metrics {
+namespace prefs {
+
+// Array of strings that are each UMA logs that were supposed to be sent in the
+// first minute of a browser session. These logs include things like crash count
+// info, etc.
+const char kMetricsInitialLogs[] =
+ "user_experience_metrics.initial_logs_as_protobufs";
+
+// Array of strings that are each UMA logs that were not sent because the
+// browser terminated before these accumulated metrics could be sent. These
+// logs typically include histograms and memory reports, as well as ongoing
+// user activities.
+const char kMetricsOngoingLogs[] =
+ "user_experience_metrics.ongoing_logs_as_protobufs";
+
+} // namespace prefs
+} // namespace metrics