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

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: fixed bad formatting from upstream scoped_ptr change 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_histogram_allocator_unittest.cc ('k') | base/metrics/sparse_histogram_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/sparse_histogram.cc
diff --git a/base/metrics/sparse_histogram.cc b/base/metrics/sparse_histogram.cc
index 1118c4149ef95f6c8e734ef7fca3646b58b8c50c..31fcfd93d63cc4d1ee14667433488510785da7ad 100644
--- a/base/metrics/sparse_histogram.cc
+++ b/base/metrics/sparse_histogram.cc
@@ -24,12 +24,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
@@ -39,8 +33,7 @@ HistogramBase* SparseHistogram::FactoryGet(const std::string& name,
// the process heap.
PersistentMemoryAllocator::Reference histogram_ref = 0;
std::unique_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);
« no previous file with comments | « base/metrics/persistent_histogram_allocator_unittest.cc ('k') | base/metrics/sparse_histogram_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698