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

Unified Diff: base/metrics/sparse_histogram.cc

Issue 1780993002: Break global impact of PersistentHistogramAllocator into a separate class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-hp
Patch Set: addressed review comments by Alexei 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
Index: base/metrics/sparse_histogram.cc
diff --git a/base/metrics/sparse_histogram.cc b/base/metrics/sparse_histogram.cc
index ee18cfa6b15ffb0b69b56604ac17529cddd1a9bb..a251863fae5827fb14f5e0ee10e41df5ddd1e095 100644
--- a/base/metrics/sparse_histogram.cc
+++ b/base/metrics/sparse_histogram.cc
@@ -23,12 +23,6 @@ typedef HistogramBase::Sample Sample;
// static
HistogramBase* SparseHistogram::FactoryGet(const std::string& name,
int32_t flags) {
- // 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) {
// Try to create the histogram using a "persistent" allocator. As of
@@ -38,8 +32,7 @@ HistogramBase* SparseHistogram::FactoryGet(const std::string& name,
// the process heap.
PersistentMemoryAllocator::Reference histogram_ref = 0;
scoped_ptr<HistogramBase> tentative_histogram;
- PersistentHistogramAllocator* allocator =
- PersistentHistogramAllocator::GetGlobalAllocator();
+ PersistentHistogramAllocator* allocator = GlobalHistogramAllocator::Get();
if (allocator) {
tentative_histogram = allocator->AllocateHistogram(
SPARSE_HISTOGRAM, name, 0, 0, nullptr, flags, &histogram_ref);

Powered by Google App Engine
This is Rietveld 408576698