diff options
Diffstat (limited to 'sync/engine')
37 files changed, 276 insertions, 295 deletions
diff --git a/sync/engine/all_status.cc b/sync/engine/all_status.cc index 8d96422..8f8b649 100644 --- a/sync/engine/all_status.cc +++ b/sync/engine/all_status.cc @@ -135,12 +135,12 @@ void AllStatus::IncrementNotificationsReceived() { ++status_.notifications_received; } -void AllStatus::SetEncryptedTypes(syncable::ModelTypeSet types) { +void AllStatus::SetEncryptedTypes(syncer::ModelTypeSet types) { ScopedStatusLock lock(this); status_.encrypted_types = types; } -void AllStatus::SetThrottledTypes(const syncable::ModelTypeSet& types) { +void AllStatus::SetThrottledTypes(const syncer::ModelTypeSet& types) { ScopedStatusLock lock(this); status_.throttled_types = types; } diff --git a/sync/engine/all_status.h b/sync/engine/all_status.h index 2c50144..6807b44 100644 --- a/sync/engine/all_status.h +++ b/sync/engine/all_status.h @@ -49,9 +49,9 @@ class AllStatus : public SyncEngineEventListener { void IncrementNotificationsReceived(); - void SetThrottledTypes(const syncable::ModelTypeSet &types); + void SetThrottledTypes(const syncer::ModelTypeSet &types); - void SetEncryptedTypes(syncable::ModelTypeSet types); + void SetEncryptedTypes(syncer::ModelTypeSet types); void SetCryptographerReady(bool ready); void SetCryptoHasPendingKeys(bool has_pending_keys); diff --git a/sync/engine/apply_updates_command.cc b/sync/engine/apply_updates_command.cc index c23241c..28ad032 100644 --- a/sync/engine/apply_updates_command.cc +++ b/sync/engine/apply_updates_command.cc @@ -22,7 +22,7 @@ std::set<ModelSafeGroup> ApplyUpdatesCommand::GetGroupsToChange( const sessions::SyncSession& session) const { std::set<ModelSafeGroup> groups_with_unapplied_updates; - syncable::FullModelTypeSet server_types_with_unapplied_updates; + syncer::FullModelTypeSet server_types_with_unapplied_updates; { syncable::Directory* dir = session.context()->directory(); syncable::ReadTransaction trans(FROM_HERE, dir); @@ -30,7 +30,7 @@ std::set<ModelSafeGroup> ApplyUpdatesCommand::GetGroupsToChange( dir->GetServerTypesWithUnappliedUpdates(&trans); } - for (syncable::FullModelTypeSet::Iterator it = + for (syncer::FullModelTypeSet::Iterator it = server_types_with_unapplied_updates.First(); it.Good(); it.Inc()) { groups_with_unapplied_updates.insert( GetGroupForModelType(it.Get(), session.routing_info())); @@ -46,10 +46,10 @@ SyncerError ApplyUpdatesCommand::ModelChangingExecuteImpl( // Compute server types with unapplied updates that fall under our // group restriction. - const syncable::FullModelTypeSet server_types_with_unapplied_updates = + const syncer::FullModelTypeSet server_types_with_unapplied_updates = dir->GetServerTypesWithUnappliedUpdates(&trans); - syncable::FullModelTypeSet server_type_restriction; - for (syncable::FullModelTypeSet::Iterator it = + syncer::FullModelTypeSet server_type_restriction; + for (syncer::FullModelTypeSet::Iterator it = server_types_with_unapplied_updates.First(); it.Good(); it.Inc()) { if (GetGroupForModelType(it.Get(), session->routing_info()) == session->status_controller().group_restriction()) { @@ -75,7 +75,7 @@ SyncerError ApplyUpdatesCommand::ModelChangingExecuteImpl( // some subset of the currently synced datatypes. const sessions::StatusController& status(session->status_controller()); if (status.ServerSaysNothingMoreToDownload()) { - for (syncable::ModelTypeSet::Iterator it = + for (syncer::ModelTypeSet::Iterator it = status.updates_request_types().First(); it.Good(); it.Inc()) { // This gets persisted to the directory's backing store. dir->set_initial_sync_ended_for_type(it.Get(), true); diff --git a/sync/engine/apply_updates_command_unittest.cc b/sync/engine/apply_updates_command_unittest.cc index e185b8e..8f76afd 100644 --- a/sync/engine/apply_updates_command_unittest.cc +++ b/sync/engine/apply_updates_command_unittest.cc @@ -39,7 +39,7 @@ using syncable::WriteTransaction; namespace { sync_pb::EntitySpecifics DefaultBookmarkSpecifics() { sync_pb::EntitySpecifics result; - AddDefaultFieldValue(syncable::BOOKMARKS, &result); + AddDefaultFieldValue(syncer::BOOKMARKS, &result); return result; } } // namespace @@ -58,9 +58,9 @@ class ApplyUpdatesCommandTest : public SyncerCommandTest { make_scoped_refptr(new FakeModelWorker(GROUP_UI))); workers()->push_back( make_scoped_refptr(new FakeModelWorker(GROUP_PASSWORD))); - (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI; - (*mutable_routing_info())[syncable::PASSWORDS] = GROUP_PASSWORD; - (*mutable_routing_info())[syncable::NIGORI] = GROUP_PASSIVE; + (*mutable_routing_info())[syncer::BOOKMARKS] = GROUP_UI; + (*mutable_routing_info())[syncer::PASSWORDS] = GROUP_PASSWORD; + (*mutable_routing_info())[syncer::NIGORI] = GROUP_PASSIVE; SyncerCommandTest::SetUp(); entry_factory_.reset(new TestEntryFactory(directory())); ExpectNoGroupsToChange(apply_updates_command_); @@ -138,8 +138,7 @@ TEST_F(ApplyUpdatesCommandTest, UpdateWithChildrenBeforeParents) { // to detect that this update can't be applied because it is in a CONFLICT // state. TEST_F(ApplyUpdatesCommandTest, SimpleConflict) { - entry_factory_->CreateUnappliedAndUnsyncedItem( - "item", syncable::BOOKMARKS); + entry_factory_->CreateUnappliedAndUnsyncedItem("item", syncer::BOOKMARKS); ExpectGroupToChange(apply_updates_command_, GROUP_UI); apply_updates_command_.ExecuteImpl(session()); @@ -159,7 +158,7 @@ TEST_F(ApplyUpdatesCommandTest, SimpleConflict) { TEST_F(ApplyUpdatesCommandTest, HierarchyAndSimpleConflict) { // Create a simply-conflicting item. It will start with valid parent ids. int64 handle = entry_factory_->CreateUnappliedAndUnsyncedItem( - "orphaned_by_server", syncable::BOOKMARKS); + "orphaned_by_server", syncer::BOOKMARKS); { // Manually set the SERVER_PARENT_ID to bad value. // A bad parent indicates a hierarchy conflict. @@ -197,7 +196,7 @@ TEST_F(ApplyUpdatesCommandTest, HierarchyConflictDirectoryLoop) { { // Create it as a child of root node. int64 handle = entry_factory_->CreateSyncedItem( - "X", syncable::BOOKMARKS, true); + "X", syncer::BOOKMARKS, true); WriteTransaction trans(FROM_HERE, UNITTEST, directory()); MutableEntry entry(&trans, syncable::GET_BY_HANDLE, handle); @@ -212,7 +211,7 @@ TEST_F(ApplyUpdatesCommandTest, HierarchyConflictDirectoryLoop) { // Item 'Y' is child of 'X'. entry_factory_->CreateUnsyncedItem( id_factory_.MakeServer("Y"), id_factory_.MakeServer("X"), "Y", true, - syncable::BOOKMARKS, NULL); + syncer::BOOKMARKS, NULL); // If the server's update were applied, we would have X be a child of Y, and Y // as a child of X. That's a directory loop. The UpdateApplicator should @@ -242,7 +241,7 @@ TEST_F(ApplyUpdatesCommandTest, HierarchyConflictDeletedParent) { int64 parent_handle; entry_factory_->CreateUnsyncedItem( Id::CreateFromServerId("parent"), id_factory_.root(), - "parent", true, syncable::BOOKMARKS, &parent_handle); + "parent", true, syncer::BOOKMARKS, &parent_handle); { WriteTransaction trans(FROM_HERE, UNITTEST, directory()); MutableEntry entry(&trans, syncable::GET_BY_HANDLE, parent_handle); @@ -278,7 +277,7 @@ TEST_F(ApplyUpdatesCommandTest, HierarchyConflictDeleteNonEmptyDirectory) { { // Create it as a child of root node. int64 handle = entry_factory_->CreateSyncedItem( - "parent", syncable::BOOKMARKS, true); + "parent", syncer::BOOKMARKS, true); WriteTransaction trans(FROM_HERE, UNITTEST, directory()); MutableEntry entry(&trans, syncable::GET_BY_HANDLE, handle); @@ -294,7 +293,7 @@ TEST_F(ApplyUpdatesCommandTest, HierarchyConflictDeleteNonEmptyDirectory) { // Create a local child of the server-deleted directory. entry_factory_->CreateUnsyncedItem( id_factory_.MakeServer("child"), id_factory_.MakeServer("parent"), - "child", false, syncable::BOOKMARKS, NULL); + "child", false, syncer::BOOKMARKS, NULL); // The server's request to delete the directory must be ignored, otherwise our // unsynced new child would be orphaned. This is a hierarchy conflict. @@ -410,7 +409,7 @@ TEST_F(ApplyUpdatesCommandTest, UndecryptableData) { // Undecryptable updates should not be applied. sync_pb::EntitySpecifics encrypted_bookmark; encrypted_bookmark.mutable_encrypted(); - AddDefaultFieldValue(syncable::BOOKMARKS, &encrypted_bookmark); + AddDefaultFieldValue(syncer::BOOKMARKS, &encrypted_bookmark); string root_server_id = syncable::GetNullId().GetServerId(); entry_factory_->CreateUnappliedNewItemWithParent( "folder", encrypted_bookmark, root_server_id); @@ -519,9 +518,9 @@ TEST_F(ApplyUpdatesCommandTest, NigoriUpdate) { // Storing the cryptographer separately is bad, but for this test we // know it's safe. Cryptographer* cryptographer; - syncable::ModelTypeSet encrypted_types; - encrypted_types.Put(syncable::PASSWORDS); - encrypted_types.Put(syncable::NIGORI); + syncer::ModelTypeSet encrypted_types; + encrypted_types.Put(syncer::PASSWORDS); + encrypted_types.Put(syncer::NIGORI); { syncable::ReadTransaction trans(FROM_HERE, directory()); cryptographer = directory()->GetCryptographer(&trans); @@ -537,9 +536,9 @@ TEST_F(ApplyUpdatesCommandTest, NigoriUpdate) { sync_pb::NigoriSpecifics* nigori = specifics.mutable_nigori(); other_cryptographer.GetKeys(nigori->mutable_encrypted()); nigori->set_encrypt_bookmarks(true); - encrypted_types.Put(syncable::BOOKMARKS); + encrypted_types.Put(syncer::BOOKMARKS); entry_factory_->CreateUnappliedNewItem( - syncable::ModelTypeToRootTag(syncable::NIGORI), specifics, true); + syncer::ModelTypeToRootTag(syncer::NIGORI), specifics, true); EXPECT_FALSE(cryptographer->has_pending_keys()); ExpectGroupToChange(apply_updates_command_, GROUP_PASSIVE); @@ -559,17 +558,16 @@ TEST_F(ApplyUpdatesCommandTest, NigoriUpdate) { EXPECT_FALSE(cryptographer->is_ready()); EXPECT_TRUE(cryptographer->has_pending_keys()); EXPECT_TRUE( - cryptographer->GetEncryptedTypes() - .Equals(syncable::ModelTypeSet::All())); + cryptographer->GetEncryptedTypes().Equals(syncer::ModelTypeSet::All())); } TEST_F(ApplyUpdatesCommandTest, NigoriUpdateForDisabledTypes) { // Storing the cryptographer separately is bad, but for this test we // know it's safe. Cryptographer* cryptographer; - syncable::ModelTypeSet encrypted_types; - encrypted_types.Put(syncable::PASSWORDS); - encrypted_types.Put(syncable::NIGORI); + syncer::ModelTypeSet encrypted_types; + encrypted_types.Put(syncer::PASSWORDS); + encrypted_types.Put(syncer::NIGORI); { syncable::ReadTransaction trans(FROM_HERE, directory()); cryptographer = directory()->GetCryptographer(&trans); @@ -586,10 +584,10 @@ TEST_F(ApplyUpdatesCommandTest, NigoriUpdateForDisabledTypes) { other_cryptographer.GetKeys(nigori->mutable_encrypted()); nigori->set_encrypt_sessions(true); nigori->set_encrypt_themes(true); - encrypted_types.Put(syncable::SESSIONS); - encrypted_types.Put(syncable::THEMES); + encrypted_types.Put(syncer::SESSIONS); + encrypted_types.Put(syncer::THEMES); entry_factory_->CreateUnappliedNewItem( - syncable::ModelTypeToRootTag(syncable::NIGORI), specifics, true); + syncer::ModelTypeToRootTag(syncer::NIGORI), specifics, true); EXPECT_FALSE(cryptographer->has_pending_keys()); ExpectGroupToChange(apply_updates_command_, GROUP_PASSIVE); @@ -609,8 +607,7 @@ TEST_F(ApplyUpdatesCommandTest, NigoriUpdateForDisabledTypes) { EXPECT_FALSE(cryptographer->is_ready()); EXPECT_TRUE(cryptographer->has_pending_keys()); EXPECT_TRUE( - cryptographer->GetEncryptedTypes() - .Equals(syncable::ModelTypeSet::All())); + cryptographer->GetEncryptedTypes().Equals(syncer::ModelTypeSet::All())); } // Create some local unsynced and unencrypted data. Apply a nigori update that @@ -622,9 +619,9 @@ TEST_F(ApplyUpdatesCommandTest, EncryptUnsyncedChanges) { // Storing the cryptographer separately is bad, but for this test we // know it's safe. Cryptographer* cryptographer; - syncable::ModelTypeSet encrypted_types; - encrypted_types.Put(syncable::PASSWORDS); - encrypted_types.Put(syncable::NIGORI); + syncer::ModelTypeSet encrypted_types; + encrypted_types.Put(syncer::PASSWORDS); + encrypted_types.Put(syncer::NIGORI); { syncable::ReadTransaction trans(FROM_HERE, directory()); cryptographer = directory()->GetCryptographer(&trans); @@ -642,21 +639,21 @@ TEST_F(ApplyUpdatesCommandTest, EncryptUnsyncedChanges) { // First item is a folder Id folder_id = id_factory_.NewLocalId(); entry_factory_->CreateUnsyncedItem(folder_id, id_factory_.root(), "folder", - true, syncable::BOOKMARKS, NULL); + true, syncer::BOOKMARKS, NULL); // Next five items are children of the folder size_t i; size_t batch_s = 5; for (i = 0; i < batch_s; ++i) { entry_factory_->CreateUnsyncedItem(id_factory_.NewLocalId(), folder_id, base::StringPrintf("Item %"PRIuS"", i), - false, syncable::BOOKMARKS, NULL); + false, syncer::BOOKMARKS, NULL); } // Next five items are children of the root. for (; i < 2*batch_s; ++i) { entry_factory_->CreateUnsyncedItem( id_factory_.NewLocalId(), id_factory_.root(), base::StringPrintf("Item %"PRIuS"", i), false, - syncable::BOOKMARKS, NULL); + syncer::BOOKMARKS, NULL); } KeyParams params = {"localhost", "dummy", "foobar"}; @@ -665,9 +662,9 @@ TEST_F(ApplyUpdatesCommandTest, EncryptUnsyncedChanges) { sync_pb::NigoriSpecifics* nigori = specifics.mutable_nigori(); cryptographer->GetKeys(nigori->mutable_encrypted()); nigori->set_encrypt_bookmarks(true); - encrypted_types.Put(syncable::BOOKMARKS); + encrypted_types.Put(syncer::BOOKMARKS); entry_factory_->CreateUnappliedNewItem( - syncable::ModelTypeToRootTag(syncable::NIGORI), specifics, true); + syncer::ModelTypeToRootTag(syncer::NIGORI), specifics, true); EXPECT_FALSE(cryptographer->has_pending_keys()); EXPECT_TRUE(cryptographer->is_ready()); @@ -705,8 +702,8 @@ TEST_F(ApplyUpdatesCommandTest, EncryptUnsyncedChanges) { // If ProcessUnsyncedChangesForEncryption worked, all our unsynced changes // should be encrypted now. - EXPECT_TRUE(syncable::ModelTypeSet::All().Equals( - cryptographer->GetEncryptedTypes())); + EXPECT_TRUE(syncer::ModelTypeSet::All().Equals( + cryptographer->GetEncryptedTypes())); EXPECT_TRUE(VerifyUnsyncedChangesAreEncrypted(&trans, encrypted_types)); Syncer::UnsyncedMetaHandles handles; @@ -718,7 +715,7 @@ TEST_F(ApplyUpdatesCommandTest, EncryptUnsyncedChanges) { { WriteTransaction trans(FROM_HERE, UNITTEST, directory()); MutableEntry entry(&trans, syncable::GET_BY_SERVER_TAG, - syncable::ModelTypeToRootTag(syncable::NIGORI)); + syncer::ModelTypeToRootTag(syncer::NIGORI)); ASSERT_TRUE(entry.good()); entry.Put(syncable::SERVER_VERSION, entry_factory_->GetNextRevision()); entry.Put(syncable::IS_UNAPPLIED_UPDATE, true); @@ -745,7 +742,7 @@ TEST_F(ApplyUpdatesCommandTest, EncryptUnsyncedChanges) { syncable::ReadTransaction trans(FROM_HERE, directory()); // All our changes should still be encrypted. - EXPECT_TRUE(syncable::ModelTypeSet::All().Equals( + EXPECT_TRUE(syncer::ModelTypeSet::All().Equals( cryptographer->GetEncryptedTypes())); EXPECT_TRUE(VerifyUnsyncedChangesAreEncrypted(&trans, encrypted_types)); @@ -759,9 +756,9 @@ TEST_F(ApplyUpdatesCommandTest, CannotEncryptUnsyncedChanges) { // Storing the cryptographer separately is bad, but for this test we // know it's safe. Cryptographer* cryptographer; - syncable::ModelTypeSet encrypted_types; - encrypted_types.Put(syncable::PASSWORDS); - encrypted_types.Put(syncable::NIGORI); + syncer::ModelTypeSet encrypted_types; + encrypted_types.Put(syncer::PASSWORDS); + encrypted_types.Put(syncer::NIGORI); { syncable::ReadTransaction trans(FROM_HERE, directory()); cryptographer = directory()->GetCryptographer(&trans); @@ -780,21 +777,21 @@ TEST_F(ApplyUpdatesCommandTest, CannotEncryptUnsyncedChanges) { Id folder_id = id_factory_.NewLocalId(); entry_factory_->CreateUnsyncedItem( folder_id, id_factory_.root(), "folder", true, - syncable::BOOKMARKS, NULL); + syncer::BOOKMARKS, NULL); // Next five items are children of the folder size_t i; size_t batch_s = 5; for (i = 0; i < batch_s; ++i) { entry_factory_->CreateUnsyncedItem(id_factory_.NewLocalId(), folder_id, base::StringPrintf("Item %"PRIuS"", i), - false, syncable::BOOKMARKS, NULL); + false, syncer::BOOKMARKS, NULL); } // Next five items are children of the root. for (; i < 2*batch_s; ++i) { entry_factory_->CreateUnsyncedItem( id_factory_.NewLocalId(), id_factory_.root(), base::StringPrintf("Item %"PRIuS"", i), false, - syncable::BOOKMARKS, NULL); + syncer::BOOKMARKS, NULL); } // We encrypt with new keys, triggering the local cryptographer to be unready @@ -806,9 +803,9 @@ TEST_F(ApplyUpdatesCommandTest, CannotEncryptUnsyncedChanges) { sync_pb::NigoriSpecifics* nigori = specifics.mutable_nigori(); other_cryptographer.GetKeys(nigori->mutable_encrypted()); nigori->set_encrypt_bookmarks(true); - encrypted_types.Put(syncable::BOOKMARKS); + encrypted_types.Put(syncer::BOOKMARKS); entry_factory_->CreateUnappliedNewItem( - syncable::ModelTypeToRootTag(syncable::NIGORI), specifics, true); + syncer::ModelTypeToRootTag(syncer::NIGORI), specifics, true); EXPECT_FALSE(cryptographer->has_pending_keys()); { @@ -846,7 +843,7 @@ TEST_F(ApplyUpdatesCommandTest, CannotEncryptUnsyncedChanges) { // cryptographer should be updated. EXPECT_FALSE(VerifyUnsyncedChangesAreEncrypted(&trans, encrypted_types)); EXPECT_TRUE(cryptographer->GetEncryptedTypes().Equals( - syncable::ModelTypeSet().All())); + syncer::ModelTypeSet().All())); EXPECT_FALSE(cryptographer->is_ready()); EXPECT_TRUE(cryptographer->has_pending_keys()); diff --git a/sync/engine/build_commit_command.cc b/sync/engine/build_commit_command.cc index 69f94ec..fd23adc 100644 --- a/sync/engine/build_commit_command.cc +++ b/sync/engine/build_commit_command.cc @@ -35,7 +35,7 @@ using syncable::IS_UNSYNCED; using syncable::Id; using syncable::MutableEntry; using syncable::SPECIFICS; -using syncable::UNSPECIFIED; +using syncer::UNSPECIFIED; // static int64 BuildCommitCommand::GetFirstPosition() { diff --git a/sync/engine/cleanup_disabled_types_command.cc b/sync/engine/cleanup_disabled_types_command.cc index bd34fa7..cc78168 100644 --- a/sync/engine/cleanup_disabled_types_command.cc +++ b/sync/engine/cleanup_disabled_types_command.cc @@ -18,8 +18,8 @@ CleanupDisabledTypesCommand::~CleanupDisabledTypesCommand() {} SyncerError CleanupDisabledTypesCommand::ExecuteImpl( sessions::SyncSession* session) { - using syncable::ModelTypeSet; - using syncable::ModelTypeSetToString; + using syncer::ModelTypeSet; + using syncer::ModelTypeSetToString; // Because a full directory purge is slow, we avoid purging // undesired types unless we have reason to believe they were // previously enabled. Because purging could theoretically fail on diff --git a/sync/engine/cleanup_disabled_types_command_unittest.cc b/sync/engine/cleanup_disabled_types_command_unittest.cc index 5b8f476..79a59fe 100644 --- a/sync/engine/cleanup_disabled_types_command_unittest.cc +++ b/sync/engine/cleanup_disabled_types_command_unittest.cc @@ -16,8 +16,6 @@ namespace syncer { namespace { -using syncable::HasModelTypes; -using syncable::ModelTypeSet; using testing::_; class CleanupDisabledTypesCommandTest : public MockDirectorySyncerCommandTest { @@ -26,7 +24,7 @@ class CleanupDisabledTypesCommandTest : public MockDirectorySyncerCommandTest { virtual void SetUp() { mutable_routing_info()->clear(); - (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_PASSIVE; + (*mutable_routing_info())[syncer::BOOKMARKS] = GROUP_PASSIVE; MockDirectorySyncerCommandTest::SetUp(); } }; @@ -35,7 +33,7 @@ class CleanupDisabledTypesCommandTest : public MockDirectorySyncerCommandTest { TEST_F(CleanupDisabledTypesCommandTest, NoPreviousRoutingInfo) { CleanupDisabledTypesCommand command; ModelTypeSet expected = ModelTypeSet::All(); - expected.Remove(syncable::BOOKMARKS); + expected.Remove(syncer::BOOKMARKS); EXPECT_CALL(*mock_directory(), PurgeEntriesWithTypeIn(HasModelTypes(expected))); command.ExecuteImpl(session()); @@ -47,7 +45,7 @@ TEST_F(CleanupDisabledTypesCommandTest, NoPurge) { ModelSafeRoutingInfo prev(routing_info()); session()->context()->set_previous_session_routing_info(prev); - (*mutable_routing_info())[syncable::AUTOFILL] = GROUP_PASSIVE; + (*mutable_routing_info())[syncer::AUTOFILL] = GROUP_PASSIVE; command.ExecuteImpl(session()); prev = routing_info(); @@ -57,16 +55,16 @@ TEST_F(CleanupDisabledTypesCommandTest, NoPurge) { TEST_F(CleanupDisabledTypesCommandTest, TypeDisabled) { CleanupDisabledTypesCommand command; - (*mutable_routing_info())[syncable::AUTOFILL] = GROUP_PASSIVE; - (*mutable_routing_info())[syncable::THEMES] = GROUP_PASSIVE; - (*mutable_routing_info())[syncable::EXTENSIONS] = GROUP_PASSIVE; + (*mutable_routing_info())[syncer::AUTOFILL] = GROUP_PASSIVE; + (*mutable_routing_info())[syncer::THEMES] = GROUP_PASSIVE; + (*mutable_routing_info())[syncer::EXTENSIONS] = GROUP_PASSIVE; ModelSafeRoutingInfo prev(routing_info()); - prev[syncable::PASSWORDS] = GROUP_PASSIVE; - prev[syncable::PREFERENCES] = GROUP_PASSIVE; + prev[syncer::PASSWORDS] = GROUP_PASSIVE; + prev[syncer::PREFERENCES] = GROUP_PASSIVE; session()->context()->set_previous_session_routing_info(prev); - const ModelTypeSet expected(syncable::PASSWORDS, syncable::PREFERENCES); + const ModelTypeSet expected(syncer::PASSWORDS, syncer::PREFERENCES); EXPECT_CALL(*mock_directory(), PurgeEntriesWithTypeIn(HasModelTypes(expected))); command.ExecuteImpl(session()); diff --git a/sync/engine/conflict_resolver.cc b/sync/engine/conflict_resolver.cc index c10b21c..458c7ce 100644 --- a/sync/engine/conflict_resolver.cc +++ b/sync/engine/conflict_resolver.cc @@ -31,9 +31,7 @@ using sessions::StatusController; using syncable::BaseTransaction; using syncable::Directory; using syncable::Entry; -using syncable::GetModelTypeFromSpecifics; using syncable::Id; -using syncable::IsRealDataType; using syncable::MutableEntry; using syncable::WriteTransaction; @@ -223,7 +221,7 @@ ConflictResolver::ProcessSimpleConflict(WriteTransaction* trans, } // We manually merge nigori data. - if (entry.GetModelType() == syncable::NIGORI) { + if (entry.GetModelType() == syncer::NIGORI) { // Create a new set of specifics based on the server specifics (which // preserves their encryption keys). sync_pb::EntitySpecifics specifics = diff --git a/sync/engine/download_updates_command.cc b/sync/engine/download_updates_command.cc index a6bc972..48e4acf 100644 --- a/sync/engine/download_updates_command.cc +++ b/sync/engine/download_updates_command.cc @@ -19,10 +19,6 @@ namespace syncer { using sessions::StatusController; using sessions::SyncSession; using std::string; -using syncable::FIRST_REAL_MODEL_TYPE; -using syncable::MODEL_TYPE_COUNT; -using syncable::ModelTypeSet; -using syncable::ModelTypeSetToString; DownloadUpdatesCommand::DownloadUpdatesCommand( bool create_mobile_bookmarks_folder) @@ -51,7 +47,7 @@ SyncerError DownloadUpdatesCommand::ExecuteImpl(SyncSession* session) { << ModelTypeSetToString(enabled_types); DCHECK(!enabled_types.Empty()); - const syncable::ModelTypePayloadMap& type_payload_map = + const syncer::ModelTypePayloadMap& type_payload_map = session->source().types; for (ModelTypeSet::Iterator it = enabled_types.First(); it.Good(); it.Inc()) { @@ -60,7 +56,7 @@ SyncerError DownloadUpdatesCommand::ExecuteImpl(SyncSession* session) { dir->GetDownloadProgress(it.Get(), progress_marker); // Set notification hint if present. - syncable::ModelTypePayloadMap::const_iterator type_payload = + syncer::ModelTypePayloadMap::const_iterator type_payload = type_payload_map.find(it.Get()); if (type_payload != type_payload_map.end()) { progress_marker->set_notification_hint(type_payload->second); diff --git a/sync/engine/download_updates_command_unittest.cc b/sync/engine/download_updates_command_unittest.cc index ed0d6bb..88b97c0 100644 --- a/sync/engine/download_updates_command_unittest.cc +++ b/sync/engine/download_updates_command_unittest.cc @@ -11,10 +11,8 @@ #include "sync/test/engine/syncer_command_test.h" using ::testing::_; -namespace syncer { -using syncable::FIRST_REAL_MODEL_TYPE; -using syncable::MODEL_TYPE_COUNT; +namespace syncer { // A test fixture for tests exercising DownloadUpdatesCommandTest. class DownloadUpdatesCommandTest : public SyncerCommandTest { @@ -29,9 +27,9 @@ class DownloadUpdatesCommandTest : public SyncerCommandTest { make_scoped_refptr(new FakeModelWorker(GROUP_DB))); workers()->push_back( make_scoped_refptr(new FakeModelWorker(GROUP_UI))); - (*mutable_routing_info())[syncable::AUTOFILL] = GROUP_DB; - (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI; - (*mutable_routing_info())[syncable::PREFERENCES] = GROUP_UI; + (*mutable_routing_info())[syncer::AUTOFILL] = GROUP_DB; + (*mutable_routing_info())[syncer::BOOKMARKS] = GROUP_UI; + (*mutable_routing_info())[syncer::PREFERENCES] = GROUP_UI; SyncerCommandTest::SetUp(); } @@ -51,9 +49,9 @@ TEST_F(DownloadUpdatesCommandTest, ExecuteNoPayloads) { TEST_F(DownloadUpdatesCommandTest, ExecuteWithPayloads) { ConfigureMockServerConnection(); sessions::SyncSourceInfo source; - source.types[syncable::AUTOFILL] = "autofill_payload"; - source.types[syncable::BOOKMARKS] = "bookmark_payload"; - source.types[syncable::PREFERENCES] = "preferences_payload"; + source.types[syncer::AUTOFILL] = "autofill_payload"; + source.types[syncer::BOOKMARKS] = "bookmark_payload"; + source.types[syncer::PREFERENCES] = "preferences_payload"; mock_server()->ExpectGetUpdatesRequestTypes( GetRoutingInfoTypes(routing_info())); mock_server()->ExpectGetUpdatesRequestPayloads(source.types); diff --git a/sync/engine/get_commit_ids_command.cc b/sync/engine/get_commit_ids_command.cc index 34bbe295..405391e 100644 --- a/sync/engine/get_commit_ids_command.cc +++ b/sync/engine/get_commit_ids_command.cc @@ -43,7 +43,7 @@ SyncerError GetCommitIdsCommand::ExecuteImpl(SyncSession* session) { GetUnsyncedEntries(session->write_transaction(), &all_unsynced_handles); - syncable::ModelTypeSet encrypted_types; + syncer::ModelTypeSet encrypted_types; bool passphrase_missing = false; Cryptographer* cryptographer = session->context()-> @@ -53,7 +53,7 @@ SyncerError GetCommitIdsCommand::ExecuteImpl(SyncSession* session) { passphrase_missing = cryptographer->has_pending_keys(); }; - const syncable::ModelTypeSet throttled_types = + const syncer::ModelTypeSet throttled_types = session->context()->throttled_data_type_tracker()->GetThrottledTypes(); // We filter out all unready entries from the set of unsynced handles. This // new set of ready and unsynced items (which excludes throttled items as @@ -102,20 +102,19 @@ bool IsEntryInConflict(const syncable::Entry& entry) { // encrypted). // 3. It's type is currently throttled. // 4. It's a delete but has not been committed. -bool IsEntryReadyForCommit(syncable::ModelTypeSet throttled_types, - syncable::ModelTypeSet encrypted_types, +bool IsEntryReadyForCommit(syncer::ModelTypeSet throttled_types, + syncer::ModelTypeSet encrypted_types, bool passphrase_missing, const syncable::Entry& entry) { DCHECK(entry.Get(syncable::IS_UNSYNCED)); if (IsEntryInConflict(entry)) return false; - const syncable::ModelType type = entry.GetModelType(); + const syncer::ModelType type = entry.GetModelType(); // We special case the nigori node because even though it is considered an // "encrypted type", not all nigori node changes require valid encryption // (ex: sync_tabs). - if ((type != syncable::NIGORI) && - encrypted_types.Has(type) && + if ((type != syncer::NIGORI) && encrypted_types.Has(type) && (passphrase_missing || syncable::EntryNeedsEncryption(encrypted_types, entry))) { // This entry requires encryption but is not properly encrypted (possibly @@ -160,8 +159,8 @@ bool IsEntryReadyForCommit(syncable::ModelTypeSet throttled_types, void GetCommitIdsCommand::FilterUnreadyEntries( syncable::BaseTransaction* trans, - syncable::ModelTypeSet throttled_types, - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet throttled_types, + syncer::ModelTypeSet encrypted_types, bool passphrase_missing, const syncable::Directory::UnsyncedMetaHandles& unsynced_handles, std::set<int64>* ready_unsynced_set) { diff --git a/sync/engine/get_commit_ids_command.h b/sync/engine/get_commit_ids_command.h index f6b8a66..5160842 100644 --- a/sync/engine/get_commit_ids_command.h +++ b/sync/engine/get_commit_ids_command.h @@ -59,8 +59,8 @@ class GetCommitIdsCommand : public SyncerCommand { // 4. It's a delete but has not been committed. void FilterUnreadyEntries( syncable::BaseTransaction* trans, - syncable::ModelTypeSet throttled_types, - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet throttled_types, + syncer::ModelTypeSet encrypted_types, bool passphrase_missing, const syncable::Directory::UnsyncedMetaHandles& unsynced_handles, std::set<int64>* ready_unsynced_set); diff --git a/sync/engine/model_changing_syncer_command_unittest.cc b/sync/engine/model_changing_syncer_command_unittest.cc index af30c89..676411b 100644 --- a/sync/engine/model_changing_syncer_command_unittest.cc +++ b/sync/engine/model_changing_syncer_command_unittest.cc @@ -53,8 +53,8 @@ class ModelChangingSyncerCommandTest : public SyncerCommandTest { make_scoped_refptr(new FakeModelWorker(GROUP_UI))); workers()->push_back( make_scoped_refptr(new FakeModelWorker(GROUP_PASSWORD))); - (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI; - (*mutable_routing_info())[syncable::PASSWORDS] = GROUP_PASSWORD; + (*mutable_routing_info())[syncer::BOOKMARKS] = GROUP_UI; + (*mutable_routing_info())[syncer::PASSWORDS] = GROUP_PASSWORD; SyncerCommandTest::SetUp(); } diff --git a/sync/engine/process_commit_response_command.cc b/sync/engine/process_commit_response_command.cc index 26be776..26dca0e 100644 --- a/sync/engine/process_commit_response_command.cc +++ b/sync/engine/process_commit_response_command.cc @@ -134,7 +134,7 @@ SyncerError ProcessCommitResponseCommand::ProcessCommitResponse( case CommitResponse::SUCCESS: // TODO(sync): worry about sync_rate_ rate calc? ++successes; - if (commit_set_.GetModelTypeAt(proj[i]) == syncable::BOOKMARKS) + if (commit_set_.GetModelTypeAt(proj[i]) == syncer::BOOKMARKS) status->increment_num_successful_bookmark_commits(); status->increment_num_successful_commits(); break; diff --git a/sync/engine/process_commit_response_command_unittest.cc b/sync/engine/process_commit_response_command_unittest.cc index a387bd2..be9fa22 100644 --- a/sync/engine/process_commit_response_command_unittest.cc +++ b/sync/engine/process_commit_response_command_unittest.cc @@ -46,9 +46,9 @@ class ProcessCommitResponseCommandTest : public SyncerCommandTest { make_scoped_refptr(new FakeModelWorker(GROUP_DB))); workers()->push_back( make_scoped_refptr(new FakeModelWorker(GROUP_UI))); - (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI; - (*mutable_routing_info())[syncable::PREFERENCES] = GROUP_UI; - (*mutable_routing_info())[syncable::AUTOFILL] = GROUP_DB; + (*mutable_routing_info())[syncer::BOOKMARKS] = GROUP_UI; + (*mutable_routing_info())[syncer::PREFERENCES] = GROUP_UI; + (*mutable_routing_info())[syncer::AUTOFILL] = GROUP_DB; SyncerCommandTest::SetUp(); } @@ -62,7 +62,7 @@ class ProcessCommitResponseCommandTest : public SyncerCommandTest { } void CheckEntry(Entry* e, const std::string& name, - syncable::ModelType model_type, const Id& parent_id) { + syncer::ModelType model_type, const Id& parent_id) { EXPECT_TRUE(e->good()); ASSERT_EQ(name, e->Get(NON_UNIQUE_NAME)); ASSERT_EQ(model_type, e->GetModelType()); @@ -79,7 +79,7 @@ class ProcessCommitResponseCommandTest : public SyncerCommandTest { const Id& parent_id, const string& name, bool is_folder, - syncable::ModelType model_type, + syncer::ModelType model_type, int64* metahandle_out) { WriteTransaction trans(FROM_HERE, UNITTEST, directory()); Id predecessor_id; @@ -96,7 +96,7 @@ class ProcessCommitResponseCommandTest : public SyncerCommandTest { entry.Put(syncable::PARENT_ID, parent_id); entry.PutPredecessor(predecessor_id); sync_pb::EntitySpecifics default_specifics; - syncable::AddDefaultFieldValue(model_type, &default_specifics); + syncer::AddDefaultFieldValue(model_type, &default_specifics); entry.Put(syncable::SPECIFICS, default_specifics); if (item_id.ServerKnows()) { entry.Put(syncable::SERVER_SPECIFICS, default_specifics); @@ -116,7 +116,7 @@ class ProcessCommitResponseCommandTest : public SyncerCommandTest { const Id& item_id, const Id& parent_id, const string& name, - syncable::ModelType model_type, + syncer::ModelType model_type, sessions::OrderedCommitSet *commit_set, syncer::ClientToServerMessage *commit, syncer::ClientToServerResponse *response) { @@ -200,25 +200,25 @@ TEST_F(ProcessCommitResponseCommandTest, MultipleCommitIdProjections) { Id autofill_id1 = id_factory_.NewLocalId(); Id autofill_id2 = id_factory_.NewLocalId(); CreateUnprocessedCommitResult(bookmark_folder_id, id_factory_.root(), - "A bookmark folder", syncable::BOOKMARKS, + "A bookmark folder", syncer::BOOKMARKS, &commit_set, &request, &response); CreateUnprocessedCommitResult(bookmark_id1, bookmark_folder_id, - "bookmark 1", syncable::BOOKMARKS, + "bookmark 1", syncer::BOOKMARKS, &commit_set, &request, &response); CreateUnprocessedCommitResult(bookmark_id2, bookmark_folder_id, - "bookmark 2", syncable::BOOKMARKS, + "bookmark 2", syncer::BOOKMARKS, &commit_set, &request, &response); CreateUnprocessedCommitResult(pref_id1, id_factory_.root(), - "Pref 1", syncable::PREFERENCES, + "Pref 1", syncer::PREFERENCES, &commit_set, &request, &response); CreateUnprocessedCommitResult(pref_id2, id_factory_.root(), - "Pref 2", syncable::PREFERENCES, + "Pref 2", syncer::PREFERENCES, &commit_set, &request, &response); CreateUnprocessedCommitResult(autofill_id1, id_factory_.root(), - "Autofill 1", syncable::AUTOFILL, + "Autofill 1", syncer::AUTOFILL, &commit_set, &request, &response); CreateUnprocessedCommitResult(autofill_id2, id_factory_.root(), - "Autofill 2", syncable::AUTOFILL, + "Autofill 2", syncer::AUTOFILL, &commit_set, &request, &response); ProcessCommitResponseCommand command(commit_set, request, response); @@ -245,20 +245,20 @@ TEST_F(ProcessCommitResponseCommandTest, MultipleCommitIdProjections) { ASSERT_TRUE(directory()->GetFirstChildId(&trans, new_fid, &cid)); Entry b1(&trans, syncable::GET_BY_ID, cid); Entry b2(&trans, syncable::GET_BY_ID, b1.Get(syncable::NEXT_ID)); - CheckEntry(&b1, "bookmark 1", syncable::BOOKMARKS, new_fid); - CheckEntry(&b2, "bookmark 2", syncable::BOOKMARKS, new_fid); + CheckEntry(&b1, "bookmark 1", syncer::BOOKMARKS, new_fid); + CheckEntry(&b2, "bookmark 2", syncer::BOOKMARKS, new_fid); ASSERT_TRUE(b2.Get(syncable::NEXT_ID).IsRoot()); // Look at the prefs and autofill items. Entry p1(&trans, syncable::GET_BY_ID, b_folder.Get(syncable::NEXT_ID)); Entry p2(&trans, syncable::GET_BY_ID, p1.Get(syncable::NEXT_ID)); - CheckEntry(&p1, "Pref 1", syncable::PREFERENCES, id_factory_.root()); - CheckEntry(&p2, "Pref 2", syncable::PREFERENCES, id_factory_.root()); + CheckEntry(&p1, "Pref 1", syncer::PREFERENCES, id_factory_.root()); + CheckEntry(&p2, "Pref 2", syncer::PREFERENCES, id_factory_.root()); Entry a1(&trans, syncable::GET_BY_ID, p2.Get(syncable::NEXT_ID)); Entry a2(&trans, syncable::GET_BY_ID, a1.Get(syncable::NEXT_ID)); - CheckEntry(&a1, "Autofill 1", syncable::AUTOFILL, id_factory_.root()); - CheckEntry(&a2, "Autofill 2", syncable::AUTOFILL, id_factory_.root()); + CheckEntry(&a1, "Autofill 1", syncer::AUTOFILL, id_factory_.root()); + CheckEntry(&a2, "Autofill 2", syncer::AUTOFILL, id_factory_.root()); ASSERT_TRUE(a2.Get(syncable::NEXT_ID).IsRoot()); } @@ -280,7 +280,7 @@ TEST_F(ProcessCommitResponseCommandTest, NewFolderCommitKeepsChildOrder) { // Create the parent folder, a new item whose ID will change on commit. Id folder_id = id_factory_.NewLocalId(); CreateUnprocessedCommitResult(folder_id, id_factory_.root(), "A", - syncable::BOOKMARKS, + syncer::BOOKMARKS, &commit_set, &request, &response); // Verify that the item is reachable. @@ -300,7 +300,7 @@ TEST_F(ProcessCommitResponseCommandTest, NewFolderCommitKeepsChildOrder) { // Alternate between new and old child items, just for kicks. Id id = (i % 4 < 2) ? id_factory_.NewLocalId() : id_factory_.NewServerId(); CreateUnprocessedCommitResult( - id, folder_id, base::StringPrintf("Item %d", i), syncable::BOOKMARKS, + id, folder_id, base::StringPrintf("Item %d", i), syncer::BOOKMARKS, &commit_set, &request, &response); } // The second 25 children will be unsynced items but NOT part of the commit @@ -311,7 +311,7 @@ TEST_F(ProcessCommitResponseCommandTest, NewFolderCommitKeepsChildOrder) { // Alternate between new and old child items, just for kicks. Id id = (i % 4 < 2) ? id_factory_.NewLocalId() : id_factory_.NewServerId(); CreateUnsyncedItem(id, folder_id, base::StringPrintf("Item %d", i), - false, syncable::BOOKMARKS, NULL); + false, syncer::BOOKMARKS, NULL); } // Process the commit response for the parent folder and the first @@ -405,19 +405,19 @@ TEST_P(MixedResult, ExtensionActivity) { syncer::ClientToServerMessage request; syncer::ClientToServerResponse response; - EXPECT_NE(routing_info().find(syncable::BOOKMARKS)->second, - routing_info().find(syncable::AUTOFILL)->second) + EXPECT_NE(routing_info().find(syncer::BOOKMARKS)->second, + routing_info().find(syncer::AUTOFILL)->second) << "To not be lame, this test requires more than one active group."; // Bookmark item setup. CreateUnprocessedCommitResult(id_factory_.NewServerId(), - id_factory_.root(), "Some bookmark", syncable::BOOKMARKS, + id_factory_.root(), "Some bookmark", syncer::BOOKMARKS, &commit_set, &request, &response); if (ShouldFailBookmarkCommit()) SetLastErrorCode(CommitResponse::TRANSIENT_ERROR, &response); // Autofill item setup. CreateUnprocessedCommitResult(id_factory_.NewServerId(), - id_factory_.root(), "Some autofill", syncable::AUTOFILL, + id_factory_.root(), "Some autofill", syncer::AUTOFILL, &commit_set, &request, &response); if (ShouldFailAutofillCommit()) SetLastErrorCode(CommitResponse::TRANSIENT_ERROR, &response); diff --git a/sync/engine/process_updates_command.cc b/sync/engine/process_updates_command.cc index 994fe1c..f239a6a 100644 --- a/sync/engine/process_updates_command.cc +++ b/sync/engine/process_updates_command.cc @@ -77,7 +77,7 @@ bool ReverifyEntry(syncable::WriteTransaction* trans, const SyncEntity& entry, const bool deleted = entry.has_deleted() && entry.deleted(); const bool is_directory = entry.IsFolder(); - const syncable::ModelType model_type = entry.GetModelType(); + const syncer::ModelType model_type = entry.GetModelType(); return VERIFY_SUCCESS == VerifyUpdateConsistency(trans, entry, @@ -160,7 +160,7 @@ ServerUpdateProcessingResult ProcessUpdatesCommand::ProcessUpdate( // We only store the old specifics if they were decryptable and applied and // there is no BASE_SERVER_SPECIFICS already. Else do nothing. if (!target_entry.Get(syncable::IS_UNAPPLIED_UPDATE) && - !syncable::IsRealDataType(syncable::GetModelTypeFromSpecifics( + !syncer::IsRealDataType(syncer::GetModelTypeFromSpecifics( target_entry.Get(syncable::BASE_SERVER_SPECIFICS))) && (!prev_specifics.has_encrypted() || cryptographer->CanDecrypt(prev_specifics.encrypted()))) { @@ -168,7 +168,7 @@ ServerUpdateProcessingResult ProcessUpdatesCommand::ProcessUpdate( << prev_specifics.SerializeAsString(); target_entry.Put(syncable::BASE_SERVER_SPECIFICS, prev_specifics); } - } else if (syncable::IsRealDataType(syncable::GetModelTypeFromSpecifics( + } else if (syncer::IsRealDataType(syncer::GetModelTypeFromSpecifics( target_entry.Get(syncable::BASE_SERVER_SPECIFICS)))) { // We have a BASE_SERVER_SPECIFICS, but a subsequent non-specifics-only // change arrived. As a result, we can't use the specifics alone to detect diff --git a/sync/engine/process_updates_command_unittest.cc b/sync/engine/process_updates_command_unittest.cc index 7e88e62..e36af92 100644 --- a/sync/engine/process_updates_command_unittest.cc +++ b/sync/engine/process_updates_command_unittest.cc @@ -27,8 +27,8 @@ class ProcessUpdatesCommandTest : public SyncerCommandTest { make_scoped_refptr(new FakeModelWorker(GROUP_UI))); workers()->push_back( make_scoped_refptr(new FakeModelWorker(GROUP_DB))); - (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI; - (*mutable_routing_info())[syncable::AUTOFILL] = GROUP_DB; + (*mutable_routing_info())[syncer::BOOKMARKS] = GROUP_UI; + (*mutable_routing_info())[syncer::AUTOFILL] = GROUP_DB; SyncerCommandTest::SetUp(); } diff --git a/sync/engine/resolve_conflicts_command_unittest.cc b/sync/engine/resolve_conflicts_command_unittest.cc index 85decbf..b04e0ec 100644 --- a/sync/engine/resolve_conflicts_command_unittest.cc +++ b/sync/engine/resolve_conflicts_command_unittest.cc @@ -26,8 +26,8 @@ class ResolveConflictsCommandTest : public SyncerCommandTest { make_scoped_refptr(new FakeModelWorker(GROUP_UI))); workers()->push_back( make_scoped_refptr(new FakeModelWorker(GROUP_PASSWORD))); - (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI; - (*mutable_routing_info())[syncable::PASSWORDS] = GROUP_PASSWORD; + (*mutable_routing_info())[syncer::BOOKMARKS] = GROUP_UI; + (*mutable_routing_info())[syncer::PASSWORDS] = GROUP_PASSWORD; SyncerCommandTest::SetUp(); } diff --git a/sync/engine/store_timestamps_command.cc b/sync/engine/store_timestamps_command.cc index d83d154..5911fca 100644 --- a/sync/engine/store_timestamps_command.cc +++ b/sync/engine/store_timestamps_command.cc @@ -26,12 +26,12 @@ SyncerError StoreTimestampsCommand::ExecuteImpl( // Update the progress marker tokens from the server result. If a marker // was omitted for any one type, that indicates no change from the previous // state. - syncable::ModelTypeSet forward_progress_types; + syncer::ModelTypeSet forward_progress_types; for (int i = 0; i < updates.new_progress_marker_size(); ++i) { - syncable::ModelType model = - syncable::GetModelTypeFromSpecificsFieldNumber( + syncer::ModelType model = + syncer::GetModelTypeFromSpecificsFieldNumber( updates.new_progress_marker(i).data_type_id()); - if (model == syncable::UNSPECIFIED || model == syncable::TOP_LEVEL_FOLDER) { + if (model == syncer::UNSPECIFIED || model == syncer::TOP_LEVEL_FOLDER) { NOTREACHED() << "Unintelligible server response."; continue; } @@ -43,9 +43,9 @@ SyncerError StoreTimestampsCommand::ExecuteImpl( if (VLOG_IS_ON(1)) { DVLOG_IF(1, !forward_progress_types.Empty()) << "Get Updates got new progress marker for types: " - << syncable::ModelTypeSetToString(forward_progress_types) + << syncer::ModelTypeSetToString(forward_progress_types) << " out of possible: " - << syncable::ModelTypeSetToString(status->updates_request_types()); + << syncer::ModelTypeSetToString(status->updates_request_types()); } if (updates.has_changes_remaining()) { int64 changes_left = updates.changes_remaining(); diff --git a/sync/engine/sync_scheduler.cc b/sync/engine/sync_scheduler.cc index b41625a..f55627d 100644 --- a/sync/engine/sync_scheduler.cc +++ b/sync/engine/sync_scheduler.cc @@ -28,9 +28,6 @@ namespace syncer { using sessions::SyncSession; using sessions::SyncSessionSnapshot; using sessions::SyncSourceInfo; -using syncable::ModelTypeSet; -using syncable::ModelTypeSetToString; -using syncable::ModelTypePayloadMap; using sync_pb::GetUpdatesCallerInfo; namespace { @@ -324,11 +321,11 @@ SyncScheduler::JobProcessDecision SyncScheduler::DecideOnJob( return CONTINUE; // See if our type is throttled. - syncable::ModelTypeSet throttled_types = + syncer::ModelTypeSet throttled_types = session_context_->throttled_data_type_tracker()->GetThrottledTypes(); if (job.purpose == SyncSessionJob::NUDGE && job.session->source().updates_source == GetUpdatesCallerInfo::LOCAL) { - syncable::ModelTypeSet requested_types; + syncer::ModelTypeSet requested_types; for (ModelTypePayloadMap::const_iterator i = job.session->source().types.begin(); i != job.session->source().types.end(); @@ -465,7 +462,7 @@ void SyncScheduler::ScheduleNudgeAsync( << "types " << ModelTypeSetToString(types); ModelTypePayloadMap types_with_payloads = - syncable::ModelTypePayloadMapFromEnumSet(types, std::string()); + syncer::ModelTypePayloadMapFromEnumSet(types, std::string()); SyncScheduler::ScheduleNudgeImpl(delay, GetUpdatesFromNudgeSource(source), types_with_payloads, @@ -482,7 +479,7 @@ void SyncScheduler::ScheduleNudgeWithPayloadsAsync( << "Nudge scheduled with delay " << delay.InMilliseconds() << " ms, " << "source " << GetNudgeSourceString(source) << ", " << "payloads " - << syncable::ModelTypePayloadMapToString(types_with_payloads); + << syncer::ModelTypePayloadMapToString(types_with_payloads); SyncScheduler::ScheduleNudgeImpl(delay, GetUpdatesFromNudgeSource(source), @@ -503,7 +500,7 @@ void SyncScheduler::ScheduleNudgeImpl( << delay.InMilliseconds() << " ms, " << "source " << GetUpdatesSourceString(source) << ", " << "payloads " - << syncable::ModelTypePayloadMapToString(types_with_payloads) + << syncer::ModelTypePayloadMapToString(types_with_payloads) << (is_canary_job ? " (canary)" : ""); SyncSourceInfo info(source, types_with_payloads); @@ -554,7 +551,7 @@ void GetModelSafeParamsForTypes(ModelTypeSet types, typedef std::vector<ModelSafeWorker*>::const_iterator iter; for (ModelTypeSet::Iterator it = types.First(); it.Good(); it.Inc()) { - const syncable::ModelType t = it.Get(); + const syncer::ModelType t = it.Get(); ModelSafeRoutingInfo::const_iterator route = current_routes.find(t); DCHECK(route != current_routes.end()); ModelSafeGroup group = route->second; diff --git a/sync/engine/sync_scheduler.h b/sync/engine/sync_scheduler.h index 60f9384..efe9789 100644 --- a/sync/engine/sync_scheduler.h +++ b/sync/engine/sync_scheduler.h @@ -79,11 +79,11 @@ class SyncScheduler : public sessions::SyncSession::Delegate { // The meat and potatoes. Both of these methods will post a delayed task // to attempt the actual nudge (see ScheduleNudgeImpl). void ScheduleNudgeAsync(const base::TimeDelta& delay, NudgeSource source, - syncable::ModelTypeSet types, + syncer::ModelTypeSet types, const tracked_objects::Location& nudge_location); void ScheduleNudgeWithPayloadsAsync( const base::TimeDelta& delay, NudgeSource source, - const syncable::ModelTypePayloadMap& types_with_payloads, + const syncer::ModelTypePayloadMap& types_with_payloads, const tracked_objects::Location& nudge_location); // Schedule a configuration cycle. May execute immediately or at a later time @@ -91,7 +91,7 @@ class SyncScheduler : public sessions::SyncSession::Delegate { // Note: The source argument of this function must come from the subset of // GetUpdatesCallerInfo values related to configurations. void ScheduleConfiguration( - syncable::ModelTypeSet types, + syncer::ModelTypeSet types, sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source); void CleanupDisabledTypes(); @@ -307,7 +307,7 @@ class SyncScheduler : public sessions::SyncSession::Delegate { void ScheduleNudgeImpl( const base::TimeDelta& delay, sync_pb::GetUpdatesCallerInfo::GetUpdatesSource source, - const syncable::ModelTypePayloadMap& types_with_payloads, + const syncer::ModelTypePayloadMap& types_with_payloads, bool is_canary_job, const tracked_objects::Location& nudge_location); // Returns true if the client is currently in exponential backoff. diff --git a/sync/engine/sync_scheduler_unittest.cc b/sync/engine/sync_scheduler_unittest.cc index cfea374..de3fa61 100644 --- a/sync/engine/sync_scheduler_unittest.cc +++ b/sync/engine/sync_scheduler_unittest.cc @@ -34,7 +34,6 @@ namespace syncer { using sessions::SyncSession; using sessions::SyncSessionContext; using sessions::SyncSessionSnapshot; -using syncable::ModelTypeSet; using sync_pb::GetUpdatesCallerInfo; class MockSyncer : public Syncer { @@ -90,10 +89,10 @@ class SyncSchedulerTest : public testing::Test { delay_ = NULL; ModelSafeRoutingInfo routing_info; - routing_info[syncable::BOOKMARKS] = GROUP_UI; - routing_info[syncable::AUTOFILL] = GROUP_DB; - routing_info[syncable::THEMES] = GROUP_UI; - routing_info[syncable::NIGORI] = GROUP_PASSIVE; + routing_info[syncer::BOOKMARKS] = GROUP_UI; + routing_info[syncer::AUTOFILL] = GROUP_DB; + routing_info[syncer::THEMES] = GROUP_UI; + routing_info[syncer::NIGORI] = GROUP_PASSIVE; workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_UI))); workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_DB))); @@ -182,9 +181,9 @@ class SyncSchedulerTest : public testing::Test { // payload values. bool CompareModelTypeSetToModelTypePayloadMap( ModelTypeSet lhs, - const syncable::ModelTypePayloadMap& rhs) { + const syncer::ModelTypePayloadMap& rhs) { size_t count = 0; - for (syncable::ModelTypePayloadMap::const_iterator i = rhs.begin(); + for (syncer::ModelTypePayloadMap::const_iterator i = rhs.begin(); i != rhs.end(); ++i, ++count) { if (!lhs.Has(i->first)) return false; @@ -246,7 +245,7 @@ ACTION(QuitLoopNowAction) { // Test nudge scheduling. TEST_F(SyncSchedulerTest, Nudge) { SyncShareRecords records; - ModelTypeSet model_types(syncable::BOOKMARKS); + ModelTypeSet model_types(syncer::BOOKMARKS); EXPECT_CALL(*syncer(), SyncShare(_,_,_)) .WillOnce(DoAll(Invoke(sessions::test_util::SimulateSuccess), @@ -269,8 +268,8 @@ TEST_F(SyncSchedulerTest, Nudge) { // Make sure a second, later, nudge is unaffected by first (no coalescing). SyncShareRecords records2; - model_types.Remove(syncable::BOOKMARKS); - model_types.Put(syncable::AUTOFILL); + model_types.Remove(syncer::BOOKMARKS); + model_types.Put(syncer::AUTOFILL); EXPECT_CALL(*syncer(), SyncShare(_,_,_)) .WillOnce(DoAll(Invoke(sessions::test_util::SimulateSuccess), WithArg<0>(RecordSyncShare(&records2)))); @@ -289,7 +288,7 @@ TEST_F(SyncSchedulerTest, Nudge) { // errors. TEST_F(SyncSchedulerTest, Config) { SyncShareRecords records; - const ModelTypeSet model_types(syncable::BOOKMARKS); + const ModelTypeSet model_types(syncer::BOOKMARKS); EXPECT_CALL(*syncer(), SyncShare(_,_,_)) .WillOnce(DoAll(Invoke(sessions::test_util::SimulateSuccess), @@ -313,7 +312,7 @@ TEST_F(SyncSchedulerTest, ConfigWithBackingOff) { EXPECT_CALL(*delay(), GetDelay(_)) .WillRepeatedly(Return(TimeDelta::FromMilliseconds(1))); SyncShareRecords records; - const ModelTypeSet model_types(syncable::BOOKMARKS); + const ModelTypeSet model_types(syncer::BOOKMARKS); EXPECT_CALL(*syncer(), SyncShare(_,_,_)) .WillOnce(DoAll(Invoke(sessions::test_util::SimulateCommitFailed), @@ -341,8 +340,8 @@ TEST_F(SyncSchedulerTest, ConfigWithBackingOff) { // and make sure LATEST is executed. TEST_F(SyncSchedulerTest, MultipleConfigWithBackingOff) { const ModelTypeSet - model_types1(syncable::BOOKMARKS), - model_types2(syncable::AUTOFILL); + model_types1(syncer::BOOKMARKS), + model_types2(syncer::AUTOFILL); UseMockDelayProvider(); EXPECT_CALL(*delay(), GetDelay(_)) .WillRepeatedly(Return(TimeDelta::FromMilliseconds(30))); @@ -382,7 +381,7 @@ TEST_F(SyncSchedulerTest, MultipleConfigWithBackingOff) { // Issue a nudge when the config has failed. Make sure both the config and // nudge are executed. TEST_F(SyncSchedulerTest, NudgeWithConfigWithBackingOff) { - const ModelTypeSet model_types(syncable::BOOKMARKS); + const ModelTypeSet model_types(syncer::BOOKMARKS); UseMockDelayProvider(); EXPECT_CALL(*delay(), GetDelay(_)) .WillRepeatedly(Return(TimeDelta::FromMilliseconds(50))); @@ -439,9 +438,9 @@ TEST_F(SyncSchedulerTest, NudgeCoalescing) { .WillOnce(DoAll(Invoke(sessions::test_util::SimulateSuccess), WithArg<0>(RecordSyncShare(&r)))); const ModelTypeSet - types1(syncable::BOOKMARKS), - types2(syncable::AUTOFILL), - types3(syncable::THEMES); + types1(syncer::BOOKMARKS), + types2(syncer::AUTOFILL), + types3(syncer::THEMES); TimeDelta delay = zero(); TimeTicks optimal_time = TimeTicks::Now() + delay; scheduler()->ScheduleNudgeAsync( @@ -482,8 +481,8 @@ TEST_F(SyncSchedulerTest, NudgeCoalescingWithDifferentTimings) { EXPECT_CALL(*syncer(), SyncShare(_,_,_)) .WillOnce(DoAll(Invoke(sessions::test_util::SimulateSuccess), WithArg<0>(RecordSyncShare(&r)))); - syncable::ModelTypeSet types1(syncable::BOOKMARKS), - types2(syncable::AUTOFILL), types3; + syncer::ModelTypeSet types1(syncer::BOOKMARKS), + types2(syncer::AUTOFILL), types3; // Create a huge time delay. TimeDelta delay = TimeDelta::FromDays(1); @@ -514,8 +513,8 @@ TEST_F(SyncSchedulerTest, NudgeWithPayloads) { StartSyncScheduler(SyncScheduler::NORMAL_MODE); SyncShareRecords records; - syncable::ModelTypePayloadMap model_types_with_payloads; - model_types_with_payloads[syncable::BOOKMARKS] = "test"; + syncer::ModelTypePayloadMap model_types_with_payloads; + model_types_with_payloads[syncer::BOOKMARKS] = "test"; EXPECT_CALL(*syncer(), SyncShare(_,_,_)) .WillOnce(DoAll(Invoke(sessions::test_util::SimulateSuccess), @@ -534,8 +533,8 @@ TEST_F(SyncSchedulerTest, NudgeWithPayloads) { // Make sure a second, later, nudge is unaffected by first (no coalescing). SyncShareRecords records2; - model_types_with_payloads.erase(syncable::BOOKMARKS); - model_types_with_payloads[syncable::AUTOFILL] = "test2"; + model_types_with_payloads.erase(syncer::BOOKMARKS); + model_types_with_payloads[syncer::AUTOFILL] = "test2"; EXPECT_CALL(*syncer(), SyncShare(_,_,_)) .WillOnce(DoAll(Invoke(sessions::test_util::SimulateSuccess), WithArg<0>(RecordSyncShare(&records2)))); @@ -557,10 +556,10 @@ TEST_F(SyncSchedulerTest, NudgeWithPayloadsCoalescing) { EXPECT_CALL(*syncer(), SyncShare(_,_,_)) .WillOnce(DoAll(Invoke(sessions::test_util::SimulateSuccess), WithArg<0>(RecordSyncShare(&r)))); - syncable::ModelTypePayloadMap types1, types2, types3; - types1[syncable::BOOKMARKS] = "test1"; - types2[syncable::AUTOFILL] = "test2"; - types3[syncable::THEMES] = "test3"; + syncer::ModelTypePayloadMap types1, types2, types3; + types1[syncer::BOOKMARKS] = "test1"; + types2[syncer::AUTOFILL] = "test2"; + types3[syncer::THEMES] = "test3"; TimeDelta delay = zero(); TimeTicks optimal_time = TimeTicks::Now() + delay; scheduler()->ScheduleNudgeWithPayloadsAsync( @@ -571,9 +570,9 @@ TEST_F(SyncSchedulerTest, NudgeWithPayloadsCoalescing) { ASSERT_EQ(1U, r.snapshots.size()); EXPECT_GE(r.times[0], optimal_time); - syncable::ModelTypePayloadMap coalesced_types; - syncable::CoalescePayloads(&coalesced_types, types1); - syncable::CoalescePayloads(&coalesced_types, types2); + syncer::ModelTypePayloadMap coalesced_types; + syncer::CoalescePayloads(&coalesced_types, types1); + syncer::CoalescePayloads(&coalesced_types, types2); EXPECT_EQ(coalesced_types, r.snapshots[0].source().types); EXPECT_EQ(GetUpdatesCallerInfo::LOCAL, r.snapshots[0].source().updates_source); @@ -679,7 +678,7 @@ TEST_F(SyncSchedulerTest, SessionsCommitDelay) { StartSyncScheduler(SyncScheduler::NORMAL_MODE); EXPECT_EQ(delay1, scheduler()->sessions_commit_delay()); - const ModelTypeSet model_types(syncable::BOOKMARKS); + const ModelTypeSet model_types(syncer::BOOKMARKS); scheduler()->ScheduleNudgeAsync( zero(), NUDGE_SOURCE_LOCAL, model_types, FROM_HERE); RunLoop(); @@ -720,7 +719,7 @@ TEST_F(SyncSchedulerTest, HasMoreToSyncThenFails) { // Test that no syncing occurs when throttled. TEST_F(SyncSchedulerTest, ThrottlingDoesThrottle) { - const ModelTypeSet types(syncable::BOOKMARKS); + const ModelTypeSet types(syncer::BOOKMARKS); TimeDelta poll(TimeDelta::FromMilliseconds(5)); TimeDelta throttle(TimeDelta::FromMinutes(10)); scheduler()->OnReceivedLongPollIntervalUpdate(poll); @@ -775,13 +774,13 @@ TEST_F(SyncSchedulerTest, ConfigurationMode) { StartSyncScheduler(SyncScheduler::CONFIGURATION_MODE); - const ModelTypeSet nudge_types(syncable::AUTOFILL); + const ModelTypeSet nudge_types(syncer::AUTOFILL); scheduler()->ScheduleNudgeAsync( zero(), NUDGE_SOURCE_LOCAL, nudge_types, FROM_HERE); scheduler()->ScheduleNudgeAsync( zero(), NUDGE_SOURCE_LOCAL, nudge_types, FROM_HERE); - const ModelTypeSet config_types(syncable::BOOKMARKS); + const ModelTypeSet config_types(syncer::BOOKMARKS); scheduler()->ScheduleConfiguration( config_types, GetUpdatesCallerInfo::RECONFIGURATION); @@ -849,7 +848,7 @@ TEST_F(BackoffTriggersSyncSchedulerTest, FailDownloadTwice) { TEST_F(SyncSchedulerTest, BackoffDropsJobs) { SyncShareRecords r; TimeDelta poll(TimeDelta::FromMilliseconds(5)); - const ModelTypeSet types(syncable::BOOKMARKS); + const ModelTypeSet types(syncer::BOOKMARKS); scheduler()->OnReceivedLongPollIntervalUpdate(poll); UseMockDelayProvider(); diff --git a/sync/engine/sync_scheduler_whitebox_unittest.cc b/sync/engine/sync_scheduler_whitebox_unittest.cc index 7fb53be..20e1277 100644 --- a/sync/engine/sync_scheduler_whitebox_unittest.cc +++ b/sync/engine/sync_scheduler_whitebox_unittest.cc @@ -32,8 +32,8 @@ class SyncSchedulerWhiteboxTest : public testing::Test { Syncer* syncer = new Syncer(); ModelSafeRoutingInfo routes; - routes[syncable::BOOKMARKS] = GROUP_UI; - routes[syncable::NIGORI] = GROUP_PASSIVE; + routes[syncer::BOOKMARKS] = GROUP_UI; + routes[syncer::NIGORI] = GROUP_PASSIVE; workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_UI))); workers_.push_back(make_scoped_refptr(new FakeModelWorker(GROUP_PASSIVE))); @@ -142,15 +142,15 @@ TEST_F(SyncSchedulerWhiteboxTest, SaveNudge) { TEST_F(SyncSchedulerWhiteboxTest, SaveNudgeWhileTypeThrottled) { InitializeSyncerOnNormalMode(); - syncable::ModelTypeSet types; - types.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet types; + types.Put(syncer::BOOKMARKS); // Mark bookmarks as throttled. context()->throttled_data_type_tracker()->SetUnthrottleTime( types, base::TimeTicks::Now() + base::TimeDelta::FromHours(2)); - syncable::ModelTypePayloadMap types_with_payload; - types_with_payload[syncable::BOOKMARKS] = ""; + syncer::ModelTypePayloadMap types_with_payload; + types_with_payload[syncer::BOOKMARKS] = ""; SyncSourceInfo info(GetUpdatesCallerInfo::LOCAL, types_with_payload); SyncSession* s = scheduler_->CreateSyncSession(info); diff --git a/sync/engine/syncer_proto_util.cc b/sync/engine/syncer_proto_util.cc index 917f644..8a20b95 100644 --- a/sync/engine/syncer_proto_util.cc +++ b/sync/engine/syncer_proto_util.cc @@ -111,9 +111,9 @@ void SyncerProtoUtil::HandleMigrationDoneResponse( sessions::SyncSession* session) { LOG_IF(ERROR, 0 >= response->migrated_data_type_id_size()) << "MIGRATION_DONE but no types specified."; - syncable::ModelTypeSet to_migrate; + syncer::ModelTypeSet to_migrate; for (int i = 0; i < response->migrated_data_type_id_size(); i++) { - to_migrate.Put(syncable::GetModelTypeFromSpecificsFieldNumber( + to_migrate.Put(syncer::GetModelTypeFromSpecificsFieldNumber( response->migrated_data_type_id(i))); } // TODO(akalin): This should be a set union. @@ -303,7 +303,7 @@ syncer::SyncProtocolError ConvertErrorPBToLocalType( DCHECK_EQ(error.error_type(), sync_pb::SyncEnums::THROTTLED); for (int i = 0; i < error.error_data_type_ids_size(); ++i) { sync_protocol_error.error_data_types.Put( - syncable::GetModelTypeFromSpecificsFieldNumber( + syncer::GetModelTypeFromSpecificsFieldNumber( error.error_data_type_ids(i))); } } diff --git a/sync/engine/syncer_proto_util.h b/sync/engine/syncer_proto_util.h index 33fb322..dd75dd5 100644 --- a/sync/engine/syncer_proto_util.h +++ b/sync/engine/syncer_proto_util.h @@ -78,7 +78,7 @@ class SyncerProtoUtil { // EntitySpecifics is used as a filter for the GetUpdates message to tell // the server which datatypes to send back. This adds a datatype so that // it's included in the filter. - static void AddToEntitySpecificDatatypesFilter(syncable::ModelType datatype, + static void AddToEntitySpecificDatatypesFilter(syncer::ModelType datatype, sync_pb::EntitySpecifics* filter); // Get a debug string representation of the client to server response. diff --git a/sync/engine/syncer_proto_util_unittest.cc b/sync/engine/syncer_proto_util_unittest.cc index ff8a733..107dd55 100644 --- a/sync/engine/syncer_proto_util_unittest.cc +++ b/sync/engine/syncer_proto_util_unittest.cc @@ -265,9 +265,9 @@ TEST_F(SyncerProtoUtilTest, HandleThrottlingWithDatatypes) { ThrottledDataTypeTracker tracker(NULL); SyncProtocolError error; error.error_type = syncer::THROTTLED; - syncable::ModelTypeSet types; - types.Put(syncable::BOOKMARKS); - types.Put(syncable::PASSWORDS); + syncer::ModelTypeSet types; + types.Put(syncer::BOOKMARKS); + types.Put(syncer::PASSWORDS); error.error_data_types = types; base::TimeTicks ticks = base::TimeTicks::FromInternalValue(1); diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc index 04811eb..7545e26 100644 --- a/sync/engine/syncer_unittest.cc +++ b/sync/engine/syncer_unittest.cc @@ -153,7 +153,7 @@ class SyncerTest : public testing::Test, void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) { // We're just testing the sync engine here, so we shunt everything to // the SyncerThread. Datatypes which aren't enabled aren't in the map. - for (syncable::ModelTypeSet::Iterator it = enabled_datatypes_.First(); + for (syncer::ModelTypeSet::Iterator it = enabled_datatypes_.First(); it.Good(); it.Inc()) { (*out)[it.Get()] = GROUP_PASSIVE; } @@ -178,7 +178,7 @@ class SyncerTest : public testing::Test, std::vector<ModelSafeWorker*> workers; GetModelSafeRoutingInfo(&info); GetWorkers(&workers); - syncable::ModelTypePayloadMap types = + syncer::ModelTypePayloadMap types = ModelSafeRoutingInfoToPayloadMap(info, std::string()); return new SyncSession(context_.get(), this, sessions::SyncSourceInfo(sync_pb::GetUpdatesCallerInfo::UNKNOWN, types), @@ -218,10 +218,10 @@ class SyncerTest : public testing::Test, virtual void SetUp() { dir_maker_.SetUp(); mock_server_.reset(new MockConnectionManager(directory())); - EnableDatatype(syncable::BOOKMARKS); - EnableDatatype(syncable::NIGORI); - EnableDatatype(syncable::PREFERENCES); - EnableDatatype(syncable::NIGORI); + EnableDatatype(syncer::BOOKMARKS); + EnableDatatype(syncer::NIGORI); + EnableDatatype(syncer::PREFERENCES); + EnableDatatype(syncer::NIGORI); worker_ = new FakeModelWorker(GROUP_PASSIVE); std::vector<SyncEngineEventListener*> listeners; listeners.push_back(this); @@ -280,7 +280,7 @@ class SyncerTest : public testing::Test, EXPECT_EQ("http://demo/", specifics.bookmark().url()); } - bool initial_sync_ended_for_type(syncable::ModelType type) { + bool initial_sync_ended_for_type(syncer::ModelType type) { return directory()->initial_sync_ended_for_type(type); } @@ -297,13 +297,13 @@ class SyncerTest : public testing::Test, } sync_pb::EntitySpecifics DefaultBookmarkSpecifics() { sync_pb::EntitySpecifics result; - AddDefaultFieldValue(syncable::BOOKMARKS, &result); + AddDefaultFieldValue(syncer::BOOKMARKS, &result); return result; } sync_pb::EntitySpecifics DefaultPreferencesSpecifics() { sync_pb::EntitySpecifics result; - AddDefaultFieldValue(syncable::PREFERENCES, &result); + AddDefaultFieldValue(syncer::PREFERENCES, &result); return result; } // Enumeration of alterations to entries for commit ordering tests. @@ -406,8 +406,8 @@ class SyncerTest : public testing::Test, sessions::OrderedCommitSet output_set(routes); GetCommitIdsCommand command(limit, &output_set); std::set<int64> ready_unsynced_set; - command.FilterUnreadyEntries(&wtrans, syncable::ModelTypeSet(), - syncable::ModelTypeSet(), false, + command.FilterUnreadyEntries(&wtrans, syncer::ModelTypeSet(), + syncer::ModelTypeSet(), false, unsynced_handle_view, &ready_unsynced_set); command.BuildCommitIds(session_->write_transaction(), routes, ready_unsynced_set); @@ -458,7 +458,7 @@ class SyncerTest : public testing::Test, return entry.Get(META_HANDLE); } - void EnableDatatype(syncable::ModelType model_type) { + void EnableDatatype(syncer::ModelType model_type) { enabled_datatypes_.Put(model_type); ModelSafeRoutingInfo routing_info; @@ -471,7 +471,7 @@ class SyncerTest : public testing::Test, mock_server_->ExpectGetUpdatesRequestTypes(enabled_datatypes_); } - void DisableDatatype(syncable::ModelType model_type) { + void DisableDatatype(syncer::ModelType model_type) { enabled_datatypes_.Remove(model_type); ModelSafeRoutingInfo routing_info; @@ -559,7 +559,7 @@ class SyncerTest : public testing::Test, base::TimeDelta last_sessions_commit_delay_seconds_; scoped_refptr<ModelSafeWorker> worker_; - syncable::ModelTypeSet enabled_datatypes_; + syncer::ModelTypeSet enabled_datatypes_; syncer::TrafficRecorder traffic_recorder_; DISALLOW_COPY_AND_ASSIGN(SyncerTest); @@ -633,9 +633,9 @@ TEST_F(SyncerTest, GetCommitIdsCommandTruncates) { } TEST_F(SyncerTest, GetCommitIdsFiltersThrottledEntries) { - const syncable::ModelTypeSet throttled_types(syncable::BOOKMARKS); + const syncer::ModelTypeSet throttled_types(syncer::BOOKMARKS); sync_pb::EntitySpecifics bookmark_data; - AddDefaultFieldValue(syncable::BOOKMARKS, &bookmark_data); + AddDefaultFieldValue(syncer::BOOKMARKS, &bookmark_data); mock_server_->AddUpdateDirectory(1, 0, "A", 10, 10); SyncShareNudge(); @@ -688,7 +688,7 @@ TEST_F(SyncerTest, GetCommitIdsFiltersThrottledEntries) { EXPECT_TRUE(is_unsynced == entryA.Get(IS_UNSYNCED)); \ EXPECT_TRUE(is_unapplied == entryA.Get(IS_UNAPPLIED_UPDATE)); \ EXPECT_TRUE(prev_initialized == \ - syncable::IsRealDataType(syncable::GetModelTypeFromSpecifics( \ + syncer::IsRealDataType(syncer::GetModelTypeFromSpecifics( \ entryA.Get(BASE_SERVER_SPECIFICS)))); \ EXPECT_TRUE(parent_id == -1 || \ entryA.Get(PARENT_ID) == id_fac.FromNumber(parent_id)); \ @@ -702,7 +702,7 @@ TEST_F(SyncerTest, GetCommitIdsFiltersUnreadyEntries) { sync_pb::EntitySpecifics bookmark, encrypted_bookmark; bookmark.mutable_bookmark()->set_url("url"); bookmark.mutable_bookmark()->set_title("title"); - AddDefaultFieldValue(syncable::BOOKMARKS, &encrypted_bookmark); + AddDefaultFieldValue(syncer::BOOKMARKS, &encrypted_bookmark); mock_server_->AddUpdateDirectory(1, 0, "A", 10, 10); mock_server_->AddUpdateDirectory(2, 0, "B", 10, 10); mock_server_->AddUpdateDirectory(3, 0, "C", 10, 10); @@ -813,13 +813,13 @@ TEST_F(SyncerTest, EncryptionAwareConflicts) { bookmark.mutable_bookmark()->set_title("title"); other_cryptographer.Encrypt(bookmark, encrypted_bookmark.mutable_encrypted()); - AddDefaultFieldValue(syncable::BOOKMARKS, &encrypted_bookmark); + AddDefaultFieldValue(syncer::BOOKMARKS, &encrypted_bookmark); modified_bookmark.mutable_bookmark()->set_title("title2"); other_cryptographer.Encrypt(modified_bookmark, modified_bookmark.mutable_encrypted()); sync_pb::EntitySpecifics pref, encrypted_pref, modified_pref; pref.mutable_preference()->set_name("name"); - AddDefaultFieldValue(syncable::PREFERENCES, &encrypted_pref); + AddDefaultFieldValue(syncer::PREFERENCES, &encrypted_pref); other_cryptographer.Encrypt(pref, encrypted_pref.mutable_encrypted()); modified_pref.mutable_preference()->set_name("name2"); @@ -990,7 +990,7 @@ TEST_F(SyncerTest, ReceiveOldNigori) { other_encrypted_specifics.mutable_encrypted()); sync_pb::EntitySpecifics our_encrypted_specifics; our_encrypted_specifics.mutable_bookmark()->set_title("title2"); - syncable::ModelTypeSet encrypted_types = syncable::ModelTypeSet::All(); + syncer::ModelTypeSet encrypted_types = syncer::ModelTypeSet::All(); // Receive the initial nigori node. @@ -1015,7 +1015,7 @@ TEST_F(SyncerTest, ReceiveOldNigori) { cryptographer(&wtrans)->set_encrypt_everything(); cryptographer(&wtrans)->UpdateNigoriFromEncryptedTypes(nigori); MutableEntry nigori_entry(&wtrans, GET_BY_SERVER_TAG, - syncable::ModelTypeToRootTag(syncable::NIGORI)); + syncer::ModelTypeToRootTag(syncer::NIGORI)); ASSERT_TRUE(nigori_entry.good()); nigori_entry.Put(SPECIFICS, specifics); nigori_entry.Put(IS_UNSYNCED, true); @@ -1041,7 +1041,7 @@ TEST_F(SyncerTest, ReceiveOldNigori) { // the newest, and the encrypted types should be the most recent syncable::ReadTransaction trans(FROM_HERE, directory()); Entry nigori_entry(&trans, GET_BY_SERVER_TAG, - syncable::ModelTypeToRootTag(syncable::NIGORI)); + syncer::ModelTypeToRootTag(syncer::NIGORI)); ASSERT_TRUE(nigori_entry.good()); EXPECT_FALSE(nigori_entry.Get(IS_UNAPPLIED_UPDATE)); EXPECT_FALSE(nigori_entry.Get(IS_UNSYNCED)); @@ -1066,7 +1066,7 @@ TEST_F(SyncerTest, NigoriConflicts) { KeyParams other_key_params = {"localhost", "dummy", "foobar"}; syncer::Cryptographer other_cryptographer(&encryptor_); other_cryptographer.AddKey(other_key_params); - syncable::ModelTypeSet encrypted_types(syncable::PASSWORDS, syncable::NIGORI); + syncer::ModelTypeSet encrypted_types(syncer::PASSWORDS, syncer::NIGORI); sync_pb::EntitySpecifics initial_nigori_specifics; initial_nigori_specifics.mutable_nigori(); mock_server_->SetNigori(1, 10, 10, initial_nigori_specifics); @@ -1082,7 +1082,7 @@ TEST_F(SyncerTest, NigoriConflicts) { // Receive the initial nigori node. SyncShareNudge(); - encrypted_types = syncable::ModelTypeSet::All(); + encrypted_types = syncer::ModelTypeSet::All(); { // Local changes with different passphrase, different types. WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); @@ -1097,7 +1097,7 @@ TEST_F(SyncerTest, NigoriConflicts) { cryptographer(&wtrans)->UpdateNigoriFromEncryptedTypes(nigori); cryptographer(&wtrans)->set_encrypt_everything(); MutableEntry nigori_entry(&wtrans, GET_BY_SERVER_TAG, - syncable::ModelTypeToRootTag(syncable::NIGORI)); + syncer::ModelTypeToRootTag(syncer::NIGORI)); ASSERT_TRUE(nigori_entry.good()); nigori_entry.Put(SPECIFICS, specifics); nigori_entry.Put(IS_UNSYNCED, true); @@ -1127,7 +1127,7 @@ TEST_F(SyncerTest, NigoriConflicts) { // Ensure the nigori data merged (encrypted types). WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); MutableEntry nigori_entry(&wtrans, GET_BY_SERVER_TAG, - syncable::ModelTypeToRootTag(syncable::NIGORI)); + syncer::ModelTypeToRootTag(syncer::NIGORI)); ASSERT_TRUE(nigori_entry.good()); EXPECT_FALSE(nigori_entry.Get(IS_UNAPPLIED_UPDATE)); EXPECT_FALSE(nigori_entry.Get(IS_UNSYNCED)); @@ -1158,7 +1158,7 @@ TEST_F(SyncerTest, NigoriConflicts) { // should have been unioned. WriteTransaction wtrans(FROM_HERE, UNITTEST, directory()); MutableEntry nigori_entry(&wtrans, GET_BY_SERVER_TAG, - syncable::ModelTypeToRootTag(syncable::NIGORI)); + syncer::ModelTypeToRootTag(syncer::NIGORI)); ASSERT_TRUE(nigori_entry.good()); EXPECT_FALSE(nigori_entry.Get(IS_UNAPPLIED_UPDATE)); EXPECT_FALSE(nigori_entry.Get(IS_UNSYNCED)); @@ -1234,7 +1234,7 @@ TEST_F(SyncerTest, TestPurgeWhileUnsynced) { } directory()->PurgeEntriesWithTypeIn( - syncable::ModelTypeSet(syncable::PREFERENCES)); + syncer::ModelTypeSet(syncer::PREFERENCES)); SyncShareNudge(); ASSERT_EQ(2U, mock_server_->committed_ids().size()); @@ -1269,7 +1269,7 @@ TEST_F(SyncerTest, TestPurgeWhileUnapplied) { } directory()->PurgeEntriesWithTypeIn( - syncable::ModelTypeSet(syncable::BOOKMARKS)); + syncer::ModelTypeSet(syncer::BOOKMARKS)); SyncShareNudge(); directory()->SaveChanges(); @@ -2464,8 +2464,7 @@ TEST_F(SyncerTest, CommitsUpdateDoesntAlterEntry) { } TEST_F(SyncerTest, ParentAndChildBothMatch) { - const syncable::FullModelTypeSet all_types = - syncable::FullModelTypeSet::All(); + const syncer::FullModelTypeSet all_types = syncer::FullModelTypeSet::All(); syncable::Id parent_id = ids_.NewServerId(); syncable::Id child_id = ids_.NewServerId(); @@ -4019,28 +4018,28 @@ TEST_F(SyncerTest, GetUpdatesSetsRequestedTypes) { // The expectations of this test happen in the MockConnectionManager's // GetUpdates handler. EnableDatatype sets the expectation value from our // set of enabled/disabled datatypes. - EnableDatatype(syncable::BOOKMARKS); + EnableDatatype(syncer::BOOKMARKS); SyncShareNudge(); EXPECT_EQ(1, mock_server_->GetAndClearNumGetUpdatesRequests()); - EnableDatatype(syncable::AUTOFILL); + EnableDatatype(syncer::AUTOFILL); SyncShareNudge(); EXPECT_EQ(1, mock_server_->GetAndClearNumGetUpdatesRequests()); - EnableDatatype(syncable::PREFERENCES); + EnableDatatype(syncer::PREFERENCES); SyncShareNudge(); EXPECT_EQ(1, mock_server_->GetAndClearNumGetUpdatesRequests()); - DisableDatatype(syncable::BOOKMARKS); + DisableDatatype(syncer::BOOKMARKS); SyncShareNudge(); EXPECT_EQ(1, mock_server_->GetAndClearNumGetUpdatesRequests()); - DisableDatatype(syncable::AUTOFILL); + DisableDatatype(syncer::AUTOFILL); SyncShareNudge(); EXPECT_EQ(1, mock_server_->GetAndClearNumGetUpdatesRequests()); - DisableDatatype(syncable::PREFERENCES); - EnableDatatype(syncable::AUTOFILL); + DisableDatatype(syncer::PREFERENCES); + EnableDatatype(syncer::AUTOFILL); SyncShareNudge(); EXPECT_EQ(1, mock_server_->GetAndClearNumGetUpdatesRequests()); } @@ -4099,7 +4098,7 @@ TEST_F(SyncerTest, UpdateFailsThenDontCommit) { // Downloads two updates and applies them successfully. // This is the "happy path" alternative to ConfigureFailsDontApplyUpdates. TEST_F(SyncerTest, ConfigureDownloadsTwoBatchesSuccess) { - EXPECT_FALSE(initial_sync_ended_for_type(syncable::BOOKMARKS)); + EXPECT_FALSE(initial_sync_ended_for_type(syncer::BOOKMARKS)); syncable::Id node1 = ids_.NewServerId(); syncable::Id node2 = ids_.NewServerId(); @@ -4125,12 +4124,12 @@ TEST_F(SyncerTest, ConfigureDownloadsTwoBatchesSuccess) { ASSERT_TRUE(n2.good()); EXPECT_FALSE(n2.Get(IS_UNAPPLIED_UPDATE)); - EXPECT_TRUE(initial_sync_ended_for_type(syncable::BOOKMARKS)); + EXPECT_TRUE(initial_sync_ended_for_type(syncer::BOOKMARKS)); } // Same as the above case, but this time the second batch fails to download. TEST_F(SyncerTest, ConfigureFailsDontApplyUpdates) { - EXPECT_FALSE(initial_sync_ended_for_type(syncable::BOOKMARKS)); + EXPECT_FALSE(initial_sync_ended_for_type(syncer::BOOKMARKS)); syncable::Id node1 = ids_.NewServerId(); syncable::Id node2 = ids_.NewServerId(); @@ -4165,7 +4164,7 @@ TEST_F(SyncerTest, ConfigureFailsDontApplyUpdates) { // One update remains undownloaded. mock_server_->ClearUpdatesQueue(); - EXPECT_FALSE(initial_sync_ended_for_type(syncable::BOOKMARKS)); + EXPECT_FALSE(initial_sync_ended_for_type(syncer::BOOKMARKS)); } // Test what happens if a client deletes, then recreates, an object very diff --git a/sync/engine/syncer_util.cc b/sync/engine/syncer_util.cc index 821b07c..d50f487 100644 --- a/sync/engine/syncer_util.cc +++ b/sync/engine/syncer_util.cc @@ -250,7 +250,7 @@ UpdateAttemptResponse AttemptToUpdateEntry( !cryptographer->CanDecrypt(specifics.encrypted())) { // We can't decrypt this node yet. DVLOG(1) << "Received an undecryptable " - << syncable::ModelTypeToString(entry->GetServerModelType()) + << syncer::ModelTypeToString(entry->GetServerModelType()) << " update, returning encryption_conflict."; return CONFLICT_ENCRYPTION; } else if (specifics.has_password() && @@ -302,11 +302,11 @@ UpdateAttemptResponse AttemptToUpdateEntry( if (specifics.has_encrypted()) { DVLOG(2) << "Received a decryptable " - << syncable::ModelTypeToString(entry->GetServerModelType()) + << syncer::ModelTypeToString(entry->GetServerModelType()) << " update, applying normally."; } else { DVLOG(2) << "Received an unencrypted " - << syncable::ModelTypeToString(entry->GetServerModelType()) + << syncer::ModelTypeToString(entry->GetServerModelType()) << " update, applying normally."; } @@ -386,7 +386,7 @@ void UpdateServerFieldsFromUpdate( } // Store the datatype-specific part as a protobuf. if (update.has_specifics()) { - DCHECK(update.GetModelType() != syncable::UNSPECIFIED) + DCHECK(update.GetModelType() != syncer::UNSPECIFIED) << "Storing unrecognized datatype in sync database."; target->Put(SERVER_SPECIFICS, update.specifics()); } else if (update.has_bookmarkdata()) { @@ -595,7 +595,7 @@ VerifyResult VerifyUpdateConsistency( syncable::MutableEntry* target, const bool deleted, const bool is_directory, - syncable::ModelType model_type) { + syncer::ModelType model_type) { CHECK(target->good()); @@ -603,7 +603,7 @@ VerifyResult VerifyUpdateConsistency( if (deleted) return VERIFY_SUCCESS; - if (model_type == syncable::UNSPECIFIED) { + if (model_type == syncer::UNSPECIFIED) { // This update is to an item of a datatype we don't recognize. The server // shouldn't have sent it to us. Throw it on the ground. return VERIFY_SKIP; diff --git a/sync/engine/syncer_util.h b/sync/engine/syncer_util.h index 5a455e8..9e270a1 100644 --- a/sync/engine/syncer_util.h +++ b/sync/engine/syncer_util.h @@ -75,7 +75,7 @@ VerifyResult VerifyUpdateConsistency(syncable::WriteTransaction* trans, syncable::MutableEntry* target, const bool deleted, const bool is_directory, - syncable::ModelType model_type); + syncer::ModelType model_type); // Assumes we have an existing entry; verify an update that seems to be // expressing an 'undelete' diff --git a/sync/engine/syncproto.h b/sync/engine/syncproto.h index eb9bc77..9100ee5 100644 --- a/sync/engine/syncproto.h +++ b/sync/engine/syncproto.h @@ -60,8 +60,8 @@ class SyncEntity : public IdWrapper<sync_pb::SyncEntity> { (has_bookmarkdata() && bookmarkdata().bookmark_folder())); } - syncable::ModelType GetModelType() const { - return syncable::GetModelType(*this); + syncer::ModelType GetModelType() const { + return syncer::GetModelType(*this); } }; diff --git a/sync/engine/throttled_data_type_tracker.cc b/sync/engine/throttled_data_type_tracker.cc index c41cb6f..42d1246 100644 --- a/sync/engine/throttled_data_type_tracker.cc +++ b/sync/engine/throttled_data_type_tracker.cc @@ -12,15 +12,15 @@ namespace syncer { ThrottledDataTypeTracker::ThrottledDataTypeTracker(AllStatus *allstatus) : allstatus_(allstatus) { if (allstatus_) { - allstatus_->SetThrottledTypes(syncable::ModelTypeSet()); + allstatus_->SetThrottledTypes(syncer::ModelTypeSet()); } } ThrottledDataTypeTracker::~ThrottledDataTypeTracker() { } -void ThrottledDataTypeTracker::SetUnthrottleTime(syncable::ModelTypeSet types, +void ThrottledDataTypeTracker::SetUnthrottleTime(syncer::ModelTypeSet types, const base::TimeTicks& time) { - for (syncable::ModelTypeSet::Iterator it = types.First(); + for (syncer::ModelTypeSet::Iterator it = types.First(); it.Good(); it.Inc()) { unthrottle_times_[it.Get()] = time; } @@ -60,8 +60,8 @@ void ThrottledDataTypeTracker::PruneUnthrottledTypes( } } -syncable::ModelTypeSet ThrottledDataTypeTracker::GetThrottledTypes() const { - syncable::ModelTypeSet types; +syncer::ModelTypeSet ThrottledDataTypeTracker::GetThrottledTypes() const { + syncer::ModelTypeSet types; for (UnthrottleTimes::const_iterator it = unthrottle_times_.begin(); it != unthrottle_times_.end(); ++it) { types.Put(it->first); diff --git a/sync/engine/throttled_data_type_tracker.h b/sync/engine/throttled_data_type_tracker.h index 1441973..9e1eb6a 100644 --- a/sync/engine/throttled_data_type_tracker.h +++ b/sync/engine/throttled_data_type_tracker.h @@ -23,7 +23,7 @@ class ThrottledDataTypeTracker { ~ThrottledDataTypeTracker(); // Throttles a set of data types until the specified time is reached. - void SetUnthrottleTime(syncable::ModelTypeSet types, + void SetUnthrottleTime(syncer::ModelTypeSet types, const base::TimeTicks& time); // Given an input of the current time (usually from time::Now()), removes from @@ -31,7 +31,7 @@ class ThrottledDataTypeTracker { void PruneUnthrottledTypes(const base::TimeTicks& time); // Returns the set of types which are currently throttled. - syncable::ModelTypeSet GetThrottledTypes() const; + syncer::ModelTypeSet GetThrottledTypes() const; private: FRIEND_TEST_ALL_PREFIXES(ThrottledDataTypeTrackerTest, @@ -39,7 +39,7 @@ class ThrottledDataTypeTracker { FRIEND_TEST_ALL_PREFIXES(ThrottledDataTypeTrackerTest, GetCurrentlyThrottledTypesTest); - typedef std::map<syncable::ModelType, base::TimeTicks> UnthrottleTimes; + typedef std::map<syncer::ModelType, base::TimeTicks> UnthrottleTimes; // This is a map from throttled data types to the time at which they can be // unthrottled. diff --git a/sync/engine/throttled_data_type_tracker_unittest.cc b/sync/engine/throttled_data_type_tracker_unittest.cc index 54a600f..011fdff 100644 --- a/sync/engine/throttled_data_type_tracker_unittest.cc +++ b/sync/engine/throttled_data_type_tracker_unittest.cc @@ -13,19 +13,19 @@ using base::TimeTicks; namespace syncer { TEST(ThrottledDataTypeTrackerTest, AddUnthrottleTimeTest) { - const syncable::ModelTypeSet types(syncable::BOOKMARKS, syncable::PASSWORDS); + const syncer::ModelTypeSet types(syncer::BOOKMARKS, syncer::PASSWORDS); ThrottledDataTypeTracker throttler(NULL); TimeTicks now = TimeTicks::Now(); throttler.SetUnthrottleTime(types, now); EXPECT_EQ(throttler.unthrottle_times_.size(), 2U); - EXPECT_EQ(throttler.unthrottle_times_[syncable::BOOKMARKS], now); - EXPECT_EQ(throttler.unthrottle_times_[syncable::PASSWORDS], now); + EXPECT_EQ(throttler.unthrottle_times_[syncer::BOOKMARKS], now); + EXPECT_EQ(throttler.unthrottle_times_[syncer::PASSWORDS], now); } TEST(ThrottledDataTypeTrackerTest, GetCurrentlyThrottledTypesTest) { - const syncable::ModelTypeSet types(syncable::BOOKMARKS, syncable::PASSWORDS); + const syncer::ModelTypeSet types(syncer::BOOKMARKS, syncer::PASSWORDS); ThrottledDataTypeTracker throttler(NULL); TimeTicks now = TimeTicks::Now(); @@ -44,8 +44,8 @@ TEST(ThrottledDataTypeTrackerTest, GetCurrentlyThrottledTypesTest) { // Have two data types whose throttling is set to expire at different times. TEST(ThrottledDataTypeTrackerTest, UnthrottleSomeTypesTest) { - const syncable::ModelTypeSet long_throttled(syncable::BOOKMARKS); - const syncable::ModelTypeSet short_throttled(syncable::PASSWORDS); + const syncer::ModelTypeSet long_throttled(syncer::BOOKMARKS); + const syncer::ModelTypeSet short_throttled(syncer::PASSWORDS); const TimeTicks start_time = TimeTicks::Now(); const TimeTicks short_throttle_time = start_time + TimeDelta::FromSeconds(1); diff --git a/sync/engine/update_applicator.cc b/sync/engine/update_applicator.cc index 72d2dec..03ae08d 100644 --- a/sync/engine/update_applicator.cc +++ b/sync/engine/update_applicator.cc @@ -101,7 +101,7 @@ void UpdateApplicator::Advance() { } bool UpdateApplicator::SkipUpdate(const syncable::Entry& entry) { - syncable::ModelType type = entry.GetServerModelType(); + syncer::ModelType type = entry.GetServerModelType(); ModelSafeGroup g = GetGroupForModelType(type, routing_info_); // The set of updates passed to the UpdateApplicator should already // be group-filtered. @@ -111,8 +111,8 @@ bool UpdateApplicator::SkipUpdate(const syncable::Entry& entry) { } if (g == GROUP_PASSIVE && !routing_info_.count(type) && - type != syncable::UNSPECIFIED && - type != syncable::TOP_LEVEL_FOLDER) { + type != syncer::UNSPECIFIED && + type != syncer::TOP_LEVEL_FOLDER) { DVLOG(1) << "Skipping update application, type not permitted."; return true; } diff --git a/sync/engine/verify_updates_command.cc b/sync/engine/verify_updates_command.cc index abb3db8..0446924 100644 --- a/sync/engine/verify_updates_command.cc +++ b/sync/engine/verify_updates_command.cc @@ -21,7 +21,7 @@ namespace syncer { using syncable::GET_BY_ID; -using syncable::ModelTypeSet; +using syncer::ModelTypeSet; using syncable::SYNCER; using syncable::WriteTransaction; @@ -84,7 +84,7 @@ std::set<ModelSafeGroup> VerifyUpdatesCommand::GetGroupsToChange( session.status_controller().updates_response().get_updates(); for (int i = 0; i < updates.entries().size(); i++) { groups_with_updates.insert( - GetGroupForModelType(syncable::GetModelType(updates.entries(i)), + GetGroupForModelType(syncer::GetModelType(updates.entries(i)), session.routing_info())); } @@ -135,7 +135,7 @@ VerifyUpdatesCommand::VerifyUpdateResult VerifyUpdatesCommand::VerifyUpdate( const bool deleted = entry.has_deleted() && entry.deleted(); const bool is_directory = entry.IsFolder(); - const syncable::ModelType model_type = entry.GetModelType(); + const syncer::ModelType model_type = entry.GetModelType(); if (!id.ServerKnows()) { LOG(ERROR) << "Illegal negative id in received updates"; @@ -152,8 +152,8 @@ VerifyUpdatesCommand::VerifyUpdateResult VerifyUpdatesCommand::VerifyUpdate( syncable::MutableEntry same_id(trans, GET_BY_ID, id); result.value = VerifyNewEntry(entry, &same_id, deleted); - syncable::ModelType placement_type = !deleted ? entry.GetModelType() - : same_id.good() ? same_id.GetModelType() : syncable::UNSPECIFIED; + syncer::ModelType placement_type = !deleted ? entry.GetModelType() + : same_id.good() ? same_id.GetModelType() : syncer::UNSPECIFIED; result.placement = GetGroupForModelType(placement_type, routes); if (VERIFY_UNDECIDED == result.value) { diff --git a/sync/engine/verify_updates_command.h b/sync/engine/verify_updates_command.h index cc11935..07cf48c 100644 --- a/sync/engine/verify_updates_command.h +++ b/sync/engine/verify_updates_command.h @@ -40,7 +40,7 @@ class VerifyUpdatesCommand : public ModelChangingSyncerCommand { }; VerifyUpdateResult VerifyUpdate(syncable::WriteTransaction* trans, const SyncEntity& entry, - const syncable::ModelTypeSet& requested_types, + const syncer::ModelTypeSet& requested_types, const ModelSafeRoutingInfo& routes); DISALLOW_COPY_AND_ASSIGN(VerifyUpdatesCommand); }; diff --git a/sync/engine/verify_updates_command_unittest.cc b/sync/engine/verify_updates_command_unittest.cc index afbc784..8bf9ead 100644 --- a/sync/engine/verify_updates_command_unittest.cc +++ b/sync/engine/verify_updates_command_unittest.cc @@ -29,15 +29,15 @@ class VerifyUpdatesCommandTest : public SyncerCommandTest { mutable_routing_info()->clear(); workers()->push_back(make_scoped_refptr(new FakeModelWorker(GROUP_DB))); workers()->push_back(make_scoped_refptr(new FakeModelWorker(GROUP_UI))); - (*mutable_routing_info())[syncable::PREFERENCES] = GROUP_UI; - (*mutable_routing_info())[syncable::BOOKMARKS] = GROUP_UI; - (*mutable_routing_info())[syncable::AUTOFILL] = GROUP_DB; + (*mutable_routing_info())[syncer::PREFERENCES] = GROUP_UI; + (*mutable_routing_info())[syncer::BOOKMARKS] = GROUP_UI; + (*mutable_routing_info())[syncer::AUTOFILL] = GROUP_DB; SyncerCommandTest::SetUp(); } void CreateLocalItem(const std::string& item_id, const std::string& parent_id, - const syncable::ModelType& type) { + const syncer::ModelType& type) { WriteTransaction trans(FROM_HERE, UNITTEST, directory()); MutableEntry entry(&trans, syncable::CREATE_NEW_UPDATE_ITEM, Id::CreateFromServerId(item_id)); @@ -54,7 +54,7 @@ class VerifyUpdatesCommandTest : public SyncerCommandTest { void AddUpdate(GetUpdatesResponse* updates, const std::string& id, const std::string& parent, - const syncable::ModelType& type) { + const syncer::ModelType& type) { sync_pb::SyncEntity* e = updates->add_entries(); e->set_id_string("b1"); e->set_parent_id_string(parent); @@ -70,19 +70,19 @@ class VerifyUpdatesCommandTest : public SyncerCommandTest { TEST_F(VerifyUpdatesCommandTest, AllVerified) { string root = syncable::GetNullId().GetServerId(); - CreateLocalItem("b1", root, syncable::BOOKMARKS); - CreateLocalItem("b2", root, syncable::BOOKMARKS); - CreateLocalItem("p1", root, syncable::PREFERENCES); - CreateLocalItem("a1", root, syncable::AUTOFILL); + CreateLocalItem("b1", root, syncer::BOOKMARKS); + CreateLocalItem("b2", root, syncer::BOOKMARKS); + CreateLocalItem("p1", root, syncer::PREFERENCES); + CreateLocalItem("a1", root, syncer::AUTOFILL); ExpectNoGroupsToChange(command_); GetUpdatesResponse* updates = session()->mutable_status_controller()-> mutable_updates_response()->mutable_get_updates(); - AddUpdate(updates, "b1", root, syncable::BOOKMARKS); - AddUpdate(updates, "b2", root, syncable::BOOKMARKS); - AddUpdate(updates, "p1", root, syncable::PREFERENCES); - AddUpdate(updates, "a1", root, syncable::AUTOFILL); + AddUpdate(updates, "b1", root, syncer::BOOKMARKS); + AddUpdate(updates, "b2", root, syncer::BOOKMARKS); + AddUpdate(updates, "p1", root, syncer::PREFERENCES); + AddUpdate(updates, "a1", root, syncer::AUTOFILL); ExpectGroupsToChange(command_, GROUP_UI, GROUP_DB); |