summaryrefslogtreecommitdiffstats
path: root/sync/engine/syncer.h
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-17 23:21:59 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-17 23:21:59 +0000
commit2fdf6199cda564079bf743bf98e6c7b8205fc9c4 (patch)
tree26cb5feaaf3800771b98355450d0a1e37bb0753c /sync/engine/syncer.h
parent0e416c45ad5b75728e696b73651f444135c9748f (diff)
downloadchromium_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/engine/syncer.h')
-rw-r--r--sync/engine/syncer.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/sync/engine/syncer.h b/sync/engine/syncer.h
index 225b4e3..51c66aa 100644
--- a/sync/engine/syncer.h
+++ b/sync/engine/syncer.h
@@ -22,6 +22,8 @@
namespace syncer {
class CancelationSignal;
+class CommitProcessor;
+class GetUpdatesProcessor;
// A Syncer provides a control interface for driving the sync cycle. These
// cycles consist of downloading updates, parsing the response (aka. process
@@ -69,10 +71,12 @@ class SYNC_EXPORT_PRIVATE Syncer {
sessions::SyncSession* session);
private:
- void ApplyUpdates(sessions::SyncSession* session);
+ void ApplyUpdates(sessions::SyncSession* session,
+ GetUpdatesProcessor* get_updates_processor);
bool DownloadAndApplyUpdates(
ModelTypeSet request_types,
sessions::SyncSession* session,
+ GetUpdatesProcessor* get_updates_processor,
base::Callback<void(sync_pb::ClientToServerMessage*)> build_fn);
// This function will commit batches of unsynced items to the server until the
@@ -81,7 +85,8 @@ class SYNC_EXPORT_PRIVATE Syncer {
// abort any blocking operations.
SyncerError BuildAndPostCommits(
ModelTypeSet request_types,
- sessions::SyncSession* session);
+ sessions::SyncSession* session,
+ CommitProcessor* commit_processor);
void HandleCycleBegin(sessions::SyncSession* session);
bool HandleCycleEnd(