| Index: base/metrics/sparse_histogram.cc
|
| diff --git a/base/metrics/sparse_histogram.cc b/base/metrics/sparse_histogram.cc
|
| index 39c276d7877290a9a93123b728061cb06099c51b..8e8e774cd3ee5957548ac44b5e5c91d2162efcd6 100644
|
| --- a/base/metrics/sparse_histogram.cc
|
| +++ b/base/metrics/sparse_histogram.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "base/metrics/sparse_histogram.h"
|
|
|
| +#include "base/metrics/metrics_hashes.h"
|
| #include "base/metrics/sample_map.h"
|
| #include "base/metrics/statistics_recorder.h"
|
| #include "base/pickle.h"
|
| @@ -33,6 +34,10 @@ HistogramBase* SparseHistogram::FactoryGet(const std::string& name,
|
|
|
| SparseHistogram::~SparseHistogram() {}
|
|
|
| +uint64_t SparseHistogram::id() const {
|
| + return samples_.id();
|
| +}
|
| +
|
| HistogramType SparseHistogram::GetHistogramType() const {
|
| return SPARSE_HISTOGRAM;
|
| }
|
| @@ -63,7 +68,8 @@ 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(metrics::HashMetricName(histogram_name())));
|
|
|
| base::AutoLock auto_lock(lock_);
|
| snapshot->Add(samples_);
|
| @@ -95,7 +101,8 @@ bool SparseHistogram::SerializeInfoImpl(Pickle* pickle) const {
|
| }
|
|
|
| SparseHistogram::SparseHistogram(const std::string& name)
|
| - : HistogramBase(name) {}
|
| + : HistogramBase(name),
|
| + samples_(metrics::HashMetricName(name)) {}
|
|
|
| HistogramBase* SparseHistogram::DeserializeInfoImpl(PickleIterator* iter) {
|
| std::string histogram_name;
|
|
|