Index: base/metrics/sparse_histogram.cc |
diff --git a/base/metrics/sparse_histogram.cc b/base/metrics/sparse_histogram.cc |
index a853dce3505f450c5ef814371f63f1fa92e7523f..39c276d7877290a9a93123b728061cb06099c51b 100644 |
--- a/base/metrics/sparse_histogram.cc |
+++ b/base/metrics/sparse_histogram.cc |
@@ -46,9 +46,17 @@ bool SparseHistogram::HasConstructionArguments( |
} |
void SparseHistogram::Add(Sample value) { |
+ AddCount(value, 1); |
+} |
+ |
+void SparseHistogram::AddCount(Sample value, int count) { |
+ if (count <= 0) { |
+ NOTREACHED(); |
+ return; |
+ } |
{ |
base::AutoLock auto_lock(lock_); |
- samples_.Accumulate(value, 1); |
+ samples_.Accumulate(value, count); |
} |
FindAndRunCallback(value); |