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

Unified Diff: remoting/base/rate_counter.cc

Issue 2911893003: Deprecate NonThreadSafe in remoting in favor of SequenceChecker. (Closed)
Patch Set: Created 3 years, 7 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 | « remoting/base/rate_counter.h ('k') | remoting/host/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/rate_counter.cc
diff --git a/remoting/base/rate_counter.cc b/remoting/base/rate_counter.cc
index f676fc50c98c9caa73c68181d2f9cca73a4ab976..0d4acf2d5f72c37293f0760861979e88714897c0 100644
--- a/remoting/base/rate_counter.cc
+++ b/remoting/base/rate_counter.cc
@@ -13,10 +13,12 @@ RateCounter::RateCounter(base::TimeDelta time_window)
DCHECK_GT(time_window, base::TimeDelta());
}
-RateCounter::~RateCounter() {}
+RateCounter::~RateCounter() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+}
void RateCounter::Record(int64_t value) {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
base::TimeTicks now = tick_clock_->NowTicks();
EvictOldDataPoints(now);
@@ -25,7 +27,7 @@ void RateCounter::Record(int64_t value) {
}
double RateCounter::Rate() {
- DCHECK(CalledOnValidThread());
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
EvictOldDataPoints(tick_clock_->NowTicks());
return sum_ / time_window_.InSecondsF();
« no previous file with comments | « remoting/base/rate_counter.h ('k') | remoting/host/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698