Index: base/metrics/histogram_samples.h |
diff --git a/base/metrics/histogram_samples.h b/base/metrics/histogram_samples.h |
index 0e24c4f160e7a2a29f83eefc554efbf2dffc80f4..9a4829ae84a594f54f78ca2054b571ca7bfd46da 100644 |
--- a/base/metrics/histogram_samples.h |
+++ b/base/metrics/histogram_samples.h |
@@ -198,9 +198,12 @@ class BASE_EXPORT SampleCountIterator { |
// Get the sample and count at current position. |
// |min| |max| and |count| can be NULL if the value is not of interest. |
+ // Note: |max| is int64_t because histograms support logged values in the |
+ // full int32_t range and bucket max is exclusive, so it needs to support |
+ // values up to MAXINT32+1. |
Ilya Sherman
2017/05/02 21:37:49
Could you add a compile-time assertion somewhere t
Alexei Svitkine (slow)
2017/05/03 15:21:53
Done.
|
// Requires: !Done(); |
virtual void Get(HistogramBase::Sample* min, |
- HistogramBase::Sample* max, |
+ int64_t* max, |
HistogramBase::Count* count) const = 0; |
// Get the index of current histogram bucket. |
@@ -212,10 +215,10 @@ class BASE_EXPORT SampleCountIterator { |
class BASE_EXPORT SingleSampleIterator : public SampleCountIterator { |
public: |
SingleSampleIterator(HistogramBase::Sample min, |
- HistogramBase::Sample max, |
+ int64_t max, |
HistogramBase::Count count); |
SingleSampleIterator(HistogramBase::Sample min, |
- HistogramBase::Sample max, |
+ int64_t max, |
HistogramBase::Count count, |
size_t bucket_index); |
~SingleSampleIterator() override; |
@@ -224,7 +227,7 @@ class BASE_EXPORT SingleSampleIterator : public SampleCountIterator { |
bool Done() const override; |
void Next() override; |
void Get(HistogramBase::Sample* min, |
- HistogramBase::Sample* max, |
+ int64_t* max, |
HistogramBase::Count* count) const override; |
// SampleVector uses predefined buckets so iterator can return bucket index. |
@@ -233,7 +236,7 @@ class BASE_EXPORT SingleSampleIterator : public SampleCountIterator { |
private: |
// Information about the single value to return. |
const HistogramBase::Sample min_; |
- const HistogramBase::Sample max_; |
+ const int64_t max_; |
const size_t bucket_index_; |
HistogramBase::Count count_; |
}; |