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 #include "base/metrics/sample_vector.h" | 5 #include "base/metrics/sample_vector.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/bucket_ranges.h" | 8 #include "base/metrics/bucket_ranges.h" |
9 | 9 |
10 using std::vector; | 10 using std::vector; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 SampleVectorIterator::SampleVectorIterator(const vector<Count>* counts, | 111 SampleVectorIterator::SampleVectorIterator(const vector<Count>* counts, |
112 const BucketRanges* bucket_ranges) | 112 const BucketRanges* bucket_ranges) |
113 : counts_(counts), | 113 : counts_(counts), |
114 bucket_ranges_(bucket_ranges), | 114 bucket_ranges_(bucket_ranges), |
115 index_(0) { | 115 index_(0) { |
116 CHECK_GT(bucket_ranges_->size(), counts_->size()); | 116 CHECK_GT(bucket_ranges_->size(), counts_->size()); |
117 SkipEmptyBuckets(); | 117 SkipEmptyBuckets(); |
118 } | 118 } |
119 | 119 |
| 120 SampleVectorIterator::~SampleVectorIterator() {} |
| 121 |
120 bool SampleVectorIterator::Done() const { | 122 bool SampleVectorIterator::Done() const { |
121 return index_ >= counts_->size(); | 123 return index_ >= counts_->size(); |
122 } | 124 } |
123 | 125 |
124 void SampleVectorIterator::Next() { | 126 void SampleVectorIterator::Next() { |
125 DCHECK(!Done()); | 127 DCHECK(!Done()); |
126 index_++; | 128 index_++; |
127 SkipEmptyBuckets(); | 129 SkipEmptyBuckets(); |
128 } | 130 } |
129 | 131 |
(...skipping 21 matching lines...) Expand all Loading... |
151 return; | 153 return; |
152 | 154 |
153 while (index_ < counts_->size()) { | 155 while (index_ < counts_->size()) { |
154 if ((*counts_)[index_] != 0) | 156 if ((*counts_)[index_] != 0) |
155 return; | 157 return; |
156 index_++; | 158 index_++; |
157 } | 159 } |
158 } | 160 } |
159 | 161 |
160 } // namespace base | 162 } // namespace base |
OLD | NEW |