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

Unified Diff: base/metrics/histogram.cc

Issue 6990058: Switch to the new CustomHistogram::ArrayToCustomRanges() utility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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: base/metrics/histogram.cc
diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc
index 6fd30be87ab8d8da79163fb7ab10d53e42f0d553..557ca4498b51ca3ccbdfbd846d05a3fcd7c2500d 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -946,6 +946,7 @@ std::vector<Histogram::Sample> CustomHistogram::ArrayToCustomRanges(
std::vector<Sample> all_values;
for (size_t i = 0; i < num_values; ++i) {
Sample value = values[i];
+ DCHECK_GE(value, 0); // You must use positive sample values.
jar (doing other things) 2011/05/24 18:10:07 This is a good idea (I love DCHECKS). It would be
Jói 2011/05/24 18:27:31 I moved it to Histogram::SetBucketRange. Let me kn
all_values.push_back(value);
// Ensure that a guard bucket is added. If we end up with duplicate

Powered by Google App Engine
This is Rietveld 408576698