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

Unified Diff: base/metrics/histogram_delta_serialization.cc

Issue 1463013002: Use ThreadChecker in HistogramDeltaSerialization class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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_delta_serialization.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_delta_serialization.cc
diff --git a/base/metrics/histogram_delta_serialization.cc b/base/metrics/histogram_delta_serialization.cc
index e4aad13ac229aea13033635f8221f2e62dd96958..f2b825b6d3121c4d8d0fd85f0a49c6df04fe4822 100644
--- a/base/metrics/histogram_delta_serialization.cc
+++ b/base/metrics/histogram_delta_serialization.cc
@@ -61,6 +61,8 @@ HistogramDeltaSerialization::~HistogramDeltaSerialization() {
void HistogramDeltaSerialization::PrepareAndSerializeDeltas(
std::vector<std::string>* serialized_deltas) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
serialized_deltas_ = serialized_deltas;
// Note: Before serializing, we set the kIPCSerializationSourceFlag for all
// the histograms, so that the receiving process can distinguish them from the
@@ -84,6 +86,7 @@ void HistogramDeltaSerialization::DeserializeAndAddSamples(
void HistogramDeltaSerialization::RecordDelta(
const HistogramBase& histogram,
const HistogramSamples& snapshot) {
+ DCHECK(thread_checker_.CalledOnValidThread());
DCHECK_NE(0, snapshot.TotalCount());
Pickle pickle;
@@ -95,16 +98,22 @@ void HistogramDeltaSerialization::RecordDelta(
void HistogramDeltaSerialization::InconsistencyDetected(
HistogramBase::Inconsistency problem) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
inconsistencies_histogram_->Add(problem);
}
void HistogramDeltaSerialization::UniqueInconsistencyDetected(
HistogramBase::Inconsistency problem) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
inconsistencies_unique_histogram_->Add(problem);
}
void HistogramDeltaSerialization::InconsistencyDetectedInLoggedCount(
int amount) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+
inconsistent_snapshot_histogram_->Add(std::abs(amount));
}
« no previous file with comments | « base/metrics/histogram_delta_serialization.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698