Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Unified Diff: chrome/browser/metrics/metrics_log_serializer.h

Issue 9562007: Add a minimum byte count to metrics log serialization (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change limit terminology, |start| decrement logic Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 9a1e630415015ac855101cc519c9a675da161096..66dad91589903d76eb3d9ac8e34af4ea41cb37d5 100644
--- a/chrome/browser/metrics/metrics_log_serializer.h
+++ b/chrome/browser/metrics/metrics_log_serializer.h
@@ -49,10 +49,14 @@ class MetricsLogSerializer : public MetricsLogManager::LogSerializer {
// Encodes the textual log data from |local_list| and writes it to the given
// pref list, along with list size and checksum. If |is_xml| is true, writes
// the XML data from |local_list|; otherwise writes the protobuf data.
+ // Logs will be stored starting with the most recent, and working backward
+ // until at least |list_length_limit| logs and |byte_limit| bytes of logs have
+ // been stored. At least one of those two arguments must be non-zero.
static void WriteLogsToPrefList(
const std::vector<MetricsLogManager::SerializedLog>& local_list,
bool is_xml,
- size_t max_list_size,
+ size_t list_length_limit,
+ size_t byte_limit,
base::ListValue* list);
// Decodes and verifies the textual log data from |list|, populating
@@ -65,7 +69,10 @@ class MetricsLogSerializer : public MetricsLogManager::LogSerializer {
FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, EmptyLogList);
FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, SingleElementLogList);
- FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, OverLimitLogList);
+ FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, LongButTinyLogList);
+ FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, LongButSmallLogList);
+ FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, ShortButLargeLogList);
+ FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, LongAndLargeLogList);
FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, SmallRecoveredListSize);
FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, RemoveSizeFromLogList);
FRIEND_TEST_ALL_PREFIXES(MetricsLogSerializerTest, CorruptSizeOfLogList);
« no previous file with comments | « no previous file | chrome/browser/metrics/metrics_log_serializer.cc » ('j') | chrome/browser/metrics/metrics_log_serializer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698