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/statistics_recorder.h" | 5 #include "base/metrics/statistics_recorder.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 // static | 281 // static |
282 void StatisticsRecorder::GetBucketRanges( | 282 void StatisticsRecorder::GetBucketRanges( |
283 std::vector<const BucketRanges*>* output) { | 283 std::vector<const BucketRanges*>* output) { |
284 if (lock_ == NULL) | 284 if (lock_ == NULL) |
285 return; | 285 return; |
286 base::AutoLock auto_lock(*lock_); | 286 base::AutoLock auto_lock(*lock_); |
287 if (ranges_ == NULL) | 287 if (ranges_ == NULL) |
288 return; | 288 return; |
289 | 289 |
290 for (const auto& entry : *ranges_) { | 290 for (const auto& entry : *ranges_) { |
291 for (const auto& range_entry : *entry.second) { | 291 for (auto* range_entry : *entry.second) { |
292 output->push_back(range_entry); | 292 output->push_back(range_entry); |
293 } | 293 } |
294 } | 294 } |
295 } | 295 } |
296 | 296 |
297 // static | 297 // static |
298 HistogramBase* StatisticsRecorder::FindHistogram(base::StringPiece name) { | 298 HistogramBase* StatisticsRecorder::FindHistogram(base::StringPiece name) { |
299 // This must be called *before* the lock is acquired below because it will | 299 // This must be called *before* the lock is acquired below because it will |
300 // call back into this object to register histograms. Those called methods | 300 // call back into this object to register histograms. Those called methods |
301 // will acquire the lock at that time. | 301 // will acquire the lock at that time. |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 // static | 520 // static |
521 StatisticsRecorder::HistogramMap* StatisticsRecorder::histograms_ = NULL; | 521 StatisticsRecorder::HistogramMap* StatisticsRecorder::histograms_ = NULL; |
522 // static | 522 // static |
523 StatisticsRecorder::CallbackMap* StatisticsRecorder::callbacks_ = NULL; | 523 StatisticsRecorder::CallbackMap* StatisticsRecorder::callbacks_ = NULL; |
524 // static | 524 // static |
525 StatisticsRecorder::RangesMap* StatisticsRecorder::ranges_ = NULL; | 525 StatisticsRecorder::RangesMap* StatisticsRecorder::ranges_ = NULL; |
526 // static | 526 // static |
527 base::Lock* StatisticsRecorder::lock_ = NULL; | 527 base::Lock* StatisticsRecorder::lock_ = NULL; |
528 | 528 |
529 } // namespace base | 529 } // namespace base |
OLD | NEW |