diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 02:51:36 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-04 02:51:36 +0000 |
commit | a95754871e9e86ee503c46d12e8704c02f6c6e35 (patch) | |
tree | 92be09176ae15cd5e02595e3586db4f4d2026499 /sync/internal_api/sync_manager_impl_unittest.cc | |
parent | 01e117df184677e024d7f4f17fee7fdfeb1e4053 (diff) | |
download | chromium_src-a95754871e9e86ee503c46d12e8704c02f6c6e35.zip chromium_src-a95754871e9e86ee503c46d12e8704c02f6c6e35.tar.gz chromium_src-a95754871e9e86ee503c46d12e8704c02f6c6e35.tar.bz2 |
sync: Per-type update application
This change moves the update application functionality from the
ApplyUpdatesAndResolveConflictsCommand into the
SyncDirectoryUpdateHandler class. This change will allow us to
implement update application differently for different types.
Because update application happens on the model threads, the
ApplyUpdatesAndResolveConflictsCommand had to be aware of
ModelSafeRoutingInfo, ModelSafeWorkers, and other concepts intended to
hide threading details. The new code takes a different approach. It
hides the threading details specific to each type inside its
SyncDirectoryUpateHandler by initializing it with a scoped_refptr to its
associated ModelSafeWorker.
The ApplyUpdatesAndResolveConflictsCommand was the last SyncerCommand.
With its removal, we can also remove the definitions of SyncerCommand,
ModelChangingSyncerCommand and SyncerCommandTest.
BUG=278484
Review URL: https://codereview.chromium.org/72403003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238532 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/sync_manager_impl_unittest.cc')
-rw-r--r-- | sync/internal_api/sync_manager_impl_unittest.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sync/internal_api/sync_manager_impl_unittest.cc b/sync/internal_api/sync_manager_impl_unittest.cc index 2a1129b..91be3b8 100644 --- a/sync/internal_api/sync_manager_impl_unittest.cc +++ b/sync/internal_api/sync_manager_impl_unittest.cc @@ -66,6 +66,7 @@ #include "sync/syncable/syncable_util.h" #include "sync/syncable/syncable_write_transaction.h" #include "sync/test/callback_counter.h" +#include "sync/test/engine/fake_model_worker.h" #include "sync/test/engine/fake_sync_scheduler.h" #include "sync/test/engine/test_id_factory.h" #include "sync/test/fake_encryptor.h" @@ -816,6 +817,12 @@ class SyncManagerTest : public testing::Test, ModelSafeRoutingInfo routing_info; GetModelSafeRoutingInfo(&routing_info); + // This works only because all routing info types are GROUP_PASSIVE. + // If we had types in other groups, we would need additional workers + // to support them. + scoped_refptr<ModelSafeWorker> worker = new FakeModelWorker(GROUP_PASSIVE); + workers.push_back(worker.get()); + // Takes ownership of |fake_invalidator_|. sync_manager_.Init( temp_dir_.path(), |