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_TEST_ENGINE_FAKE_MODEL_WORKER_H_ | 5 #ifndef SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_ |
6 #define SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_ | 6 #define SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/threading/non_thread_safe.h" | 12 #include "base/threading/non_thread_safe.h" |
13 #include "sync/internal_api/public/engine/model_safe_worker.h" | 13 #include "sync/internal_api/public/engine/model_safe_worker.h" |
14 #include "sync/internal_api/public/util/syncer_error.h" | 14 #include "sync/internal_api/public/util/syncer_error.h" |
15 | 15 |
16 namespace syncer { | 16 namespace syncer { |
17 | 17 |
18 // Fake implementation of ModelSafeWorker that does work on the | 18 // Fake implementation of ModelSafeWorker that does work on the |
19 // current thread regardless of the group. | 19 // current thread regardless of the group. |
20 class FakeModelWorker : public ModelSafeWorker, public base::NonThreadSafe { | 20 class FakeModelWorker : public ModelSafeWorker, public base::NonThreadSafe { |
21 public: | 21 public: |
22 explicit FakeModelWorker(ModelSafeGroup group); | 22 explicit FakeModelWorker(ModelSafeGroup group); |
23 | 23 |
24 // ModelSafeWorker implementation. | 24 // ModelSafeWorker implementation. |
25 virtual SyncerError DoWorkAndWaitUntilDone( | 25 virtual void RegisterForLoopDestruction() OVERRIDE; |
| 26 virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE; |
| 27 |
| 28 protected: |
| 29 virtual SyncerError DoWorkAndWaitUntilDoneImpl( |
26 const WorkCallback& work) OVERRIDE; | 30 const WorkCallback& work) OVERRIDE; |
27 virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE; | |
28 | 31 |
29 private: | 32 private: |
30 virtual ~FakeModelWorker(); | 33 virtual ~FakeModelWorker(); |
31 | 34 |
32 const ModelSafeGroup group_; | 35 const ModelSafeGroup group_; |
33 | 36 |
34 DISALLOW_COPY_AND_ASSIGN(FakeModelWorker); | 37 DISALLOW_COPY_AND_ASSIGN(FakeModelWorker); |
35 }; | 38 }; |
36 | 39 |
37 } // namespace syncer | 40 } // namespace syncer |
38 | 41 |
39 #endif // SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_ | 42 #endif // SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_ |
40 | 43 |
OLD | NEW |