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

Unified Diff: base/metrics/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 | « no previous file | base/metrics/histogram_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram.cc
diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc
index a48716f60ed6bb2751a2dcde3122f90dee7c2a8d..86c6746c0f590199cefe57c21d35ed4fcb7bd3a2 100644
--- a/base/metrics/histogram.cc
+++ b/base/metrics/histogram.cc
@@ -147,12 +147,6 @@ class Histogram::Factory {
};
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 @@ HistogramBase* Histogram::Factory::Build() {
// 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 @@ std::unique_ptr<HistogramBase> Histogram::PersistentCreate(
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.
« no previous file with comments | « no previous file | base/metrics/histogram_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698