| Index: base/metrics/statistics_recorder.cc
|
| diff --git a/base/metrics/statistics_recorder.cc b/base/metrics/statistics_recorder.cc
|
| index 15e48d8ae622d3572467c93800a0b4caf6547c21..89087f30854de0fc89715d3871d8d0d171481f97 100644
|
| --- a/base/metrics/statistics_recorder.cc
|
| +++ b/base/metrics/statistics_recorder.cc
|
| @@ -24,6 +24,22 @@ base::LazyInstance<base::StatisticsRecorder>::Leaky g_statistics_recorder_ =
|
|
|
| namespace base {
|
|
|
| +StatisticsRecorder::HistogramIterator&
|
| +StatisticsRecorder::HistogramIterator::operator++() {
|
| + const HistogramMap::iterator histograms_end = histograms_->end();
|
| + while (iter_ != histograms_end) {
|
| + ++iter_;
|
| + if (iter_ == histograms_end)
|
| + break;
|
| + if (!include_persistent_ && (iter_->second->flags() &
|
| + HistogramBase::kIsPersistent)) {
|
| + continue;
|
| + }
|
| + break;
|
| + }
|
| + return *this;
|
| +}
|
| +
|
| // static
|
| void StatisticsRecorder::Initialize() {
|
| // Ensure that an instance of the StatisticsRecorder object is created.
|
| @@ -296,7 +312,18 @@ StatisticsRecorder::OnSampleCallback StatisticsRecorder::FindCallback(
|
| : OnSampleCallback();
|
| }
|
|
|
| -// private static
|
| +// static
|
| +StatisticsRecorder::HistogramIterator StatisticsRecorder::begin(
|
| + bool include_persistent) {
|
| + return HistogramIterator(histograms_->begin(), include_persistent);
|
| +}
|
| +
|
| +// static
|
| +StatisticsRecorder::HistogramIterator StatisticsRecorder::end() {
|
| + return HistogramIterator(histograms_->end(), true);
|
| +}
|
| +
|
| +// static
|
| void StatisticsRecorder::GetSnapshot(const std::string& query,
|
| Histograms* snapshot) {
|
| if (lock_ == NULL)
|
|
|