Index: chrome/browser/metrics/metrics_log_serializer.h |
diff --git a/chrome/browser/metrics/metrics_log_serializer.h b/chrome/browser/metrics/metrics_log_serializer.h |
index 69986b6b7d1a1fa7da1a3f270010efc1f886ee4c..ed156f1a48c74476f3ecf4be9c7b7f41ca20669b 100644 |
--- a/chrome/browser/metrics/metrics_log_serializer.h |
+++ b/chrome/browser/metrics/metrics_log_serializer.h |
@@ -17,7 +17,7 @@ class ListValue; |
// Serializer for persisting metrics logs to prefs. |
class MetricsLogSerializer : public MetricsLogManager::LogSerializer { |
public: |
- // Used to produce a historgram that keeps track of the status of recalling |
+ // Used to produce a histogram that keeps track of the status of recalling |
// persisted per logs. |
enum LogReadStatus { |
RECALL_SUCCESS, // We were able to correctly recall a persisted log. |
@@ -28,8 +28,9 @@ class MetricsLogSerializer : public MetricsLogManager::LogSerializer { |
LOG_STRING_CORRUPTION, // Failed to recover log string using GetAsString(). |
CHECKSUM_CORRUPTION, // Failed to verify checksum. |
CHECKSUM_STRING_CORRUPTION, // Failed to recover checksum string using |
- // GetAsString(). |
+ // GetAsString(). |
DECODE_FAIL, // Failed to decode log. |
+ XML_PROTO_MISMATCH, // The XML and protobuf logs have inconsistent data. |
END_RECALL_STATUS // Number of bins to use to create the histogram. |
}; |
@@ -37,10 +38,12 @@ class MetricsLogSerializer : public MetricsLogManager::LogSerializer { |
virtual ~MetricsLogSerializer(); |
// Implementation of MetricsLogManager::LogSerializer |
- virtual void SerializeLogs(const std::vector<std::string>& logs, |
- MetricsLogManager::LogType log_type) OVERRIDE; |
- virtual void DeserializeLogs(MetricsLogManager::LogType log_type, |
- std::vector<std::string>* logs) OVERRIDE; |
+ virtual void SerializeLogs( |
+ const std::vector<std::pair<std::string, std::string> >& logs, |
jar (doing other things)
2012/02/23 01:59:18
Please add comment about the meaning of pairs of s
|
+ MetricsLogManager::LogType log_type) OVERRIDE; |
+ virtual void DeserializeLogs( |
+ MetricsLogManager::LogType log_type, |
+ std::vector<std::pair<std::string, std::string> >* logs) OVERRIDE; |
private: |
// Encodes the textual log data from |local_list| and writes it to the given |
@@ -51,8 +54,11 @@ class MetricsLogSerializer : public MetricsLogManager::LogSerializer { |
// Decodes and verifies the textual log data from |list|, populating |
// |local_list| and returning a status code. |
+ // |is_xml| should be true if this is an XML log and false if this is a |
jar (doing other things)
2012/02/23 01:59:18
I wasn't able to understand the comment as written
Ilya Sherman
2012/02/24 02:10:06
Is it clearer now, or still confusing?
jar (doing other things)
2012/02/27 20:35:34
Much better. Thanks!
On 2012/02/24 02:10:06, Ilya
|
+ // protobuf log; it is used exclusively for logging histograms. |
static LogReadStatus ReadLogsFromPrefList( |
const base::ListValue& list, |
+ bool is_xml, |
std::vector<std::string>* local_list); |
FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, EmptyLogList); |