Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(502)

Unified Diff: components/metrics/file_metrics_provider.cc

Issue 1803253002: Improved iterator for persistent memory allocator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-hp
Patch Set: rebased Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/persistent_sample_map.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/file_metrics_provider.cc
diff --git a/components/metrics/file_metrics_provider.cc b/components/metrics/file_metrics_provider.cc
index fcfb7acfb88a4bd772c4db3b9b1213a6a859a338..78fb90a1211c5f6b4e69330517e4197aef496c58 100644
--- a/components/metrics/file_metrics_provider.cc
+++ b/components/metrics/file_metrics_provider.cc
@@ -174,13 +174,12 @@ void FileMetricsProvider::RecordHistogramSnapshotsFromFile(
base::HistogramSnapshotManager* snapshot_manager,
FileInfo* file) {
DCHECK(thread_checker_.CalledOnValidThread());
- base::PersistentHistogramAllocator::Iterator histogram_iter;
- file->allocator->CreateIterator(&histogram_iter);
+ base::PersistentHistogramAllocator::Iterator histogram_iter(
+ file->allocator.get());
int histogram_count = 0;
while (true) {
- scoped_ptr<base::HistogramBase> histogram =
- file->allocator->GetNextHistogram(&histogram_iter);
+ scoped_ptr<base::HistogramBase> histogram = histogram_iter.GetNext();
if (!histogram)
break;
if (file->type == FILE_HISTOGRAMS_ATOMIC)
« no previous file with comments | « base/metrics/persistent_sample_map.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698