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