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

Unified Diff: base/android/record_histogram.cc

Issue 2455803002: Enforce min expected value for CustomCountHistograms on android (Closed)
Patch Set: Created 4 years, 2 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/android/record_histogram.cc
diff --git a/base/android/record_histogram.cc b/base/android/record_histogram.cc
index 3c51fe27089c931ee0fb2834a17f2f7977229930..5679762ee07c1ecc0b604bb842d20e9323a67ec5 100644
--- a/base/android/record_histogram.cc
+++ b/base/android/record_histogram.cc
@@ -113,6 +113,8 @@ class HistogramCache {
return histogram;
}
+ DCHECK_GE(min, 1) << "The min expected sample must be >= 1";
+
std::string histogram_name = ConvertJavaStringToUTF8(env, j_histogram_name);
histogram =
Histogram::FactoryGet(histogram_name, min, max, num_buckets,

Powered by Google App Engine
This is Rietveld 408576698