| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ |
| 6 #define CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ | 6 #define CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "chrome/browser/sync/engine/model_safe_worker.h" | 13 #include "chrome/browser/sync/engine/model_safe_worker.h" |
| 13 #include "chrome/browser/sync/syncable/model_type.h" | 14 #include "chrome/browser/sync/syncable/model_type.h" |
| 14 | 15 |
| 15 namespace browser_sync { | 16 namespace browser_sync { |
| 16 | 17 |
| 17 class MockUIModelWorker : public ModelSafeWorker { | 18 class MockUIModelWorker : public ModelSafeWorker { |
| 18 public: | 19 public: |
| 19 virtual ModelSafeGroup GetModelSafeGroup(); | 20 virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE; |
| 20 }; | 21 }; |
| 21 | 22 |
| 22 class MockDBModelWorker : public ModelSafeWorker { | 23 class MockDBModelWorker : public ModelSafeWorker { |
| 23 public: | 24 public: |
| 24 virtual ModelSafeGroup GetModelSafeGroup(); | 25 virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE; |
| 25 }; | 26 }; |
| 26 | 27 |
| 27 class MockFileModelWorker : public ModelSafeWorker { | 28 class MockFileModelWorker : public ModelSafeWorker { |
| 28 public: | 29 public: |
| 29 virtual ModelSafeGroup GetModelSafeGroup(); | 30 virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE; |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 class MockModelSafeWorkerRegistrar : public ModelSafeWorkerRegistrar { | 33 class MockModelSafeWorkerRegistrar : public ModelSafeWorkerRegistrar { |
| 33 public: | 34 public: |
| 34 virtual ~MockModelSafeWorkerRegistrar(); | 35 virtual ~MockModelSafeWorkerRegistrar(); |
| 35 static MockModelSafeWorkerRegistrar* PassiveBookmarks(); | 36 static MockModelSafeWorkerRegistrar* PassiveBookmarks(); |
| 36 static MockModelSafeWorkerRegistrar* PassiveForTypes( | 37 static MockModelSafeWorkerRegistrar* PassiveForTypes( |
| 37 const syncable::ModelTypeBitSet& set); | 38 const syncable::ModelTypeBitSet& set); |
| 38 virtual void GetWorkers(std::vector<ModelSafeWorker*>* out); | 39 virtual void GetWorkers(std::vector<ModelSafeWorker*>* out) OVERRIDE; |
| 39 virtual void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out); | 40 virtual void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) OVERRIDE; |
| 40 | 41 |
| 41 private: | 42 private: |
| 42 explicit MockModelSafeWorkerRegistrar(const ModelSafeRoutingInfo& routes); | 43 explicit MockModelSafeWorkerRegistrar(const ModelSafeRoutingInfo& routes); |
| 43 | 44 |
| 44 scoped_refptr<ModelSafeWorker> passive_worker_; | 45 scoped_refptr<ModelSafeWorker> passive_worker_; |
| 45 ModelSafeRoutingInfo routes_; | 46 ModelSafeRoutingInfo routes_; |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 } // namespace browser_sync | 49 } // namespace browser_sync |
| 49 | 50 |
| 50 #endif // CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ | 51 #endif // CHROME_BROWSER_SYNC_ENGINE_MOCK_MODEL_SAFE_WORKERS_H_ |
| 51 | 52 |
| OLD | NEW |