| Index: base/metrics/sparse_histogram.cc
|
| diff --git a/base/metrics/sparse_histogram.cc b/base/metrics/sparse_histogram.cc
|
| index 7955c572811f2c685535f52cdb81f7c94b8955e2..db76a8a9e00911fd3c4c8008530e775d29e2d231 100644
|
| --- a/base/metrics/sparse_histogram.cc
|
| +++ b/base/metrics/sparse_histogram.cc
|
| @@ -6,6 +6,7 @@
|
|
|
| #include <utility>
|
|
|
| +#include "base/metrics/metrics_hashes.h"
|
| #include "base/metrics/sample_map.h"
|
| #include "base/metrics/statistics_recorder.h"
|
| #include "base/pickle.h"
|
| @@ -35,6 +36,10 @@ HistogramBase* SparseHistogram::FactoryGet(const std::string& name,
|
|
|
| SparseHistogram::~SparseHistogram() {}
|
|
|
| +uint64_t SparseHistogram::name_hash() const {
|
| + return samples_.id();
|
| +}
|
| +
|
| HistogramType SparseHistogram::GetHistogramType() const {
|
| return SPARSE_HISTOGRAM;
|
| }
|
| @@ -65,7 +70,7 @@ void SparseHistogram::AddCount(Sample value, int count) {
|
| }
|
|
|
| scoped_ptr<HistogramSamples> SparseHistogram::SnapshotSamples() const {
|
| - scoped_ptr<SampleMap> snapshot(new SampleMap());
|
| + scoped_ptr<SampleMap> snapshot(new SampleMap(name_hash()));
|
|
|
| base::AutoLock auto_lock(lock_);
|
| snapshot->Add(samples_);
|
| @@ -97,7 +102,8 @@ bool SparseHistogram::SerializeInfoImpl(Pickle* pickle) const {
|
| }
|
|
|
| SparseHistogram::SparseHistogram(const std::string& name)
|
| - : HistogramBase(name) {}
|
| + : HistogramBase(name),
|
| + samples_(HashMetricName(name)) {}
|
|
|
| HistogramBase* SparseHistogram::DeserializeInfoImpl(PickleIterator* iter) {
|
| std::string histogram_name;
|
|
|