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

Unified Diff: components/sync/engine/sequenced_model_worker.h

Issue 2942773002: Task Scheduler API migration: change BrowserThreadModelWorker to SequencedModelWorker (Closed)
Patch Set: Updated more comments to reflect thread -> sequence migration. Created 3 years, 6 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 | « components/sync/engine/passive_model_worker.cc ('k') | components/sync/engine/sequenced_model_worker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine/sequenced_model_worker.h
diff --git a/components/sync/engine/sequenced_model_worker.h b/components/sync/engine/sequenced_model_worker.h
new file mode 100644
index 0000000000000000000000000000000000000000..7da1b7876e03b6f8c3250d7562c0909caf771b32
--- /dev/null
+++ b/components/sync/engine/sequenced_model_worker.h
@@ -0,0 +1,40 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SYNC_ENGINE_SEQUENCED_MODEL_WORKER_H_
+#define COMPONENTS_SYNC_ENGINE_SEQUENCED_MODEL_WORKER_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/sequenced_task_runner.h"
+#include "components/sync/engine/model_safe_worker.h"
+
+namespace syncer {
+
+// A ModelSafeWorker for models that accept requests from the
+// syncapi that need to be fulfilled on a model specific sequenced task runner.
+// TODO(sync): Try to generalize other ModelWorkers (e.g. history, etc).
+class SequencedModelWorker : public ModelSafeWorker {
+ public:
+ SequencedModelWorker(const scoped_refptr<base::SequencedTaskRunner>& runner,
+ ModelSafeGroup group);
+
+ // ModelSafeWorker implementation.
+ ModelSafeGroup GetModelSafeGroup() override;
+ bool IsOnModelSequence() override;
+
+ private:
+ ~SequencedModelWorker() override;
+
+ void ScheduleWork(base::OnceClosure work) override;
+
+ scoped_refptr<base::SequencedTaskRunner> runner_;
+ ModelSafeGroup group_;
+
+ DISALLOW_COPY_AND_ASSIGN(SequencedModelWorker);
+};
+
+} // namespace syncer
+
+#endif // COMPONENTS_SYNC_ENGINE_SEQUENCED_MODEL_WORKER_H_
« no previous file with comments | « components/sync/engine/passive_model_worker.cc ('k') | components/sync/engine/sequenced_model_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698