Break global impact of PersistentHistogramAllocator into a separate class.
BUG=546019
TBR=grt
grt: setup/installer (no logic changes, just names)
Review URL: https://codereview.chromium.org/1780993002
Cr-Commit-Position: refs/heads/master@{#385367}
diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc
index a48716f6..86c6746 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -147,12 +147,6 @@
};
HistogramBase* Histogram::Factory::Build() {
- // Import histograms from known persistent storage. Histograms could have
- // been added by other processes and they must be fetched and recognized
- // locally in order to be found by FindHistograms() below. If the persistent
- // memory segment is not shared between processes, this call does nothing.
- PersistentHistogramAllocator::ImportGlobalHistograms();
-
HistogramBase* histogram = StatisticsRecorder::FindHistogram(name_);
if (!histogram) {
// To avoid racy destruction at shutdown, the following will be leaked.
@@ -178,8 +172,7 @@
// the process heap.
PersistentHistogramAllocator::Reference histogram_ref = 0;
std::unique_ptr<HistogramBase> tentative_histogram;
- PersistentHistogramAllocator* allocator =
- PersistentHistogramAllocator::GetGlobalAllocator();
+ PersistentHistogramAllocator* allocator = GlobalHistogramAllocator::Get();
if (allocator) {
tentative_histogram = allocator->AllocateHistogram(
histogram_type_,
@@ -289,8 +282,8 @@
HistogramSamples::Metadata* meta,
HistogramSamples::Metadata* logged_meta) {
return WrapUnique(new Histogram(name, minimum, maximum, ranges, counts,
- logged_counts, counts_size, meta,
- logged_meta));
+ logged_counts, counts_size, meta,
+ logged_meta));
}
// Calculate what range of values are held in each bucket.