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

Unified Diff: components/history/core/browser/history_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/history/core/browser/history_model_worker.cc
diff --git a/components/history/core/browser/history_model_worker.cc b/components/history/core/browser/history_model_worker.cc
index 54828f28340223698cc011a0904b690cd52d395c..72b843dc9ffc765938f73116d1f5a49c1f27f4cd 100644
--- a/components/history/core/browser/history_model_worker.cc
+++ b/components/history/core/browser/history_model_worker.cc
@@ -124,6 +124,13 @@ syncer::ModelSafeGroup HistoryModelWorker::GetModelSafeGroup() {
return syncer::GROUP_HISTORY;
}
+bool HistoryModelWorker::IsOnModelThread() {
+ // Ideally HistoryService would expose a way to check whether this is the
+ // history DB thread. Since it doesn't, just return true to bypass a CHECK in
sky 2016/11/08 23:06:50 You actually could add such a check, but there is
+ // the sync code.
+ return true;
+}
+
HistoryModelWorker::~HistoryModelWorker() {
// The base::CancelableTaskTracker class is not thread-safe and must only be
// used from a single thread but the current object may not be destroyed from

Powered by Google App Engine
This is Rietveld 408576698