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

Unified Diff: components/sync/test/engine/fake_model_worker.cc

Issue 2489433002: [Sync] Move thread checking into the ModelSafeWorker interface. (Closed)
Patch Set: Improve/add comments. Created 4 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
Index: components/sync/test/engine/fake_model_worker.cc
diff --git a/components/sync/test/engine/fake_model_worker.cc b/components/sync/test/engine/fake_model_worker.cc
index 418882631e9e53d4c613c03393c506214f5debc9..c696005097602c6f52fb85739328138701729aca 100644
--- a/components/sync/test/engine/fake_model_worker.cc
+++ b/components/sync/test/engine/fake_model_worker.cc
@@ -15,19 +15,23 @@ FakeModelWorker::~FakeModelWorker() {
// multi-threaded test; since ModelSafeWorkers are
// RefCountedThreadSafe, they could theoretically be destroyed from
// a different thread.
- DCHECK(CalledOnValidThread());
+ DCHECK(thread_checker_.CalledOnValidThread());
}
SyncerError FakeModelWorker::DoWorkAndWaitUntilDoneImpl(
const WorkCallback& work) {
- DCHECK(CalledOnValidThread());
+ DCHECK(thread_checker_.CalledOnValidThread());
// Simply do the work on the current thread.
return work.Run();
}
ModelSafeGroup FakeModelWorker::GetModelSafeGroup() {
- DCHECK(CalledOnValidThread());
+ DCHECK(thread_checker_.CalledOnValidThread());
return group_;
}
+bool FakeModelWorker::IsOnModelThread() {
+ return thread_checker_.CalledOnValidThread();
+}
+
} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698