| 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 #ifndef COMPONENTS_SYNC_ENGINE_PASSIVE_MODEL_WORKER_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_PASSIVE_MODEL_WORKER_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_PASSIVE_MODEL_WORKER_H_ | 6 #define COMPONENTS_SYNC_ENGINE_PASSIVE_MODEL_WORKER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/sync/base/syncer_error.h" | 9 #include "components/sync/base/syncer_error.h" |
| 10 #include "components/sync/engine/model_safe_worker.h" | 10 #include "components/sync/engine/model_safe_worker.h" |
| 11 | 11 |
| 12 namespace syncer { | 12 namespace syncer { |
| 13 | 13 |
| 14 // Implementation of ModelSafeWorker for passive types. All work is | 14 // Implementation of ModelSafeWorker for passive types. All work is |
| 15 // done on the same thread DoWorkAndWaitUntilDone (i.e., the sync | 15 // done on the same thread DoWorkAndWaitUntilDone (i.e., the sync |
| 16 // thread). | 16 // thread). |
| 17 class PassiveModelWorker : public ModelSafeWorker { | 17 class PassiveModelWorker : public ModelSafeWorker { |
| 18 public: | 18 public: |
| 19 PassiveModelWorker(); | 19 PassiveModelWorker(); |
| 20 | 20 |
| 21 // ModelSafeWorker implementation. Called on the sync thread. | 21 // ModelSafeWorker implementation. |
| 22 ModelSafeGroup GetModelSafeGroup() override; | 22 ModelSafeGroup GetModelSafeGroup() override; |
| 23 bool IsOnModelThread() override; |
| 23 | 24 |
| 24 protected: | 25 protected: |
| 25 SyncerError DoWorkAndWaitUntilDoneImpl(const WorkCallback& work) override; | 26 SyncerError DoWorkAndWaitUntilDoneImpl(const WorkCallback& work) override; |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 ~PassiveModelWorker() override; | 29 ~PassiveModelWorker() override; |
| 29 | 30 |
| 30 DISALLOW_COPY_AND_ASSIGN(PassiveModelWorker); | 31 DISALLOW_COPY_AND_ASSIGN(PassiveModelWorker); |
| 31 }; | 32 }; |
| 32 | 33 |
| 33 } // namespace syncer | 34 } // namespace syncer |
| 34 | 35 |
| 35 #endif // COMPONENTS_SYNC_ENGINE_PASSIVE_MODEL_WORKER_H_ | 36 #endif // COMPONENTS_SYNC_ENGINE_PASSIVE_MODEL_WORKER_H_ |
| OLD | NEW |