Chromium Code Reviews| Index: base/metrics/histogram.h |
| diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h |
| index a76dd63226131b873490546965c9f572a1b2ce7c..4d3a42d34b7f814a7bea3a966e9d197e8922bb5a 100644 |
| --- a/base/metrics/histogram.h |
| +++ b/base/metrics/histogram.h |
| @@ -86,11 +86,13 @@ namespace base { |
| class BooleanHistogram; |
| class CustomHistogram; |
| +class DelayedPersistentAllocation; |
| class Histogram; |
| class LinearHistogram; |
| class Pickle; |
| class PickleIterator; |
| class SampleVector; |
| +class SampleVectorBase; |
| class BASE_EXPORT Histogram : public HistogramBase { |
| public: |
| @@ -142,11 +144,10 @@ class BASE_EXPORT Histogram : public HistogramBase { |
| Sample minimum, |
| Sample maximum, |
| const BucketRanges* ranges, |
| - HistogramBase::AtomicCount* counts, |
| - HistogramBase::AtomicCount* logged_counts, |
| - uint32_t counts_size, |
| HistogramSamples::Metadata* meta, |
| - HistogramSamples::Metadata* logged_meta); |
| + const DelayedPersistentAllocation& counts, |
| + HistogramSamples::Metadata* logged_meta, |
|
Alexei Svitkine (slow)
2017/04/12 17:38:06
Non-const params should be last - so add the new p
bcwhite
2017/04/13 00:06:00
<sigh> There were arranged like that but I figure
|
| + const DelayedPersistentAllocation& logged_counts); |
| static void InitializeBucketRanges(Sample minimum, |
| Sample maximum, |
| @@ -230,11 +231,10 @@ class BASE_EXPORT Histogram : public HistogramBase { |
| Sample minimum, |
| Sample maximum, |
| const BucketRanges* ranges, |
| - HistogramBase::AtomicCount* counts, |
| - HistogramBase::AtomicCount* logged_counts, |
| - uint32_t counts_size, |
| HistogramSamples::Metadata* meta, |
| - HistogramSamples::Metadata* logged_meta); |
| + const DelayedPersistentAllocation& counts, |
| + HistogramSamples::Metadata* logged_meta, |
| + const DelayedPersistentAllocation& logged_counts); |
| // HistogramBase implementation: |
| bool SerializeInfoImpl(base::Pickle* pickle) const override; |
| @@ -274,10 +274,10 @@ class BASE_EXPORT Histogram : public HistogramBase { |
| std::string* output) const; |
| // Find out how large (graphically) the largest bucket will appear to be. |
| - double GetPeakBucketSize(const SampleVector& samples) const; |
| + double GetPeakBucketSize(const SampleVectorBase& samples) const; |
| // Write a common header message describing this histogram. |
| - void WriteAsciiHeader(const SampleVector& samples, |
| + void WriteAsciiHeader(const SampleVectorBase& samples, |
| Count sample_count, |
| std::string* output) const; |
| @@ -304,7 +304,7 @@ class BASE_EXPORT Histogram : public HistogramBase { |
| // Finally, provide the state that changes with the addition of each new |
| // sample. |
| - std::unique_ptr<SampleVector> samples_; |
| + std::unique_ptr<SampleVectorBase> samples_; |
| // Also keep a previous uploaded state for calculating deltas. |
| std::unique_ptr<HistogramSamples> logged_samples_; |
| @@ -357,11 +357,10 @@ class BASE_EXPORT LinearHistogram : public Histogram { |
| Sample minimum, |
| Sample maximum, |
| const BucketRanges* ranges, |
| - HistogramBase::AtomicCount* counts, |
| - HistogramBase::AtomicCount* logged_counts, |
| - uint32_t counts_size, |
| HistogramSamples::Metadata* meta, |
| - HistogramSamples::Metadata* logged_meta); |
| + const DelayedPersistentAllocation& counts, |
| + HistogramSamples::Metadata* logged_meta, |
| + const DelayedPersistentAllocation& logged_counts); |
| struct DescriptionPair { |
| Sample sample; |
| @@ -400,11 +399,10 @@ class BASE_EXPORT LinearHistogram : public Histogram { |
| Sample minimum, |
| Sample maximum, |
| const BucketRanges* ranges, |
| - HistogramBase::AtomicCount* counts, |
| - HistogramBase::AtomicCount* logged_counts, |
| - uint32_t counts_size, |
| HistogramSamples::Metadata* meta, |
| - HistogramSamples::Metadata* logged_meta); |
| + const DelayedPersistentAllocation& counts, |
| + HistogramSamples::Metadata* logged_meta, |
| + const DelayedPersistentAllocation& logged_counts); |
| double GetBucketSize(Count current, uint32_t i) const override; |
| @@ -446,10 +444,10 @@ class BASE_EXPORT BooleanHistogram : public LinearHistogram { |
| static std::unique_ptr<HistogramBase> PersistentCreate( |
| const std::string& name, |
| const BucketRanges* ranges, |
| - HistogramBase::AtomicCount* counts, |
| - HistogramBase::AtomicCount* logged_counts, |
| HistogramSamples::Metadata* meta, |
| - HistogramSamples::Metadata* logged_meta); |
| + const DelayedPersistentAllocation& counts, |
| + HistogramSamples::Metadata* logged_meta, |
| + const DelayedPersistentAllocation& logged_counts); |
| HistogramType GetHistogramType() const override; |
| @@ -460,10 +458,10 @@ class BASE_EXPORT BooleanHistogram : public LinearHistogram { |
| BooleanHistogram(const std::string& name, const BucketRanges* ranges); |
| BooleanHistogram(const std::string& name, |
| const BucketRanges* ranges, |
| - HistogramBase::AtomicCount* counts, |
| - HistogramBase::AtomicCount* logged_counts, |
| HistogramSamples::Metadata* meta, |
| - HistogramSamples::Metadata* logged_meta); |
| + const DelayedPersistentAllocation& counts, |
| + HistogramSamples::Metadata* logged_meta, |
| + const DelayedPersistentAllocation& logged_counts); |
| friend BASE_EXPORT HistogramBase* DeserializeHistogramInfo( |
| base::PickleIterator* iter); |
| @@ -496,11 +494,10 @@ class BASE_EXPORT CustomHistogram : public Histogram { |
| static std::unique_ptr<HistogramBase> PersistentCreate( |
| const std::string& name, |
| const BucketRanges* ranges, |
| - HistogramBase::AtomicCount* counts, |
| - HistogramBase::AtomicCount* logged_counts, |
| - uint32_t counts_size, |
| HistogramSamples::Metadata* meta, |
| - HistogramSamples::Metadata* logged_meta); |
| + const DelayedPersistentAllocation& counts, |
| + HistogramSamples::Metadata* logged_meta, |
| + const DelayedPersistentAllocation& logged_counts); |
| // Overridden from Histogram: |
| HistogramType GetHistogramType() const override; |
| @@ -521,11 +518,10 @@ class BASE_EXPORT CustomHistogram : public Histogram { |
| CustomHistogram(const std::string& name, |
| const BucketRanges* ranges, |
| - HistogramBase::AtomicCount* counts, |
| - HistogramBase::AtomicCount* logged_counts, |
| - uint32_t counts_size, |
| HistogramSamples::Metadata* meta, |
| - HistogramSamples::Metadata* logged_meta); |
| + const DelayedPersistentAllocation& counts, |
| + HistogramSamples::Metadata* logged_meta, |
| + const DelayedPersistentAllocation& logged_counts); |
| // HistogramBase implementation: |
| bool SerializeInfoImpl(base::Pickle* pickle) const override; |