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

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 linux compiling 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..bc0213cb2a4632b85999206a7dcb3aac372835a6 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,25 +40,25 @@ 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.
scoped_ptr<HistogramSamples> snapshot(histogram.SnapshotSamples());
const std::string& histogram_name = histogram.histogram_name();
- int corruption = histogram.FindCorruption(*snapshot);
+ int32 corruption = histogram.FindCorruption(*snapshot);
// 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));
// 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