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 SYNC_INTERNAL_API_PUBLIC_ENGINE_PASSIVE_MODEL_WORKER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ENGINE_PASSIVE_MODEL_WORKER_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_ENGINE_PASSIVE_MODEL_WORKER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_ENGINE_PASSIVE_MODEL_WORKER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "sync/base/sync_export.h" |
10 #include "sync/internal_api/public/engine/model_safe_worker.h" | 11 #include "sync/internal_api/public/engine/model_safe_worker.h" |
11 #include "sync/internal_api/public/util/syncer_error.h" | 12 #include "sync/internal_api/public/util/syncer_error.h" |
12 | 13 |
13 class MessageLoop; | 14 class MessageLoop; |
14 | 15 |
15 namespace syncer { | 16 namespace syncer { |
16 | 17 |
17 // Implementation of ModelSafeWorker for passive types. All work is | 18 // Implementation of ModelSafeWorker for passive types. All work is |
18 // done on the same thread DoWorkAndWaitUntilDone (i.e., the sync | 19 // done on the same thread DoWorkAndWaitUntilDone (i.e., the sync |
19 // thread). | 20 // thread). |
20 class PassiveModelWorker : public ModelSafeWorker { | 21 class SYNC_EXPORT PassiveModelWorker : public ModelSafeWorker { |
21 public: | 22 public: |
22 explicit PassiveModelWorker(const MessageLoop* sync_loop); | 23 explicit PassiveModelWorker(const MessageLoop* sync_loop); |
23 | 24 |
24 // ModelSafeWorker implementation. Called on the sync thread. | 25 // ModelSafeWorker implementation. Called on the sync thread. |
25 virtual SyncerError DoWorkAndWaitUntilDone( | 26 virtual SyncerError DoWorkAndWaitUntilDone( |
26 const WorkCallback& work) OVERRIDE; | 27 const WorkCallback& work) OVERRIDE; |
27 virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE; | 28 virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE; |
28 | 29 |
29 private: | 30 private: |
30 virtual ~PassiveModelWorker(); | 31 virtual ~PassiveModelWorker(); |
31 | 32 |
32 const MessageLoop* const sync_loop_; | 33 const MessageLoop* const sync_loop_; |
33 | 34 |
34 DISALLOW_COPY_AND_ASSIGN(PassiveModelWorker); | 35 DISALLOW_COPY_AND_ASSIGN(PassiveModelWorker); |
35 }; | 36 }; |
36 | 37 |
37 } // namespace syncer | 38 } // namespace syncer |
38 | 39 |
39 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_PASSIVE_MODEL_WORKER_H_ | 40 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_PASSIVE_MODEL_WORKER_H_ |
OLD | NEW |