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

Unified Diff: base/metrics/histogram_snapshot_manager.cc

Issue 2836993002: Add ThreadChecker to HistogramSnapshotManager. (Closed)
Patch Set: remove dead code (InspectLoggedSamplesInconsistency) Created 3 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 | « base/metrics/histogram_snapshot_manager.h ('k') | 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 a774ea6177c7da8ad8c95c9faded69c185502424..32702d8b3eb94a8800b4fe4f45f487ee4a26df74 100644
--- a/base/metrics/histogram_snapshot_manager.cc
+++ b/base/metrics/histogram_snapshot_manager.cc
@@ -35,6 +35,7 @@ void HistogramSnapshotManager::PrepareFinalDelta(
void HistogramSnapshotManager::PrepareSamples(
const HistogramBase* histogram,
std::unique_ptr<HistogramSamples> samples) {
+ DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(histogram_flattener_);
// Get information known about this histogram. If it did not previously
@@ -93,20 +94,4 @@ void HistogramSnapshotManager::PrepareSamples(
histogram_flattener_->RecordDelta(*histogram, *samples);
}
-void HistogramSnapshotManager::InspectLoggedSamplesInconsistency(
- const HistogramSamples& new_snapshot,
- HistogramSamples* logged_samples) {
- HistogramBase::Count discrepancy =
- logged_samples->TotalCount() - logged_samples->redundant_count();
- if (!discrepancy)
- return;
-
- histogram_flattener_->InconsistencyDetectedInLoggedCount(discrepancy);
- if (discrepancy > Histogram::kCommonRaceBasedCountMismatch) {
- // Fix logged_samples.
- logged_samples->Subtract(*logged_samples);
- logged_samples->Add(new_snapshot);
- }
-}
-
} // namespace base
« no previous file with comments | « base/metrics/histogram_snapshot_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698