| OLD | NEW |
| 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 |
| OLD | NEW |