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

Unified Diff: base/metrics/histogram_snapshot_manager.cc

Issue 1860033003: Keep histogram and bucket-ranges info in minidumps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/histogram_snapshot_manager.cc
diff --git a/base/metrics/histogram_snapshot_manager.cc b/base/metrics/histogram_snapshot_manager.cc
index 930fa0941efc9aab609dba80d620cdd8102e35f7..e21d512daba271dc43248a9e63b598ce98d55472 100644
--- a/base/metrics/histogram_snapshot_manager.cc
+++ b/base/metrics/histogram_snapshot_manager.cc
@@ -6,6 +6,7 @@
#include <memory>
+#include "base/debug/alias.h"
#include "base/metrics/histogram_flattener.h"
#include "base/metrics/histogram_samples.h"
#include "base/metrics/statistics_recorder.h"
@@ -118,6 +119,10 @@ void HistogramSnapshotManager::PrepareSamples(
// The checksum should have caught this, so crash separately if it didn't.
CHECK_NE(0U, HistogramBase::RANGE_CHECKSUM_ERROR & corruption);
CHECK(false); // Crash for the bucket order corruption.
+ // Ensure that compiler keeps around pointers to |histogram| and its
+ // internal |bucket_ranges_| for any minidumps.
+ base::debug::Alias(
+ static_cast<const Histogram*>(histogram)->bucket_ranges());
}
// Checksum corruption might not have caused order corruption.
CHECK_EQ(0U, HistogramBase::RANGE_CHECKSUM_ERROR & corruption);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698