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

Side by Side Diff: components/sync/engine/ui_model_worker.cc

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 #include "components/sync/engine/ui_model_worker.h" 5 #include "components/sync/engine/ui_model_worker.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 namespace syncer { 9 namespace syncer {
10 10
11 UIModelWorker::UIModelWorker( 11 UIModelWorker::UIModelWorker(
12 scoped_refptr<base::SingleThreadTaskRunner> ui_thread) 12 scoped_refptr<base::SingleThreadTaskRunner> ui_thread)
13 : ui_thread_(std::move(ui_thread)) {} 13 : ui_thread_(std::move(ui_thread)) {}
14 14
15 ModelSafeGroup UIModelWorker::GetModelSafeGroup() { 15 ModelSafeGroup UIModelWorker::GetModelSafeGroup() {
16 return GROUP_UI; 16 return GROUP_UI;
17 } 17 }
18 18
19 bool UIModelWorker::IsOnModelThread() { 19 bool UIModelWorker::IsOnModelSequence() {
20 return ui_thread_->BelongsToCurrentThread(); 20 return ui_thread_->BelongsToCurrentThread();
21 } 21 }
22 22
23 UIModelWorker::~UIModelWorker() {} 23 UIModelWorker::~UIModelWorker() {}
24 24
25 void UIModelWorker::ScheduleWork(base::OnceClosure work) { 25 void UIModelWorker::ScheduleWork(base::OnceClosure work) {
26 ui_thread_->PostTask(FROM_HERE, std::move(work)); 26 ui_thread_->PostTask(FROM_HERE, std::move(work));
27 } 27 }
28 28
29 } // namespace syncer 29 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/engine/ui_model_worker.h ('k') | components/sync/test/engine/fake_model_worker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698