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

Unified Diff: base/metrics/statistics_recorder.h

Issue 1748403003: Log histograms on shutdown when verbose logging is on (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove abandoned test class 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/statistics_recorder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/statistics_recorder.h
diff --git a/base/metrics/statistics_recorder.h b/base/metrics/statistics_recorder.h
index 6c436c292e6987027276e0cdee49e60787ba1280..37b20a2a806d46e88efaacaa82fcd8b195e7745f 100644
--- a/base/metrics/statistics_recorder.h
+++ b/base/metrics/statistics_recorder.h
@@ -165,6 +165,12 @@ class BASE_EXPORT StatisticsRecorder {
// Returns the number of known histograms.
static size_t GetHistogramCount();
+ // Initializes logging histograms with --v=1. Safe to call several times.
+ // Is called from ctor but for browser it seems that it is more useful to
+ // start logging after statistics recorder, so we need to init log-on-shutdown
+ // later.
+ static void InitLogOnShutdown();
+
// Removes a histogram from the internal set of known ones. This can be
// necessary during testing persistent histograms where the underlying
// memory is being released.
@@ -211,6 +217,10 @@ class BASE_EXPORT StatisticsRecorder {
std::unique_ptr<CallbackMap> existing_callbacks_;
std::unique_ptr<RangesMap> existing_ranges_;
+ bool vlog_initialized_ = false;
+
+ void InitLogOnShutdownWithoutLock();
Alexei Svitkine (slow) 2016/06/29 14:24:47 Nit: Add a comment.
+
static void Reset();
static void DumpHistogramsToVlog(void* instance);
« no previous file with comments | « no previous file | base/metrics/statistics_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698