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

Unified Diff: base/metrics/persistent_histogram_allocator.h

Issue 1996843002: Delay PersistentHistogramAllocator creation until it's known to be used. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed review comments by Alexei Created 4 years, 7 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/persistent_histogram_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/persistent_histogram_allocator.h
diff --git a/base/metrics/persistent_histogram_allocator.h b/base/metrics/persistent_histogram_allocator.h
index c73f7f4b744514fdbd4455b067da077d7ec5bd76..8df45f2813ae6899ad9bf6c294ad64ee477855c1 100644
--- a/base/metrics/persistent_histogram_allocator.h
+++ b/base/metrics/persistent_histogram_allocator.h
@@ -394,26 +394,14 @@ class BASE_EXPORT GlobalHistogramAllocator
// while operating single-threaded so there are no race-conditions.
static void Set(std::unique_ptr<GlobalHistogramAllocator> allocator);
- // Enables the global persistent allocator. Existing histograms will not be
- // affected; only newly created ones will go into the allocator.
- static void Enable();
-
- // Disables the global persistent allocator. Existing histograms will not be
- // affected; newly created histograms will be allocated from the heap.
- static void Disable();
-
- // Gets a pointer to an enabled global histogram allocator. If a global
- // allocator exists but is disabled, this will return null.
+ // Gets a pointer to the global histogram allocator. Returns null if none
+ // exists.
static GlobalHistogramAllocator* Get();
- // Gets a pointer to a global histogram allocator if one exists, even if
- // that allocator is disabled.
- static GlobalHistogramAllocator* GetEvenIfDisabled();
-
// This access to the persistent allocator is only for testing; it extracts
- // the current allocator completely regardless whether it is enabled or not.
- // This allows easy creation of histograms within persistent memory segments
- // which can then be extracted and used in other ways.
+ // the current allocator completely. This allows easy creation of histograms
+ // within persistent memory segments which can then be extracted and used in
+ // other ways.
static std::unique_ptr<GlobalHistogramAllocator> ReleaseForTesting();
// Stores a pathname to which the contents of this allocator should be saved
@@ -429,7 +417,7 @@ class BASE_EXPORT GlobalHistogramAllocator
private:
friend class StatisticsRecorder;
- // Creates a new global histogram allocator. It will be enabled by default.
+ // Creates a new global histogram allocator.
explicit GlobalHistogramAllocator(
std::unique_ptr<PersistentMemoryAllocator> memory);
« no previous file with comments | « no previous file | base/metrics/persistent_histogram_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698