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) { |