| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_METRICS_HISTOGRAM_SAMPLES_H_ | 5 #ifndef BASE_METRICS_HISTOGRAM_SAMPLES_H_ |
| 6 #define BASE_METRICS_HISTOGRAM_SAMPLES_H_ | 6 #define BASE_METRICS_HISTOGRAM_SAMPLES_H_ |
| 7 | 7 |
| 8 #include "base/atomicops.h" | 8 #include "base/atomicops.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/metrics/histogram_base.h" | 10 #include "base/metrics/histogram_base.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 explicit HistogramSamples(uint64 id); | 49 explicit HistogramSamples(uint64 id); |
| 50 HistogramSamples(uint64 id, Metadata* meta); | 50 HistogramSamples(uint64 id, Metadata* meta); |
| 51 virtual ~HistogramSamples(); | 51 virtual ~HistogramSamples(); |
| 52 | 52 |
| 53 virtual void Accumulate(HistogramBase::Sample value, | 53 virtual void Accumulate(HistogramBase::Sample value, |
| 54 HistogramBase::Count count) = 0; | 54 HistogramBase::Count count) = 0; |
| 55 virtual HistogramBase::Count GetCount(HistogramBase::Sample value) const = 0; | 55 virtual HistogramBase::Count GetCount(HistogramBase::Sample value) const = 0; |
| 56 virtual HistogramBase::Count TotalCount() const = 0; | 56 virtual HistogramBase::Count TotalCount() const = 0; |
| 57 | 57 |
| 58 virtual void Negate() = 0; |
| 58 virtual void Add(const HistogramSamples& other); | 59 virtual void Add(const HistogramSamples& other); |
| 59 | 60 |
| 60 // Add from serialized samples. | 61 // Add from serialized samples. |
| 61 virtual bool AddFromPickle(PickleIterator* iter); | 62 virtual bool AddFromPickle(PickleIterator* iter); |
| 62 | 63 |
| 63 virtual void Subtract(const HistogramSamples& other); | 64 virtual void Subtract(const HistogramSamples& other); |
| 64 | 65 |
| 65 virtual scoped_ptr<SampleCountIterator> Iterator() const = 0; | 66 virtual scoped_ptr<SampleCountIterator> Iterator() const = 0; |
| 66 virtual bool Serialize(Pickle* pickle) const; | 67 virtual bool Serialize(Pickle* pickle) const; |
| 67 | 68 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 107 |
| 107 // Get the index of current histogram bucket. | 108 // Get the index of current histogram bucket. |
| 108 // For histograms that don't use predefined buckets, it returns false. | 109 // For histograms that don't use predefined buckets, it returns false. |
| 109 // Requires: !Done(); | 110 // Requires: !Done(); |
| 110 virtual bool GetBucketIndex(size_t* index) const; | 111 virtual bool GetBucketIndex(size_t* index) const; |
| 111 }; | 112 }; |
| 112 | 113 |
| 113 } // namespace base | 114 } // namespace base |
| 114 | 115 |
| 115 #endif // BASE_METRICS_HISTOGRAM_SAMPLES_H_ | 116 #endif // BASE_METRICS_HISTOGRAM_SAMPLES_H_ |
| OLD | NEW |