| 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_BASE_H_ | 5 #ifndef BASE_METRICS_HISTOGRAM_BASE_H_ |
| 6 #define BASE_METRICS_HISTOGRAM_BASE_H_ | 6 #define BASE_METRICS_HISTOGRAM_BASE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 std::string histogram_name() const { return histogram_name_; } | 87 std::string histogram_name() const { return histogram_name_; } |
| 88 | 88 |
| 89 // Operations with Flags enum. | 89 // Operations with Flags enum. |
| 90 int32 flags() const { return flags_; } | 90 int32 flags() const { return flags_; } |
| 91 void SetFlags(int32 flags); | 91 void SetFlags(int32 flags); |
| 92 void ClearFlags(int32 flags); | 92 void ClearFlags(int32 flags); |
| 93 | 93 |
| 94 virtual HistogramType GetHistogramType() const = 0; | 94 virtual HistogramType GetHistogramType() const = 0; |
| 95 | 95 |
| 96 // Whether the histogram has construction arguments as parameters specified. | 96 // Whether the histogram has construction arguments as parameters specified. |
| 97 // For histograms that don't have the concept of |minimum|, |maximum| or | 97 // For histograms that don't have the concept of minimum, maximum or |
| 98 // |bucket_count|, this function always returns false. | 98 // bucket_count, this function always returns false. |
| 99 virtual bool HasConstructionArguments(Sample minimum, | 99 virtual bool HasConstructionArguments(Sample expected_minimum, |
| 100 Sample maximum, | 100 Sample expected_maximum, |
| 101 size_t bucket_count) const = 0; | 101 size_t expected_bucket_count) const = 0; |
| 102 | 102 |
| 103 virtual void Add(Sample value) = 0; | 103 virtual void Add(Sample value) = 0; |
| 104 | 104 |
| 105 // 2 convenient functions that call Add(Sample). | 105 // 2 convenient functions that call Add(Sample). |
| 106 void AddTime(const TimeDelta& time); | 106 void AddTime(const TimeDelta& time); |
| 107 void AddBoolean(bool value); | 107 void AddBoolean(bool value); |
| 108 | 108 |
| 109 virtual void AddSamples(const HistogramSamples& samples) = 0; | 109 virtual void AddSamples(const HistogramSamples& samples) = 0; |
| 110 virtual bool AddSamplesFromPickle(PickleIterator* iter) = 0; | 110 virtual bool AddSamplesFromPickle(PickleIterator* iter) = 0; |
| 111 | 111 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 private: | 162 private: |
| 163 const std::string histogram_name_; | 163 const std::string histogram_name_; |
| 164 int32 flags_; | 164 int32 flags_; |
| 165 | 165 |
| 166 DISALLOW_COPY_AND_ASSIGN(HistogramBase); | 166 DISALLOW_COPY_AND_ASSIGN(HistogramBase); |
| 167 }; | 167 }; |
| 168 | 168 |
| 169 } // namespace base | 169 } // namespace base |
| 170 | 170 |
| 171 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ | 171 #endif // BASE_METRICS_HISTOGRAM_BASE_H_ |
| OLD | NEW |