Chromium Code Reviews| Index: base/metrics/sparse_histogram.cc |
| diff --git a/base/metrics/sparse_histogram.cc b/base/metrics/sparse_histogram.cc |
| index a853dce3505f450c5ef814371f63f1fa92e7523f..9abced007a3977d5a4c3af3caa4393eb28a9f6df 100644 |
| --- a/base/metrics/sparse_histogram.cc |
| +++ b/base/metrics/sparse_histogram.cc |
| @@ -46,11 +46,17 @@ bool SparseHistogram::HasConstructionArguments( |
| } |
| void SparseHistogram::Add(Sample value) { |
| + AddCount(value, 1); |
| +} |
| + |
| +void SparseHistogram::AddCount(Sample value, int count) { |
| { |
| base::AutoLock auto_lock(lock_); |
| - samples_.Accumulate(value, 1); |
| + if (count < 0) { |
|
Alexei Svitkine (slow)
2015/08/03 18:15:42
Same comment as in the other method. This if can p
amohammadkhan
2015/08/04 18:22:51
Done.
|
| + count = 0; |
| + } |
| + samples_.Accumulate(value, count); |
| } |
| - |
|
Alexei Svitkine (slow)
2015/08/03 18:15:42
Nit: Keep the empty line.
amohammadkhan
2015/08/04 18:22:51
Done.
|
| FindAndRunCallback(value); |
| } |