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