Index: components/metrics/file_metrics_provider.cc |
diff --git a/components/metrics/file_metrics_provider.cc b/components/metrics/file_metrics_provider.cc |
index 1972019ef9badd1e93ec392b20e06e630b8739e7..24cfa9b761368155ec1698486ceef795f8a89a82 100644 |
--- a/components/metrics/file_metrics_provider.cc |
+++ b/components/metrics/file_metrics_provider.cc |
@@ -122,6 +122,8 @@ FileMetricsProvider::FileMetricsProvider( |
: task_runner_(task_runner), |
pref_service_(local_state), |
weak_factory_(this) { |
+ base::StatisticsRecorder::RegisterHistogramProvider( |
+ weak_factory_.GetWeakPtr()); |
} |
FileMetricsProvider::~FileMetricsProvider() {} |
@@ -522,20 +524,6 @@ bool FileMetricsProvider::HasInitialStabilityMetrics() { |
return !sources_for_previous_run_.empty(); |
} |
-void FileMetricsProvider::MergeHistogramDeltas() { |
- DCHECK(thread_checker_.CalledOnValidThread()); |
- |
- // Measure the total time spent processing all sources as well as the time |
- // per individual file. This method is called on the UI thread so it's |
- // important to know how much total "jank" may be introduced. |
- SCOPED_UMA_HISTOGRAM_TIMER("UMA.FileMetricsProvider.SnapshotTime.Total"); |
- |
- for (std::unique_ptr<SourceInfo>& source : sources_mapped_) { |
- SCOPED_UMA_HISTOGRAM_TIMER("UMA.FileMetricsProvider.SnapshotTime.File"); |
- MergeHistogramDeltasFromSource(source.get()); |
- } |
-} |
- |
void FileMetricsProvider::RecordInitialHistogramSnapshots( |
base::HistogramSnapshotManager* snapshot_manager) { |
DCHECK(thread_checker_.CalledOnValidThread()); |
@@ -564,4 +552,18 @@ void FileMetricsProvider::RecordInitialHistogramSnapshots( |
} |
} |
+void FileMetricsProvider::MergeHistogramDeltas() { |
+ DCHECK(thread_checker_.CalledOnValidThread()); |
+ |
+ // Measure the total time spent processing all sources as well as the time |
+ // per individual file. This method is called on the UI thread so it's |
+ // important to know how much total "jank" may be introduced. |
+ SCOPED_UMA_HISTOGRAM_TIMER("UMA.FileMetricsProvider.SnapshotTime.Total"); |
+ |
+ for (std::unique_ptr<SourceInfo>& source : sources_mapped_) { |
+ SCOPED_UMA_HISTOGRAM_TIMER("UMA.FileMetricsProvider.SnapshotTime.File"); |
+ MergeHistogramDeltasFromSource(source.get()); |
+ } |
+} |
+ |
} // namespace metrics |