Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Side by Side Diff: components/sync/driver/sync_api_component_factory.h

Issue 2533083002: [Sync] SyncEngine refactor part 1: interfaces. (Closed)
Patch Set: Rebase. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_DRIVER_SYNC_API_COMPONENT_FACTORY_H_ 5 #ifndef COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_
6 #define COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_ 6 #define COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 14 matching lines...) Expand all
25 25
26 namespace syncer { 26 namespace syncer {
27 27
28 class AssociatorInterface; 28 class AssociatorInterface;
29 class ChangeProcessor; 29 class ChangeProcessor;
30 class DataTypeDebugInfoListener; 30 class DataTypeDebugInfoListener;
31 class DataTypeEncryptionHandler; 31 class DataTypeEncryptionHandler;
32 class DataTypeManager; 32 class DataTypeManager;
33 class DataTypeManagerObserver; 33 class DataTypeManagerObserver;
34 class LocalDeviceInfoProvider; 34 class LocalDeviceInfoProvider;
35 class SyncBackendHost; 35 class SyncEngine;
36 class SyncClient; 36 class SyncClient;
37 class SyncPrefs; 37 class SyncPrefs;
38 class SyncService; 38 class SyncService;
39 class SyncableService; 39 class SyncableService;
40 struct UserShare; 40 struct UserShare;
41 41
42 // This factory provides sync driver code with the model type specific sync/api 42 // This factory provides sync driver code with the model type specific sync/api
43 // service (like SyncableService) implementations. 43 // service (like SyncableService) implementations.
44 class SyncApiComponentFactory { 44 class SyncApiComponentFactory {
45 public: 45 public:
(...skipping 25 matching lines...) Expand all
71 ChangeProcessor* change_processor; 71 ChangeProcessor* change_processor;
72 SyncComponents(AssociatorInterface* ma, ChangeProcessor* cp) 72 SyncComponents(AssociatorInterface* ma, ChangeProcessor* cp)
73 : model_associator(ma), change_processor(cp) {} 73 : model_associator(ma), change_processor(cp) {}
74 }; 74 };
75 75
76 // Creates and registers enabled datatypes with the provided SyncClient. 76 // Creates and registers enabled datatypes with the provided SyncClient.
77 virtual void RegisterDataTypes( 77 virtual void RegisterDataTypes(
78 SyncService* sync_service, 78 SyncService* sync_service,
79 const RegisterDataTypesMethod& register_platform_types_method) = 0; 79 const RegisterDataTypesMethod& register_platform_types_method) = 0;
80 80
81 // Instantiates a new DataTypeManager with a SyncBackendHost, a list of data 81 // Instantiates a new DataTypeManager with a SyncEngine, a list of data
skym 2016/12/02 20:54:54 This is kind of stating the obvious. Yes, we know
maxbogue 2016/12/02 23:59:27 Done.
82 // type controllers and a DataTypeManagerObserver. The return pointer is 82 // type controllers and a DataTypeManagerObserver. The return pointer is
83 // owned by the caller. 83 // owned by the caller.
84 virtual DataTypeManager* CreateDataTypeManager( 84 virtual DataTypeManager* CreateDataTypeManager(
85 const WeakHandle<DataTypeDebugInfoListener>& debug_info_listener, 85 const WeakHandle<DataTypeDebugInfoListener>& debug_info_listener,
86 const DataTypeController::TypeMap* controllers, 86 const DataTypeController::TypeMap* controllers,
87 const DataTypeEncryptionHandler* encryption_handler, 87 const DataTypeEncryptionHandler* encryption_handler,
88 SyncBackendHost* backend, 88 SyncEngine* engine,
89 DataTypeManagerObserver* observer) = 0; 89 DataTypeManagerObserver* observer) = 0;
90 90
91 // Creating this in the factory helps us mock it out in testing. 91 // Creating this in the factory helps us mock it out in testing.
92 virtual SyncBackendHost* CreateSyncBackendHost( 92 virtual SyncEngine* CreateSyncEngine(
93 const std::string& name, 93 const std::string& name,
94 invalidation::InvalidationService* invalidator, 94 invalidation::InvalidationService* invalidator,
95 const base::WeakPtr<SyncPrefs>& sync_prefs, 95 const base::WeakPtr<SyncPrefs>& sync_prefs,
96 const base::FilePath& sync_folder) = 0; 96 const base::FilePath& sync_folder) = 0;
97 97
98 // Creating this in the factory helps us mock it out in testing. 98 // Creating this in the factory helps us mock it out in testing.
99 virtual std::unique_ptr<LocalDeviceInfoProvider> 99 virtual std::unique_ptr<LocalDeviceInfoProvider>
100 CreateLocalDeviceInfoProvider() = 0; 100 CreateLocalDeviceInfoProvider() = 0;
101 101
102 // Legacy datatypes that need to be converted to the SyncableService API. 102 // Legacy datatypes that need to be converted to the SyncableService API.
(...skipping 16 matching lines...) Expand all
119 std::unique_ptr<AttachmentStoreForSync> attachment_store, 119 std::unique_ptr<AttachmentStoreForSync> attachment_store,
120 const UserShare& user_share, 120 const UserShare& user_share,
121 const std::string& store_birthday, 121 const std::string& store_birthday,
122 ModelType model_type, 122 ModelType model_type,
123 AttachmentService::Delegate* delegate) = 0; 123 AttachmentService::Delegate* delegate) = 0;
124 }; 124 };
125 125
126 } // namespace syncer 126 } // namespace syncer
127 127
128 #endif // COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_ 128 #endif // COMPONENTS_SYNC_DRIVER_SYNC_API_COMPONENT_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698