diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-19 06:28:16 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-02-19 06:28:16 +0000 |
commit | 5a435fc99e878db224525562313c825c8f32b303 (patch) | |
tree | 241ba458d239f47d7363ee0a73b9c88af6db17d4 /sync/sessions | |
parent | 4783dd68c414da5058c61a8f56c4988e0e5df9ef (diff) | |
download | chromium_src-5a435fc99e878db224525562313c825c8f32b303.zip chromium_src-5a435fc99e878db224525562313c825c8f32b303.tar.gz chromium_src-5a435fc99e878db224525562313c825c8f32b303.tar.bz2 |
sync: Add interfaces for per-type sync
Puts the DirectoryCommitContributor and DirectoryUpdateHandler
classes behind interfaces. These classes were always intended
to form the basis of an abstract interface. Now we can start
to introduce alternate implementations of them.
This CL includes one such alternate implementation. It adds
the MockUpdateHandler and uses it to remove some unnecessary
boilerplate from the download unit tests.
This CL also resolves an old TODO. It renames the SyncDirectory*
classes to Directory*, since the 'Sync' part of the name is redundant.
This should have no effect on program behavior.
BUG=278484
Review URL: https://codereview.chromium.org/161253002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251969 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/sessions')
-rw-r--r-- | sync/sessions/model_type_registry.cc | 12 | ||||
-rw-r--r-- | sync/sessions/model_type_registry.h | 9 |
2 files changed, 10 insertions, 11 deletions
diff --git a/sync/sessions/model_type_registry.cc b/sync/sessions/model_type_registry.cc index cb689cf..7035755 100644 --- a/sync/sessions/model_type_registry.cc +++ b/sync/sessions/model_type_registry.cc @@ -4,8 +4,8 @@ #include "sync/sessions/model_type_registry.h" -#include "sync/engine/sync_directory_commit_contributor.h" -#include "sync/engine/sync_directory_update_handler.h" +#include "sync/engine/directory_commit_contributor.h" +#include "sync/engine/directory_update_handler.h" namespace syncer { @@ -39,10 +39,10 @@ void ModelTypeRegistry::SetEnabledDirectoryTypes( DCHECK(worker_it != workers_map_.end()); scoped_refptr<ModelSafeWorker> worker = worker_it->second; - SyncDirectoryCommitContributor* committer = - new SyncDirectoryCommitContributor(directory_, type); - SyncDirectoryUpdateHandler* updater = - new SyncDirectoryUpdateHandler(directory_, type, worker); + DirectoryCommitContributor* committer = + new DirectoryCommitContributor(directory_, type); + DirectoryUpdateHandler* updater = + new DirectoryUpdateHandler(directory_, type, worker); bool inserted1 = update_handler_map_.insert(std::make_pair(type, updater)).second; diff --git a/sync/sessions/model_type_registry.h b/sync/sessions/model_type_registry.h index 126d05b..ad34ada 100644 --- a/sync/sessions/model_type_registry.h +++ b/sync/sessions/model_type_registry.h @@ -20,12 +20,11 @@ namespace syncable { class Directory; } // namespace syncable -class SyncDirectoryUpdateHandler; -class SyncDirectoryCommitContributor; +class UpdateHandler; +class CommitContributor; -typedef std::map<ModelType, SyncDirectoryUpdateHandler*> UpdateHandlerMap; -typedef std::map<ModelType, SyncDirectoryCommitContributor*> - CommitContributorMap; +typedef std::map<ModelType, UpdateHandler*> UpdateHandlerMap; +typedef std::map<ModelType, CommitContributor*> CommitContributorMap; // Keeps track of the sets of active update handlers and commit contributors. class SYNC_EXPORT_PRIVATE ModelTypeRegistry { |