| Index: base/metrics/sparse_histogram.h
|
| diff --git a/base/metrics/sparse_histogram.h b/base/metrics/sparse_histogram.h
|
| index 7f363133802a0219f6ca3f029d53e4ae8101b881..bbcabbfbbed512e6743aebced815397b222c8726 100644
|
| --- a/base/metrics/sparse_histogram.h
|
| +++ b/base/metrics/sparse_histogram.h
|
| @@ -51,6 +51,7 @@ namespace base {
|
| } while (0)
|
|
|
| class HistogramSamples;
|
| +class PersistentMemoryAllocator;
|
|
|
| class BASE_EXPORT SparseHistogram : public HistogramBase {
|
| public:
|
| @@ -58,6 +59,12 @@ class BASE_EXPORT SparseHistogram : public HistogramBase {
|
| // new one.
|
| static HistogramBase* FactoryGet(const std::string& name, int32_t flags);
|
|
|
| + // Get a histogram using data in persistent storage.
|
| + static HistogramBase* PersistentGet(PersistentMemoryAllocator* allocator,
|
| + const std::string& name,
|
| + HistogramSamples::Metadata* meta,
|
| + HistogramSamples::Metadata* logged_meta);
|
| +
|
| ~SparseHistogram() override;
|
|
|
| // HistogramBase implementation:
|
| @@ -83,6 +90,11 @@ class BASE_EXPORT SparseHistogram : public HistogramBase {
|
| // Clients should always use FactoryGet to create SparseHistogram.
|
| explicit SparseHistogram(const std::string& name);
|
|
|
| + SparseHistogram(PersistentMemoryAllocator* allocator,
|
| + const std::string& name,
|
| + HistogramSamples::Metadata* meta,
|
| + HistogramSamples::Metadata* logged_meta);
|
| +
|
| friend BASE_EXPORT HistogramBase* DeserializeHistogramInfo(
|
| base::PickleIterator* iter);
|
| static HistogramBase* DeserializeInfoImpl(base::PickleIterator* iter);
|
| @@ -107,8 +119,8 @@ class BASE_EXPORT SparseHistogram : public HistogramBase {
|
| // Protects access to |samples_|.
|
| mutable base::Lock lock_;
|
|
|
| - SampleMap samples_;
|
| - SampleMap logged_samples_;
|
| + scoped_ptr<HistogramSamples> samples_;
|
| + scoped_ptr<HistogramSamples> logged_samples_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(SparseHistogram);
|
| };
|
|
|