| Index: base/metrics/sparse_histogram.cc
|
| diff --git a/base/metrics/sparse_histogram.cc b/base/metrics/sparse_histogram.cc
|
| index 05a68b53540a1f5daf23c62c8ac6b6faa94e4006..b8f097fd14a1e49dcd0d359e04542ea31ebcbfb9 100644
|
| --- a/base/metrics/sparse_histogram.cc
|
| +++ b/base/metrics/sparse_histogram.cc
|
| @@ -22,13 +22,13 @@ HistogramBase* SparseHistogram::FactoryGet(const string& name,
|
| SparseHistogram::~SparseHistogram() {}
|
|
|
| void SparseHistogram::Add(Sample value) {
|
| - base::AutoLock auto_lock(lock_);
|
| - samples_[value]++;
|
| + samples_.Accumulate(value, 1);
|
| }
|
|
|
| -void SparseHistogram::SnapshotSample(std::map<Sample, Count>* samples) const {
|
| - base::AutoLock auto_lock(lock_);
|
| - *samples = samples_;
|
| +scoped_ptr<SampleMap> SparseHistogram::SnapshotSamples() const {
|
| + scoped_ptr<SampleMap> snapshot(new SampleMap());
|
| + snapshot->Add(samples_);
|
| + return snapshot.Pass();
|
| }
|
|
|
| void SparseHistogram::WriteHTMLGraph(string* output) const {
|
|
|