Index: base/metrics/persistent_histogram_allocator.cc |
diff --git a/base/metrics/persistent_histogram_allocator.cc b/base/metrics/persistent_histogram_allocator.cc |
index 864753bab5d3413c46252320657b0d1d4b5e79cd..2d635a552375ab6d7948597b9799869f7d16f929 100644 |
--- a/base/metrics/persistent_histogram_allocator.cc |
+++ b/base/metrics/persistent_histogram_allocator.cc |
@@ -575,8 +575,9 @@ void GlobalHistogramAllocator::ImportHistogramsToStatisticsRecorder() { |
// about 40%. |
Reference record_to_ignore = last_created(); |
- // There is no lock on this because it's expected to be called only by |
- // the StatisticsRecorder which has its own lock. |
+ // There is no lock on this because the iterator is lock-free while still |
+ // guaranteed to only return each entry only once. The StatisticsRecorder |
+ // has its own lock so the Register operation is safe. |
while (true) { |
std::unique_ptr<HistogramBase> histogram = |
import_iterator_.GetNextWithIgnore(record_to_ignore); |