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

Unified Diff: components/metrics/histogram_encoder.cc

Issue 2853853002: Fix overflow when logging MaxInt32 to a sparse histogram. (Closed)
Patch Set: Address comments. Created 3 years, 8 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: components/metrics/histogram_encoder.cc
diff --git a/components/metrics/histogram_encoder.cc b/components/metrics/histogram_encoder.cc
index 61f1d4a86b66ed1416dbd6b261a027f03e19e401..4d7d945314175a00a772858e73ad8846207eafae 100644
--- a/components/metrics/histogram_encoder.cc
+++ b/components/metrics/histogram_encoder.cc
@@ -31,7 +31,7 @@ void EncodeHistogramDelta(const std::string& histogram_name,
for (std::unique_ptr<SampleCountIterator> it = snapshot.Iterator();
!it->Done(); it->Next()) {
base::Histogram::Sample min;
- base::Histogram::Sample max;
+ int64_t max;
base::Histogram::Count count;
it->Get(&min, &max, &count);
HistogramEventProto::Bucket* bucket = histogram_proto->add_bucket();

Powered by Google App Engine
This is Rietveld 408576698