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

Unified Diff: chrome/common/metrics/metrics_log_manager.cc

Issue 10541085: When persisting UMA logs to disk, cap log size based on both the XML and protocol buffer logs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: max rather than sum Created 8 years, 6 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
« no previous file with comments | « chrome/common/metrics/metrics_log_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/metrics/metrics_log_manager.cc
diff --git a/chrome/common/metrics/metrics_log_manager.cc b/chrome/common/metrics/metrics_log_manager.cc
index e78ce89e152419e09669e77c104c7ab8b9f9ad03..2e1261f3c05f3d0166d940b158add824713383a7 100644
--- a/chrome/common/metrics/metrics_log_manager.cc
+++ b/chrome/common/metrics/metrics_log_manager.cc
@@ -10,6 +10,8 @@
#include "third_party/bzip2/bzlib.h"
#endif
+#include <algorithm>
+
#include "base/metrics/histogram.h"
#include "base/string_util.h"
#include "chrome/common/metrics/metrics_log_base.h"
@@ -37,6 +39,10 @@ bool MetricsLogManager::SerializedLog::empty() const {
return xml.empty();
}
+size_t MetricsLogManager::SerializedLog::length() const {
+ return std::max(xml.length(), proto.length());
+}
+
void MetricsLogManager::SerializedLog::swap(SerializedLog& log) {
xml.swap(log.xml);
proto.swap(log.proto);
« no previous file with comments | « chrome/common/metrics/metrics_log_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698