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

Unified Diff: base/metrics/statistics_recorder.cc

Issue 1485763002: Merge multiple histogram snapshots into single one for reporting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared-histograms
Patch Set: Change 'inconsistencies' from int to unsigned. Created 4 years, 10 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
Index: base/metrics/statistics_recorder.cc
diff --git a/base/metrics/statistics_recorder.cc b/base/metrics/statistics_recorder.cc
index 12e448941c848093e1c4396735982b964b00205b..7efe16b10c15596f968a4fcced8ad4ae4d7d9ee4 100644
--- a/base/metrics/statistics_recorder.cc
+++ b/base/metrics/statistics_recorder.cc
@@ -392,6 +392,25 @@ StatisticsRecorder::StatisticsRecorder() {
}
// static
+void StatisticsRecorder::ResetForTesting() {
Alexei Svitkine (slow) 2016/02/17 16:21:12 Please order this same as in the .h file - i.e. ab
bcwhite 2016/02/17 17:58:20 This is being moved into another CL.
Alexei Svitkine (slow) 2016/02/17 18:15:16 So should it be deleted from this CL? Or are you p
bcwhite 2016/02/17 19:39:50 The latter. I think the other one is ready to lan
+ if (histograms_) {
+ STLDeleteValues(histograms_);
+ delete histograms_;
+ histograms_= nullptr;
+ }
+ if (ranges_) {
+ for (auto& iter : *ranges_) {
+ STLDeleteElements(iter.second);
+ delete iter.second;
+ }
+ delete ranges_;
+ ranges_ = nullptr;
+ }
+ delete callbacks_;
+ callbacks_ = nullptr;
Alexei Svitkine (slow) 2016/02/17 16:21:12 A lot of this code is similar to what's done in th
bcwhite 2016/02/17 17:58:20 This is being moved into another CL. It turns out
+}
+
+// static
void StatisticsRecorder::DumpHistogramsToVlog(void* instance) {
std::string output;
StatisticsRecorder::WriteGraph(std::string(), &output);

Powered by Google App Engine
This is Rietveld 408576698