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

Unified Diff: base/metrics/persistent_histogram_allocator.cc

Issue 2358023003: Call StatisticsRecorder::Initialize when a GlobalHistogramAllocator is created. (Closed)
Patch Set: removed debugging code Created 4 years, 3 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 | « no previous file | base/metrics/statistics_recorder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/persistent_histogram_allocator.cc
diff --git a/base/metrics/persistent_histogram_allocator.cc b/base/metrics/persistent_histogram_allocator.cc
index 5320d3fa45920353dc272d0a4fab3a376208673e..92fdc86440696777f805b66ad74d102131a81662 100644
--- a/base/metrics/persistent_histogram_allocator.cc
+++ b/base/metrics/persistent_histogram_allocator.cc
@@ -897,7 +897,11 @@ void GlobalHistogramAllocator::DeletePersistentLocation() {
GlobalHistogramAllocator::GlobalHistogramAllocator(
std::unique_ptr<PersistentMemoryAllocator> memory)
: PersistentHistogramAllocator(std::move(memory)),
- import_iterator_(this) {}
+ import_iterator_(this) {
+ // Make sure the StatisticsRecorder is initialized to prevent duplicate
+ // histograms from being created. It's safe to call this multiple times.
+ StatisticsRecorder::Initialize();
+}
void GlobalHistogramAllocator::ImportHistogramsToStatisticsRecorder() {
// Skip the import if it's the histogram that was last created. Should a
« no previous file with comments | « no previous file | base/metrics/statistics_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698