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

Unified Diff: base/metrics/histogram_snapshot_manager.cc

Issue 12207058: Connect SparseHistogram with the rest of stats system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix and add tests Created 7 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/histogram_snapshot_manager.cc
diff --git a/base/metrics/histogram_snapshot_manager.cc b/base/metrics/histogram_snapshot_manager.cc
index ad054b1003c07e4d2cb862b8f29b9c640b2f8fdd..ec685fe424a2bd7f7e659b9a536b4beac331e730 100644
--- a/base/metrics/histogram_snapshot_manager.cc
+++ b/base/metrics/histogram_snapshot_manager.cc
@@ -25,7 +25,7 @@ HistogramSnapshotManager::~HistogramSnapshotManager() {
STLDeleteValues(&logged_samples_);
}
-void HistogramSnapshotManager::PrepareDeltas(Histogram::Flags flag_to_set,
+void HistogramSnapshotManager::PrepareDeltas(HistogramBase::Flags flag_to_set,
bool record_only_uma) {
StatisticsRecorder::Histograms histograms;
StatisticsRecorder::GetHistograms(&histograms);
@@ -40,7 +40,7 @@ void HistogramSnapshotManager::PrepareDeltas(Histogram::Flags flag_to_set,
}
}
-void HistogramSnapshotManager::PrepareDelta(const Histogram& histogram) {
+void HistogramSnapshotManager::PrepareDelta(const HistogramBase& histogram) {
DCHECK(histogram_flattener_);
// Get up-to-date snapshot of sample stats.
@@ -52,13 +52,13 @@ void HistogramSnapshotManager::PrepareDelta(const Histogram& histogram) {
// Crash if we detect that our histograms have been overwritten. This may be
// a fair distance from the memory smasher, but we hope to correlate these
// crashes with other events, such as plugins, or usage patterns, etc.
- if (Histogram::BUCKET_ORDER_ERROR & corruption) {
+ if (BUCKET_ORDER_ERROR & corruption) {
// The checksum should have caught this, so crash separately if it didn't.
- CHECK_NE(0, Histogram::RANGE_CHECKSUM_ERROR & corruption);
+ CHECK_NE(0, RANGE_CHECKSUM_ERROR & corruption);
CHECK(false); // Crash for the bucket order corruption.
}
// Checksum corruption might not have caused order corruption.
- CHECK_EQ(0, Histogram::RANGE_CHECKSUM_ERROR & corruption);
+ CHECK_EQ(0, RANGE_CHECKSUM_ERROR & corruption);
// Note, at this point corruption can only be COUNT_HIGH_ERROR or
// COUNT_LOW_ERROR and they never arise together, so we don't need to extract
@@ -67,14 +67,14 @@ void HistogramSnapshotManager::PrepareDelta(const Histogram& histogram) {
DLOG(ERROR) << "Histogram: " << histogram_name
<< " has data corruption: " << corruption;
histogram_flattener_->InconsistencyDetected(
- static_cast<Histogram::Inconsistencies>(corruption));
+ static_cast<HistogramInconsistency>(corruption));
Ilya Sherman 2013/02/21 05:36:06 Seems like if you're willing to cast here, you mig
kaiwang 2013/02/27 04:39:42 the value FindCorruption returns can be a combinat
// Don't record corrupt data to metrics services.
int old_corruption = inconsistencies_[histogram_name];
if (old_corruption == (corruption | old_corruption))
return; // We've already seen this corruption for this histogram.
inconsistencies_[histogram_name] |= corruption;
histogram_flattener_->UniqueInconsistencyDetected(
- static_cast<Histogram::Inconsistencies>(corruption));
+ static_cast<HistogramInconsistency>(corruption));
return;
}

Powered by Google App Engine
This is Rietveld 408576698