OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_METRICS_SINGLE_VALUE_COUNTS_HISTOGRAM_H_ |
| 6 #define COMPONENTS_METRICS_SINGLE_VALUE_COUNTS_HISTOGRAM_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/metrics/histogram_base.h" |
| 10 #include "components/metrics/public/interfaces/single_value_histograms.mojom.h" |
| 11 |
| 12 namespace metrics { |
| 13 |
| 14 class SingleValueCountsHistogram : public mojom::SingleValueCountsHistogram { |
| 15 public: |
| 16 SingleValueCountsHistogram(const std::string& name, |
| 17 base::HistogramBase::Sample min, |
| 18 base::HistogramBase::Sample max, |
| 19 uint32_t bucket_count); |
| 20 ~SingleValueCountsHistogram() override; |
| 21 |
| 22 private: |
| 23 // mojom::SingleValueCountsHistogram implementation. |
| 24 void SetSample(base::HistogramBase::Sample sample) override; |
| 25 |
| 26 base::HistogramBase* const histogram_; |
| 27 |
| 28 // The last sample provided to SetSample(). We use -1 as a sentinel value to |
| 29 // indicate no sample has been set. |
| 30 base::HistogramBase::Sample sample_ = -1; |
| 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(SingleValueCountsHistogram); |
| 33 }; |
| 34 |
| 35 } // namespace metrics |
| 36 |
| 37 #endif // COMPONENTS_METRICS_SINGLE_VALUE_COUNTS_HISTOGRAM_H_ |
OLD | NEW |