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