| 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 // SampleVector implements HistogramSamples interface. It is used by all | 5 // SampleVector implements HistogramSamples interface. It is used by all |
| 6 // Histogram based classes to store samples. | 6 // Histogram based classes to store samples. |
| 7 | 7 |
| 8 #ifndef BASE_METRICS_SAMPLE_VECTOR_H_ | 8 #ifndef BASE_METRICS_SAMPLE_VECTOR_H_ |
| 9 #define BASE_METRICS_SAMPLE_VECTOR_H_ | 9 #define BASE_METRICS_SAMPLE_VECTOR_H_ |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 protected: | 48 protected: |
| 49 bool AddSubtractImpl( | 49 bool AddSubtractImpl( |
| 50 SampleCountIterator* iter, | 50 SampleCountIterator* iter, |
| 51 HistogramSamples::Operator op) override; // |op| is ADD or SUBTRACT. | 51 HistogramSamples::Operator op) override; // |op| is ADD or SUBTRACT. |
| 52 | 52 |
| 53 virtual size_t GetBucketIndex(HistogramBase::Sample value) const; | 53 virtual size_t GetBucketIndex(HistogramBase::Sample value) const; |
| 54 | 54 |
| 55 private: | 55 private: |
| 56 FRIEND_TEST_ALL_PREFIXES(HistogramTest, CorruptSampleCounts); | 56 FRIEND_TEST_ALL_PREFIXES(HistogramTest, CorruptSampleCounts); |
| 57 FRIEND_TEST_ALL_PREFIXES(SharedHistogramTest, CorruptSampleCounts); |
| 57 | 58 |
| 58 // In the case where this class manages the memory, here it is. | 59 // In the case where this class manages the memory, here it is. |
| 59 std::vector<HistogramBase::AtomicCount> local_counts_; | 60 std::vector<HistogramBase::AtomicCount> local_counts_; |
| 60 | 61 |
| 61 // These are raw pointers rather than objects for flexibility. The actual | 62 // These are raw pointers rather than objects for flexibility. The actual |
| 62 // memory is either managed by local_counts_ above or by an external object | 63 // memory is either managed by local_counts_ above or by an external object |
| 63 // and passed in directly. | 64 // and passed in directly. |
| 64 HistogramBase::AtomicCount* counts_; | 65 HistogramBase::AtomicCount* counts_; |
| 65 size_t counts_size_; | 66 size_t counts_size_; |
| 66 | 67 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 95 const HistogramBase::AtomicCount* counts_; | 96 const HistogramBase::AtomicCount* counts_; |
| 96 size_t counts_size_; | 97 size_t counts_size_; |
| 97 const BucketRanges* bucket_ranges_; | 98 const BucketRanges* bucket_ranges_; |
| 98 | 99 |
| 99 size_t index_; | 100 size_t index_; |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 } // namespace base | 103 } // namespace base |
| 103 | 104 |
| 104 #endif // BASE_METRICS_SAMPLE_VECTOR_H_ | 105 #endif // BASE_METRICS_SAMPLE_VECTOR_H_ |
| OLD | NEW |