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

Unified Diff: base/metrics/persistent_histogram_allocator.cc

Issue 1719363002: Collect information about failing histogram factory calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 9 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 | « base/metrics/metrics_hashes.cc ('k') | 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/persistent_histogram_allocator.cc
diff --git a/base/metrics/persistent_histogram_allocator.cc b/base/metrics/persistent_histogram_allocator.cc
index 6006d31fbee70031acb901fb6a0f04a944f5ff04..0eab0163fcf0be0889c85b805cef64b0d0099c64 100644
--- a/base/metrics/persistent_histogram_allocator.cc
+++ b/base/metrics/persistent_histogram_allocator.cc
@@ -295,6 +295,12 @@ scoped_ptr<HistogramBase> PersistentHistogramAllocator::CreateHistogram(
// validated below; the local copy is to ensure that the contents cannot
// be externally changed between validation and use.
PersistentHistogramData histogram_data = *histogram_data_ptr;
+ CHECK_EQ(histogram_data.histogram_type, histogram_data_ptr->histogram_type);
+ CHECK_EQ(histogram_data.flags, histogram_data_ptr->flags);
+ CHECK_EQ(histogram_data.minimum, histogram_data_ptr->minimum);
+ CHECK_EQ(histogram_data.maximum, histogram_data_ptr->maximum);
+ CHECK_EQ(histogram_data.bucket_count, histogram_data_ptr->bucket_count);
+ CHECK_EQ(histogram_data.ranges_checksum, histogram_data_ptr->ranges_checksum);
HistogramBase::Sample* ranges_data =
memory_allocator_->GetAsObject<HistogramBase::Sample>(
@@ -345,6 +351,8 @@ scoped_ptr<HistogramBase> PersistentHistogramAllocator::CreateHistogram(
HistogramBase::AtomicCount* logged_data =
counts_data + histogram_data.bucket_count;
+ CHECK_LT(0, histogram_data.minimum);
+ CHECK_LT(0, histogram_data.maximum);
std::string name(histogram_data_ptr->name);
scoped_ptr<HistogramBase> histogram;
switch (histogram_data.histogram_type) {
« no previous file with comments | « base/metrics/metrics_hashes.cc ('k') | base/metrics/statistics_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698