diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-13 02:02:52 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-13 02:02:52 +0000 |
commit | 3e5f5e7bc74e3323be62cd2750a051dfd9d24b46 (patch) | |
tree | 3c3afa71929ede2107b17ac4965024afda9fa180 /sync/internal_api | |
parent | 51075f8c766f1905937845f0557342dc1da57e1f (diff) | |
download | chromium_src-3e5f5e7bc74e3323be62cd2750a051dfd9d24b46.zip chromium_src-3e5f5e7bc74e3323be62cd2750a051dfd9d24b46.tar.gz chromium_src-3e5f5e7bc74e3323be62cd2750a051dfd9d24b46.tar.bz2 |
Revert 167280 - [Sync] Add application logic for non-nigori control types.
We introduce logic to apply non-nigori control types. First, we iterate over
any new top level datatype entities, applying those. Then we go through the
rest of the unapplied control datatype updates, applying those. Any conflict
should be just a simple conflict, which we handle by ignoring the local
changes.
Also updates chromiumsync.py to support the new control types (and fixes
the parent folder pattern that was in use).
BUG=122825
Review URL: https://chromiumcodereview.appspot.com/11271009
TBR=zea@chromium.org
Review URL: https://codereview.chromium.org/11359175
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167282 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api')
-rw-r--r-- | sync/internal_api/public/test/test_entry_factory.h | 2 | ||||
-rw-r--r-- | sync/internal_api/test/test_entry_factory.cc | 14 |
2 files changed, 7 insertions, 9 deletions
diff --git a/sync/internal_api/public/test/test_entry_factory.h b/sync/internal_api/public/test/test_entry_factory.h index d5bc911..1661a33 100644 --- a/sync/internal_api/public/test/test_entry_factory.h +++ b/sync/internal_api/public/test/test_entry_factory.h @@ -24,7 +24,7 @@ class TestEntryFactory { ~TestEntryFactory(); // Create a new unapplied folder node with a parent. - int64 CreateUnappliedNewItemWithParent( + void CreateUnappliedNewItemWithParent( const std::string& item_id, const sync_pb::EntitySpecifics& specifics, const std::string& parent_id); diff --git a/sync/internal_api/test/test_entry_factory.cc b/sync/internal_api/test/test_entry_factory.cc index 3cf0dcf..3fa0d67 100644 --- a/sync/internal_api/test/test_entry_factory.cc +++ b/sync/internal_api/test/test_entry_factory.cc @@ -27,7 +27,7 @@ TestEntryFactory::TestEntryFactory(syncable::Directory *dir) TestEntryFactory::~TestEntryFactory() { } -int64 TestEntryFactory::CreateUnappliedNewItemWithParent( +void TestEntryFactory::CreateUnappliedNewItemWithParent( const string& item_id, const sync_pb::EntitySpecifics& specifics, const string& parent_id) { @@ -42,7 +42,6 @@ int64 TestEntryFactory::CreateUnappliedNewItemWithParent( entry.Put(syncable::SERVER_PARENT_ID, Id::CreateFromServerId(parent_id)); entry.Put(syncable::SERVER_IS_DIR, true); entry.Put(syncable::SERVER_SPECIFICS, specifics); - return entry.Get(syncable::META_HANDLE); } int64 TestEntryFactory::CreateUnappliedNewItem( @@ -57,12 +56,10 @@ int64 TestEntryFactory::CreateUnappliedNewItem( entry.Put(syncable::IS_UNAPPLIED_UPDATE, true); entry.Put(syncable::SERVER_NON_UNIQUE_NAME, item_id); entry.Put(syncable::SERVER_PARENT_ID, syncable::GetNullId()); - entry.Put(syncable::SERVER_IS_DIR, is_unique); + entry.Put(syncable::SERVER_IS_DIR, false); entry.Put(syncable::SERVER_SPECIFICS, specifics); - if (is_unique) { // For top-level nodes. - entry.Put(syncable::UNIQUE_SERVER_TAG, - ModelTypeToRootTag(GetModelTypeFromSpecifics(specifics))); - } + if (is_unique) // For top-level nodes. + entry.Put(syncable::UNIQUE_SERVER_TAG, item_id); return entry.Get(syncable::META_HANDLE); } @@ -122,7 +119,8 @@ int64 TestEntryFactory::CreateUnappliedAndUnsyncedItem( } int64 TestEntryFactory::CreateSyncedItem( - const std::string& name, ModelType model_type, bool is_folder) { + const std::string& name, ModelType + model_type, bool is_folder) { WriteTransaction trans(FROM_HERE, UNITTEST, directory_); syncable::Id parent_id(TestIdFactory::root()); |