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

Side by Side Diff: components/sync/engine/ui_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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_SYNC_ENGINE_UI_MODEL_WORKER_H_ 5 #ifndef COMPONENTS_SYNC_ENGINE_UI_MODEL_WORKER_H_
6 #define COMPONENTS_SYNC_ENGINE_UI_MODEL_WORKER_H_ 6 #define COMPONENTS_SYNC_ENGINE_UI_MODEL_WORKER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
11 #include "components/sync/engine/model_safe_worker.h" 11 #include "components/sync/engine/model_safe_worker.h"
12 12
13 namespace syncer { 13 namespace syncer {
14 14
15 // A ModelSafeWorker for UI models (e.g. bookmarks) that 15 // A ModelSafeWorker for UI models (e.g. bookmarks) that
16 // accepts work requests from the syncapi that need to be fulfilled 16 // accepts work requests from the syncapi that need to be fulfilled
17 // from the MessageLoop home to the native model. 17 // from the MessageLoop home to the native model.
18 class UIModelWorker : public ModelSafeWorker { 18 class UIModelWorker : public ModelSafeWorker {
19 public: 19 public:
20 explicit UIModelWorker(scoped_refptr<base::SingleThreadTaskRunner> ui_thread); 20 explicit UIModelWorker(scoped_refptr<base::SingleThreadTaskRunner> ui_thread);
21 21
22 // ModelSafeWorker implementation. 22 // ModelSafeWorker implementation.
23 ModelSafeGroup GetModelSafeGroup() override; 23 ModelSafeGroup GetModelSafeGroup() override;
24 bool IsOnModelThread() override; 24 bool IsOnModelSequence() override;
25 25
26 private: 26 private:
27 ~UIModelWorker() override; 27 ~UIModelWorker() override;
28 28
29 void ScheduleWork(base::OnceClosure work) override; 29 void ScheduleWork(base::OnceClosure work) override;
30 30
31 // A reference to the UI thread's task runner. 31 // A reference to the UI thread's task runner.
32 const scoped_refptr<base::SingleThreadTaskRunner> ui_thread_; 32 const scoped_refptr<base::SingleThreadTaskRunner> ui_thread_;
33 33
34 DISALLOW_COPY_AND_ASSIGN(UIModelWorker); 34 DISALLOW_COPY_AND_ASSIGN(UIModelWorker);
35 }; 35 };
36 36
37 } // namespace syncer 37 } // namespace syncer
38 38
39 #endif // COMPONENTS_SYNC_ENGINE_UI_MODEL_WORKER_H_ 39 #endif // COMPONENTS_SYNC_ENGINE_UI_MODEL_WORKER_H_
OLDNEW
« no previous file with comments | « components/sync/engine/sync_backend_registrar_unittest.cc ('k') | components/sync/engine/ui_model_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698