Chromium Code Reviews| Index: base/metrics/sparse_histogram.h |
| diff --git a/base/metrics/sparse_histogram.h b/base/metrics/sparse_histogram.h |
| index a7c569587a9a049c70019d23ec973de5435a434e..d556e61352c1cdf1d5028e60ba312c94c228b26d 100644 |
| --- a/base/metrics/sparse_histogram.h |
| +++ b/base/metrics/sparse_histogram.h |
| @@ -13,6 +13,7 @@ |
| #include "base/compiler_specific.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "base/metrics/histogram_base.h" |
| +#include "base/metrics/sample_map.h" |
| #include "base/synchronization/lock.h" |
| namespace base { |
| @@ -33,14 +34,24 @@ class BASE_EXPORT_PRIVATE SparseHistogram : public HistogramBase { |
| Sample maximum, |
| size_t bucket_count) const OVERRIDE; |
| virtual void Add(Sample value) OVERRIDE; |
| + virtual void AddSamples(const HistogramSamples& samples) OVERRIDE; |
| + virtual bool AddSamplesFromPickle(PickleIterator* iter) OVERRIDE; |
| + virtual scoped_ptr<HistogramSamples> SnapshotSamples() const OVERRIDE; |
| virtual void WriteHTMLGraph(std::string* output) const OVERRIDE; |
| virtual void WriteAscii(std::string* output) const OVERRIDE; |
| - virtual scoped_ptr<HistogramSamples> SnapshotSamples() const OVERRIDE; |
| + |
| + protected: |
| + // HistogramBase implementation: |
| + virtual bool SerializeInfoImpl(Pickle* pickle) const OVERRIDE; |
| private: |
| // Clients should always use FactoryGet to create SparseHistogram. |
| SparseHistogram(const std::string& name); |
| + friend HistogramBase* HistogramBase::DeserializeHistogramInfo( |
| + PickleIterator* iter); |
| + static HistogramBase* DeserializeHistogramInfo(PickleIterator* iter); |
| + |
| virtual void GetParameters(DictionaryValue* params) const OVERRIDE; |
| virtual void GetCountAndBucketData(Count* count, |
| ListValue* buckets) const OVERRIDE; |
| @@ -49,8 +60,7 @@ class BASE_EXPORT_PRIVATE SparseHistogram : public HistogramBase { |
| // Protects access to |sample_counts_| and |redundant_count_|. |
|
Ilya Sherman
2012/12/29 00:17:30
nit: Please update this comment.
kaiwang
2013/01/08 00:51:40
Done.
|
| mutable base::Lock lock_; |
| - std::map<HistogramBase::Sample, HistogramBase::Count> sample_counts_; |
| - HistogramBase::Count redundant_count_; |
|
Ilya Sherman
2012/12/29 00:17:30
Could you remind me of how the redundant count was
kaiwang
2013/01/08 00:51:40
redundant_count_ is just a duplicated count to det
|
| + SampleMap samples_; |
| DISALLOW_COPY_AND_ASSIGN(SparseHistogram); |
| }; |