Index: base/metrics/statistics_recorder.h |
diff --git a/base/metrics/statistics_recorder.h b/base/metrics/statistics_recorder.h |
index 12543b8d91e35b3b98dbf609195caefbcb0759d6..2fa03f9b2f14664653b5ff6ce62d4626f91eca5b 100644 |
--- a/base/metrics/statistics_recorder.h |
+++ b/base/metrics/statistics_recorder.h |
@@ -14,6 +14,7 @@ |
#include <list> |
#include <map> |
+#include <memory> |
#include <string> |
#include <vector> |
@@ -164,15 +165,15 @@ class BASE_EXPORT StatisticsRecorder { |
// Returns the number of known histograms. |
static size_t GetHistogramCount(); |
- // Clears all of the known histograms and resets static variables to a |
- // state that allows a new initialization. |
- static void ResetForTesting(); |
- |
// 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. |
static void ForgetHistogramForTesting(base::StringPiece name); |
+ // Reset any global instance of the statistics-recorder that was created |
+ // by a call to Initialize(). |
+ static void UninitializeForTesting(); |
+ |
private: |
// We keep a map of callbacks to histograms, so that as histograms are |
// created, we can set the callback properly. |
@@ -199,6 +200,13 @@ class BASE_EXPORT StatisticsRecorder { |
// call the constructor to get a clean StatisticsRecorder. |
StatisticsRecorder(); |
+ // These are copies of everything that existed when the (test) Statistics- |
+ // Recorder was created. The global ones have to be moved aside to create a |
+ // clean environment. |
+ std::unique_ptr<HistogramMap> existing_histograms_; |
+ std::unique_ptr<CallbackMap> existing_callbacks_; |
+ std::unique_ptr<RangesMap> existing_ranges_; |
+ |
static void Reset(); |
static void DumpHistogramsToVlog(void* instance); |