| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // InternalComponentsFactory exists so that tests can override creation of | 5 // InternalComponentsFactory exists so that tests can override creation of |
| 6 // components used by the SyncManager that are not exposed across the sync | 6 // components used by the SyncManager that are not exposed across the sync |
| 7 // API boundary. | 7 // API boundary. |
| 8 | 8 |
| 9 #ifndef COMPONENTS_SYNC_CORE_INTERNAL_COMPONENTS_FACTORY_H_ | 9 #ifndef COMPONENTS_SYNC_CORE_INTERNAL_COMPONENTS_FACTORY_H_ |
| 10 #define COMPONENTS_SYNC_CORE_INTERNAL_COMPONENTS_FACTORY_H_ | 10 #define COMPONENTS_SYNC_CORE_INTERNAL_COMPONENTS_FACTORY_H_ |
| 11 | 11 |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/files/file_path.h" | 16 #include "base/files/file_path.h" |
| 17 #include "components/sync/engine/model_safe_worker.h" | 17 #include "components/sync/engine/model_safe_worker.h" |
| 18 | 18 |
| 19 namespace syncer { | 19 namespace syncer { |
| 20 | 20 |
| 21 class CancelationSignal; | 21 class CancelationSignal; |
| 22 class DebugInfoGetter; |
| 22 class ExtensionsActivity; | 23 class ExtensionsActivity; |
| 23 class ModelTypeRegistry; | 24 class ModelTypeRegistry; |
| 24 class ServerConnectionManager; | 25 class ServerConnectionManager; |
| 26 class SyncCycleContext; |
| 25 class SyncEngineEventListener; | 27 class SyncEngineEventListener; |
| 26 class SyncScheduler; | 28 class SyncScheduler; |
| 27 | 29 |
| 28 namespace sessions { | |
| 29 class DebugInfoGetter; | |
| 30 class SyncSessionContext; | |
| 31 } | |
| 32 | |
| 33 namespace syncable { | 30 namespace syncable { |
| 34 class Directory; | 31 class Directory; |
| 35 class DirectoryBackingStore; | 32 class DirectoryBackingStore; |
| 36 } | 33 } |
| 37 | 34 |
| 38 class InternalComponentsFactory { | 35 class InternalComponentsFactory { |
| 39 public: | 36 public: |
| 40 enum EncryptionMethod { | 37 enum EncryptionMethod { |
| 41 ENCRYPTION_LEGACY, | 38 ENCRYPTION_LEGACY, |
| 42 // Option to enable support for keystore key based encryption. | 39 // Option to enable support for keystore key based encryption. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // on disk store. | 78 // on disk store. |
| 82 STORAGE_ON_DISK, | 79 STORAGE_ON_DISK, |
| 83 // Use this to test the case where a directory fails to load. | 80 // Use this to test the case where a directory fails to load. |
| 84 STORAGE_INVALID | 81 STORAGE_INVALID |
| 85 }; | 82 }; |
| 86 | 83 |
| 87 virtual ~InternalComponentsFactory() {} | 84 virtual ~InternalComponentsFactory() {} |
| 88 | 85 |
| 89 virtual std::unique_ptr<SyncScheduler> BuildScheduler( | 86 virtual std::unique_ptr<SyncScheduler> BuildScheduler( |
| 90 const std::string& name, | 87 const std::string& name, |
| 91 sessions::SyncSessionContext* context, | 88 SyncCycleContext* context, |
| 92 CancelationSignal* cancelation_signal) = 0; | 89 CancelationSignal* cancelation_signal) = 0; |
| 93 | 90 |
| 94 virtual std::unique_ptr<sessions::SyncSessionContext> BuildContext( | 91 virtual std::unique_ptr<SyncCycleContext> BuildContext( |
| 95 ServerConnectionManager* connection_manager, | 92 ServerConnectionManager* connection_manager, |
| 96 syncable::Directory* directory, | 93 syncable::Directory* directory, |
| 97 ExtensionsActivity* extensions_activity, | 94 ExtensionsActivity* extensions_activity, |
| 98 const std::vector<SyncEngineEventListener*>& listeners, | 95 const std::vector<SyncEngineEventListener*>& listeners, |
| 99 sessions::DebugInfoGetter* debug_info_getter, | 96 DebugInfoGetter* debug_info_getter, |
| 100 ModelTypeRegistry* model_type_registry, | 97 ModelTypeRegistry* model_type_registry, |
| 101 const std::string& invalidator_client_id) = 0; | 98 const std::string& invalidator_client_id) = 0; |
| 102 | 99 |
| 103 virtual std::unique_ptr<syncable::DirectoryBackingStore> | 100 virtual std::unique_ptr<syncable::DirectoryBackingStore> |
| 104 BuildDirectoryBackingStore(StorageOption storage, | 101 BuildDirectoryBackingStore(StorageOption storage, |
| 105 const std::string& dir_name, | 102 const std::string& dir_name, |
| 106 const base::FilePath& backing_filepath) = 0; | 103 const base::FilePath& backing_filepath) = 0; |
| 107 | 104 |
| 108 // Returns the Switches struct that this object is using as configuration, if | 105 // Returns the Switches struct that this object is using as configuration, if |
| 109 // the implementation is making use of one. | 106 // the implementation is making use of one. |
| 110 virtual Switches GetSwitches() const = 0; | 107 virtual Switches GetSwitches() const = 0; |
| 111 }; | 108 }; |
| 112 | 109 |
| 113 } // namespace syncer | 110 } // namespace syncer |
| 114 | 111 |
| 115 #endif // COMPONENTS_SYNC_CORE_INTERNAL_COMPONENTS_FACTORY_H_ | 112 #endif // COMPONENTS_SYNC_CORE_INTERNAL_COMPONENTS_FACTORY_H_ |
| OLD | NEW |