diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-17 23:21:59 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-17 23:21:59 +0000 |
commit | 2fdf6199cda564079bf743bf98e6c7b8205fc9c4 (patch) | |
tree | 26cb5feaaf3800771b98355450d0a1e37bb0753c /sync/internal_api/public | |
parent | 0e416c45ad5b75728e696b73651f444135c9748f (diff) | |
download | chromium_src-2fdf6199cda564079bf743bf98e6c7b8205fc9c4.zip chromium_src-2fdf6199cda564079bf743bf98e6c7b8205fc9c4.tar.gz chromium_src-2fdf6199cda564079bf743bf98e6c7b8205fc9c4.tar.bz2 |
sync: Introduce ModelTypeRegistry and helpers
Introduce the ModelTypeRegistry class and use it to manage the creation
of UpdateHandlers and CommitContributors. The ModelTypeRegistry also
gets some help from the newly introduced UpdaterList and CommitterList
classes.
This lets us move the verbose iteration logic out of the code that's
focused on building and executing commits and updates, which should make
those functions easier to read. It gives us more freedom to experiment
with other ways to manage the lists of commit contributors and update
handlers, should we choose to do so. It prevents us from leaking the
set of enabled types through the per-type maps.
This patch is one of the last in the stack related to building a
per-type abstraction into the sync engine, and also one of the first
steps towards implementing run-time enable and disable logic for the
new-style sync types.
BUG=278484
Review URL: https://codereview.chromium.org/93433006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245654 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/public')
3 files changed, 5 insertions, 4 deletions
diff --git a/sync/internal_api/public/internal_components_factory.h b/sync/internal_api/public/internal_components_factory.h index ada376a..72ed94a 100644 --- a/sync/internal_api/public/internal_components_factory.h +++ b/sync/internal_api/public/internal_components_factory.h @@ -18,10 +18,11 @@ namespace syncer { +class CancelationSignal; class ExtensionsActivity; +class ModelTypeRegistry; class ServerConnectionManager; class SyncEngineEventListener; -class CancelationSignal; class SyncScheduler; class TrafficRecorder; @@ -82,11 +83,11 @@ class SYNC_EXPORT InternalComponentsFactory { virtual scoped_ptr<sessions::SyncSessionContext> BuildContext( ServerConnectionManager* connection_manager, syncable::Directory* directory, - const std::vector<scoped_refptr<ModelSafeWorker> >& workers, ExtensionsActivity* extensions_activity, const std::vector<SyncEngineEventListener*>& listeners, sessions::DebugInfoGetter* debug_info_getter, TrafficRecorder* traffic_recorder, + ModelTypeRegistry* model_type_registry, const std::string& invalidator_client_id) = 0; virtual scoped_ptr<syncable::DirectoryBackingStore> diff --git a/sync/internal_api/public/internal_components_factory_impl.h b/sync/internal_api/public/internal_components_factory_impl.h index 128383e..b6a3b2fc 100644 --- a/sync/internal_api/public/internal_components_factory_impl.h +++ b/sync/internal_api/public/internal_components_factory_impl.h @@ -27,11 +27,11 @@ class SYNC_EXPORT InternalComponentsFactoryImpl virtual scoped_ptr<sessions::SyncSessionContext> BuildContext( ServerConnectionManager* connection_manager, syncable::Directory* directory, - const std::vector<scoped_refptr<ModelSafeWorker> >& workers, ExtensionsActivity* extensions_activity, const std::vector<SyncEngineEventListener*>& listeners, sessions::DebugInfoGetter* debug_info_getter, TrafficRecorder* traffic_recorder, + ModelTypeRegistry* model_type_registry, const std::string& invalidator_client_id) OVERRIDE; virtual scoped_ptr<syncable::DirectoryBackingStore> diff --git a/sync/internal_api/public/test/test_internal_components_factory.h b/sync/internal_api/public/test/test_internal_components_factory.h index c68218b7..8730f50 100644 --- a/sync/internal_api/public/test/test_internal_components_factory.h +++ b/sync/internal_api/public/test/test_internal_components_factory.h @@ -33,11 +33,11 @@ class TestInternalComponentsFactory : public InternalComponentsFactory { virtual scoped_ptr<sessions::SyncSessionContext> BuildContext( ServerConnectionManager* connection_manager, syncable::Directory* directory, - const std::vector<scoped_refptr<ModelSafeWorker> >& workers, ExtensionsActivity* monitor, const std::vector<SyncEngineEventListener*>& listeners, sessions::DebugInfoGetter* debug_info_getter, TrafficRecorder* traffic_recorder, + ModelTypeRegistry* model_type_registry, const std::string& invalidator_client_id) OVERRIDE; virtual scoped_ptr<syncable::DirectoryBackingStore> |