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

Unified Diff: base/metrics/sparse_histogram.cc

Issue 2853853002: Fix overflow when logging MaxInt32 to a sparse histogram. (Closed)
Patch Set: 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: base/metrics/sparse_histogram.cc
diff --git a/base/metrics/sparse_histogram.cc b/base/metrics/sparse_histogram.cc
index 415d7f943024a84965933cfb39af4024fd334ea6..916dcd5739ef845e824102b8f648dd43c62aeed8 100644
--- a/base/metrics/sparse_histogram.cc
+++ b/base/metrics/sparse_histogram.cc
@@ -243,7 +243,7 @@ void SparseHistogram::WriteAsciiImpl(bool graph_it,
std::unique_ptr<SampleCountIterator> it = snapshot->Iterator();
while (!it->Done()) {
Sample min;
- Sample max;
+ int64_t max;
Count count;
it->Get(&min, &max, &count);
if (min > largest_sample)
@@ -258,7 +258,7 @@ void SparseHistogram::WriteAsciiImpl(bool graph_it,
it = snapshot->Iterator();
while (!it->Done()) {
Sample min;
- Sample max;
+ int64_t max;
Count count;
it->Get(&min, &max, &count);

Powered by Google App Engine
This is Rietveld 408576698