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

Unified Diff: base/metrics/histogram.cc

Issue 10823137: 1. Add test for https://src.chromium.org/viewvc/chrome?view=rev&revision=149541 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | « no previous file | base/metrics/histogram_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram.cc
===================================================================
--- base/metrics/histogram.cc (revision 149541)
+++ base/metrics/histogram.cc (working copy)
@@ -883,14 +883,15 @@
// static
bool CustomHistogram::ValidateCustomRanges(
const vector<Sample>& custom_ranges) {
- if (custom_ranges.size() < 1)
- return false;
+ bool has_valid_range = false;
for (size_t i = 0; i < custom_ranges.size(); i++) {
- Sample s = custom_ranges[i];
- if (s < 0 || s > HistogramBase::kSampleType_MAX - 1)
+ Sample sample = custom_ranges[i];
+ if (sample < 0 || sample > HistogramBase::kSampleType_MAX - 1)
return false;
+ if (sample != 0)
+ has_valid_range = true;
}
- return true;
+ return has_valid_range;
}
// static
« no previous file with comments | « no previous file | base/metrics/histogram_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698