diff options
308 files changed, 2602 insertions, 2764 deletions
diff --git a/chrome/browser/autofill/autofill_manager.cc b/chrome/browser/autofill/autofill_manager.cc index 99aeb1d..8a27cca 100644 --- a/chrome/browser/autofill/autofill_manager.cc +++ b/chrome/browser/autofill/autofill_manager.cc @@ -39,8 +39,8 @@ #include "chrome/browser/password_manager/password_manager.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" -#include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/sync/profile_sync_service.h" +#include "chrome/browser/sync/profile_sync_service_factory.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_finder.h" #include "chrome/browser/ui/browser_window.h" @@ -257,10 +257,9 @@ void AutofillManager::UpdatePasswordGenerationState( bool password_sync_enabled = false; if (service) { - syncable::ModelTypeSet sync_set = service->GetPreferredDataTypes(); + syncer::ModelTypeSet sync_set = service->GetPreferredDataTypes(); password_sync_enabled = - service->HasSyncSetupCompleted() && - sync_set.Has(syncable::PASSWORDS); + service->HasSyncSetupCompleted() && sync_set.Has(syncer::PASSWORDS); } bool password_manager_enabled = diff --git a/chrome/browser/autofill/autofill_manager_unittest.cc b/chrome/browser/autofill/autofill_manager_unittest.cc index fb18842..25d1c82 100644 --- a/chrome/browser/autofill/autofill_manager_unittest.cc +++ b/chrome/browser/autofill/autofill_manager_unittest.cc @@ -2930,16 +2930,16 @@ TEST_F(AutofillManagerTest, UpdatePasswordSyncState) { ProfileSyncService* sync_service = ProfileSyncServiceFactory::GetForProfile( profile()); sync_service->SetSyncSetupCompleted(); - syncable::ModelTypeSet preferred_set; - preferred_set.Put(syncable::EXTENSIONS); - preferred_set.Put(syncable::PREFERENCES); + syncer::ModelTypeSet preferred_set; + preferred_set.Put(syncer::EXTENSIONS); + preferred_set.Put(syncer::PREFERENCES); sync_service->ChangePreferredDataTypes(preferred_set); - syncable::ModelTypeSet new_set = sync_service->GetPreferredDataTypes(); + syncer::ModelTypeSet new_set = sync_service->GetPreferredDataTypes(); UpdatePasswordGenerationState(false); EXPECT_EQ(0u, autofill_manager_->GetSentStates().size()); // Now sync passwords. - preferred_set.Put(syncable::PASSWORDS); + preferred_set.Put(syncer::PASSWORDS); sync_service->ChangePreferredDataTypes(preferred_set); UpdatePasswordGenerationState(false); EXPECT_EQ(1u, autofill_manager_->GetSentStates().size()); @@ -2947,7 +2947,7 @@ TEST_F(AutofillManagerTest, UpdatePasswordSyncState) { autofill_manager_->ClearSentStates(); // Add some additional synced state. Nothing should be sent. - preferred_set.Put(syncable::THEMES); + preferred_set.Put(syncer::THEMES); sync_service->ChangePreferredDataTypes(preferred_set); UpdatePasswordGenerationState(false); EXPECT_EQ(0u, autofill_manager_->GetSentStates().size()); @@ -2981,8 +2981,8 @@ TEST_F(AutofillManagerTest, UpdatePasswordGenerationState) { ProfileSyncService* sync_service = ProfileSyncServiceFactory::GetForProfile( profile()); sync_service->SetSyncSetupCompleted(); - syncable::ModelTypeSet preferred_set; - preferred_set.Put(syncable::PASSWORDS); + syncer::ModelTypeSet preferred_set; + preferred_set.Put(syncer::PASSWORDS); sync_service->ChangePreferredDataTypes(preferred_set); // Enabled state remains false, should not sent. diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 45a6689..17811f62 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -4845,12 +4845,12 @@ void TestingAutomationProvider::GetSyncInfo(Browser* browser, sync_info->SetString("last synced", service->GetLastSyncedTimeString()); sync_info->SetInteger("updates received", status.updates_received); ListValue* synced_datatype_list = new ListValue; - const syncable::ModelTypeSet synced_datatypes = + const syncer::ModelTypeSet synced_datatypes = service->GetPreferredDataTypes(); - for (syncable::ModelTypeSet::Iterator it = synced_datatypes.First(); + for (syncer::ModelTypeSet::Iterator it = synced_datatypes.First(); it.Good(); it.Inc()) { synced_datatype_list->Append( - new StringValue(syncable::ModelTypeToString(it.Get()))); + new StringValue(syncer::ModelTypeToString(it.Get()))); } sync_info->Set("synced datatypes", synced_datatype_list); } @@ -4951,9 +4951,9 @@ void TestingAutomationProvider::EnableSyncForDatatypes( for (int i = 0; i < num_datatypes; ++i) { std::string datatype_string; datatypes->GetString(i, &datatype_string); - syncable::ModelType datatype = - syncable::ModelTypeFromString(datatype_string); - if (datatype == syncable::UNSPECIFIED) { + syncer::ModelType datatype = + syncer::ModelTypeFromString(datatype_string); + if (datatype == syncer::UNSPECIFIED) { AutomationJSONReply(this, reply_message).SendError(StringPrintf( "Invalid datatype string: %s.", datatype_string.c_str())); return; @@ -5000,9 +5000,9 @@ void TestingAutomationProvider::DisableSyncForDatatypes( for (int i = 0; i < num_datatypes; i++) { std::string datatype_string; datatypes->GetString(i, &datatype_string); - syncable::ModelType datatype = - syncable::ModelTypeFromString(datatype_string); - if (datatype == syncable::UNSPECIFIED) { + syncer::ModelType datatype = + syncer::ModelTypeFromString(datatype_string); + if (datatype == syncer::UNSPECIFIED) { AutomationJSONReply(this, reply_message).SendError(StringPrintf( "Invalid datatype string: %s.", datatype_string.c_str())); return; diff --git a/chrome/browser/extensions/app_notification_manager.cc b/chrome/browser/extensions/app_notification_manager.cc index cf598e6..6b1566a 100644 --- a/chrome/browser/extensions/app_notification_manager.cc +++ b/chrome/browser/extensions/app_notification_manager.cc @@ -179,10 +179,10 @@ void AppNotificationManager::Observe( } syncer::SyncDataList AppNotificationManager::GetAllSyncData( - syncable::ModelType type) const { + syncer::ModelType type) const { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(loaded()); - DCHECK_EQ(syncable::APP_NOTIFICATIONS, type); + DCHECK_EQ(syncer::APP_NOTIFICATIONS, type); syncer::SyncDataList data; for (NotificationMap::const_iterator iter = notifications_->begin(); iter != notifications_->end(); ++iter) { @@ -219,7 +219,7 @@ syncer::SyncError AppNotificationManager::ProcessSyncChanges( for (syncer::SyncChangeList::const_iterator iter = change_list.begin(); iter != change_list.end(); ++iter) { syncer::SyncData sync_data = iter->sync_data(); - DCHECK_EQ(syncable::APP_NOTIFICATIONS, sync_data.GetDataType()); + DCHECK_EQ(syncer::APP_NOTIFICATIONS, sync_data.GetDataType()); syncer::SyncChange::SyncChangeType change_type = iter->change_type(); scoped_ptr<AppNotification> new_notif(CreateNotificationFromSyncData( @@ -284,7 +284,7 @@ syncer::SyncError AppNotificationManager::ProcessSyncChanges( } syncer::SyncError AppNotificationManager::MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) { @@ -293,7 +293,7 @@ syncer::SyncError AppNotificationManager::MergeDataAndStartSyncing( // this method is called by waiting until the load notification is received // from AppNotificationManager. DCHECK(loaded()); - DCHECK_EQ(type, syncable::APP_NOTIFICATIONS); + DCHECK_EQ(type, syncer::APP_NOTIFICATIONS); DCHECK(!sync_processor_.get()); DCHECK(sync_processor.get()); DCHECK(sync_error_factory.get()); @@ -305,13 +305,13 @@ syncer::SyncError AppNotificationManager::MergeDataAndStartSyncing( AutoReset<bool> processing_changes(&processing_syncer_changes_, true); SyncDataMap local_data_map; - PopulateGuidToSyncDataMap(GetAllSyncData(syncable::APP_NOTIFICATIONS), + PopulateGuidToSyncDataMap(GetAllSyncData(syncer::APP_NOTIFICATIONS), &local_data_map); for (syncer::SyncDataList::const_iterator iter = initial_sync_data.begin(); iter != initial_sync_data.end(); ++iter) { const syncer::SyncData& sync_data = *iter; - DCHECK_EQ(syncable::APP_NOTIFICATIONS, sync_data.GetDataType()); + DCHECK_EQ(syncer::APP_NOTIFICATIONS, sync_data.GetDataType()); scoped_ptr<AppNotification> sync_notif(CreateNotificationFromSyncData( sync_data)); CHECK(sync_notif.get()); @@ -348,8 +348,8 @@ syncer::SyncError AppNotificationManager::MergeDataAndStartSyncing( return error; } -void AppNotificationManager::StopSyncing(syncable::ModelType type) { - DCHECK_EQ(type, syncable::APP_NOTIFICATIONS); +void AppNotificationManager::StopSyncing(syncer::ModelType type) { + DCHECK_EQ(type, syncer::APP_NOTIFICATIONS); models_associated_ = false; sync_processor_.reset(); sync_error_factory_.reset(); diff --git a/chrome/browser/extensions/app_notification_manager.h b/chrome/browser/extensions/app_notification_manager.h index 74104f3..8bffbdd 100644 --- a/chrome/browser/extensions/app_notification_manager.h +++ b/chrome/browser/extensions/app_notification_manager.h @@ -68,7 +68,7 @@ class AppNotificationManager // Returns all syncable notifications from this model as syncer::SyncData. virtual syncer::SyncDataList GetAllSyncData( - syncable::ModelType type) const OVERRIDE; + syncer::ModelType type) const OVERRIDE; // Process notifications related changes from Sync, merging them into // our model. virtual syncer::SyncError ProcessSyncChanges( @@ -76,11 +76,11 @@ class AppNotificationManager const syncer::SyncChangeList& change_list) OVERRIDE; // Associate and merge sync data model with our data model. virtual syncer::SyncError MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; - virtual void StopSyncing(syncable::ModelType type) OVERRIDE; + virtual void StopSyncing(syncer::ModelType type) OVERRIDE; private: friend class AppNotificationManagerSyncTest; diff --git a/chrome/browser/extensions/app_notification_manager_sync_unittest.cc b/chrome/browser/extensions/app_notification_manager_sync_unittest.cc index 841754e..f032b82 100644 --- a/chrome/browser/extensions/app_notification_manager_sync_unittest.cc +++ b/chrome/browser/extensions/app_notification_manager_sync_unittest.cc @@ -263,7 +263,7 @@ TEST_F(AppNotificationManagerSyncTest, GetAllSyncDataNoLocal) { model()->Add(CreateNotification(2)); model()->Add(CreateNotification(3)); syncer::SyncDataList all_sync_data = - model()->GetAllSyncData(syncable::APP_NOTIFICATIONS); + model()->GetAllSyncData(syncer::APP_NOTIFICATIONS); EXPECT_EQ(3U, all_sync_data.size()); @@ -288,7 +288,7 @@ TEST_F(AppNotificationManagerSyncTest, GetAllSyncDataSomeLocal) { model()->Add(CreateNotification(true, 4)); model()->Add(CreateNotification(5)); syncer::SyncDataList all_sync_data = - model()->GetAllSyncData(syncable::APP_NOTIFICATIONS); + model()->GetAllSyncData(syncer::APP_NOTIFICATIONS); EXPECT_EQ(3U, all_sync_data.size()); @@ -307,12 +307,12 @@ TEST_F(AppNotificationManagerSyncTest, GetAllSyncDataSomeLocal) { // Model assocation: both models are empty. TEST_F(AppNotificationManagerSyncTest, ModelAssocBothEmpty) { model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, syncer::SyncDataList(), // Empty. PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); - EXPECT_EQ(0U, model()->GetAllSyncData(syncable::APP_NOTIFICATIONS).size()); + EXPECT_EQ(0U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); EXPECT_EQ(0U, processor()->change_list_size()); } @@ -325,12 +325,12 @@ TEST_F(AppNotificationManagerSyncTest, ModelAssocModelEmpty) { initial_data.push_back(CreateSyncData(4)); model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, initial_data, PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); - EXPECT_EQ(4U, model()->GetAllSyncData(syncable::APP_NOTIFICATIONS).size()); + EXPECT_EQ(4U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); // Model should all of the initial sync data. for (syncer::SyncDataList::const_iterator iter = initial_data.begin(); iter != initial_data.end(); ++iter) { @@ -363,12 +363,12 @@ TEST_F(AppNotificationManagerSyncTest, ModelAssocBothNonEmptyNoOverlap) { initial_data.push_back(CreateSyncData(7)); model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, initial_data, PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); - EXPECT_EQ(6U, model()->GetAllSyncData(syncable::APP_NOTIFICATIONS).size()); + EXPECT_EQ(6U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); for (syncer::SyncDataList::const_iterator iter = initial_data.begin(); iter != initial_data.end(); ++iter) { scoped_ptr<AppNotification> notif1( @@ -415,12 +415,12 @@ TEST_F(AppNotificationManagerSyncTest, ModelAssocBothNonEmptySomeOverlap) { initial_data.push_back(CreateSyncData(7)); model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, initial_data, PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); - EXPECT_EQ(6U, model()->GetAllSyncData(syncable::APP_NOTIFICATIONS).size()); + EXPECT_EQ(6U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); for (syncer::SyncDataList::const_iterator iter = initial_data.begin(); iter != initial_data.end(); ++iter) { scoped_ptr<AppNotification> notif1( @@ -469,16 +469,16 @@ TEST_F(AppNotificationManagerSyncTest, ModelAssocBothNonEmptyTitleMismatch) { WillOnce( Return( syncer::SyncError( - FROM_HERE, "error", syncable::APP_NOTIFICATIONS))); + FROM_HERE, "error", syncer::APP_NOTIFICATIONS))); syncer::SyncError sync_error = model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, initial_data, PassProcessor(), error_handler.PassAs<syncer::SyncErrorFactory>()); EXPECT_TRUE(sync_error.IsSet()); - EXPECT_EQ(syncable::APP_NOTIFICATIONS, sync_error.type()); + EXPECT_EQ(syncer::APP_NOTIFICATIONS, sync_error.type()); EXPECT_EQ(0U, processor()->change_list_size()); } @@ -502,16 +502,16 @@ TEST_F(AppNotificationManagerSyncTest, ModelAssocBothNonEmptyMatchesLocal) { WillOnce( Return( syncer::SyncError( - FROM_HERE, "error", syncable::APP_NOTIFICATIONS))); + FROM_HERE, "error", syncer::APP_NOTIFICATIONS))); syncer::SyncError sync_error = model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, initial_data, PassProcessor(), error_handler.PassAs<syncer::SyncErrorFactory>()); EXPECT_TRUE(sync_error.IsSet()); - EXPECT_EQ(syncable::APP_NOTIFICATIONS, sync_error.type()); + EXPECT_EQ(syncer::APP_NOTIFICATIONS, sync_error.type()); EXPECT_EQ(0U, processor()->change_list_size()); } @@ -519,7 +519,7 @@ TEST_F(AppNotificationManagerSyncTest, ModelAssocBothNonEmptyMatchesLocal) { TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesEmptyModel) { // We initially have no data. model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, syncer::SyncDataList(), PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -535,7 +535,7 @@ TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesEmptyModel) { model()->ProcessSyncChanges(FROM_HERE, changes); - EXPECT_EQ(3U, model()->GetAllSyncData(syncable::APP_NOTIFICATIONS).size()); + EXPECT_EQ(3U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); EXPECT_EQ(0U, processor()->change_list_size()); } @@ -546,7 +546,7 @@ TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesNonEmptyModel) { AppNotification* n2 = CreateNotification(2); model()->Add(n2); model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, syncer::SyncDataList(), PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -562,7 +562,7 @@ TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesNonEmptyModel) { model()->ProcessSyncChanges(FROM_HERE, changes); - EXPECT_EQ(3U, model()->GetAllSyncData(syncable::APP_NOTIFICATIONS).size()); + EXPECT_EQ(3U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); EXPECT_EQ(2U, processor()->change_list_size()); } @@ -573,7 +573,7 @@ TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesIgnoreBadAdd) { AppNotification* n2 = CreateNotification(2); model()->Add(n2); model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, syncer::SyncDataList(), PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -586,7 +586,7 @@ TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesIgnoreBadAdd) { syncer::SyncError error = model()->ProcessSyncChanges(FROM_HERE, changes); EXPECT_FALSE(error.IsSet()); - EXPECT_EQ(2U, model()->GetAllSyncData(syncable::APP_NOTIFICATIONS).size()); + EXPECT_EQ(2U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); EXPECT_EQ(2U, processor()->change_list_size()); } @@ -597,7 +597,7 @@ TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesIgnoreBadDelete) { AppNotification* n2 = CreateNotification(2); model()->Add(n2); model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, syncer::SyncDataList(), PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -610,7 +610,7 @@ TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesIgnoreBadDelete) { syncer::SyncError error = model()->ProcessSyncChanges(FROM_HERE, changes); EXPECT_FALSE(error.IsSet()); - EXPECT_EQ(2U, model()->GetAllSyncData(syncable::APP_NOTIFICATIONS).size()); + EXPECT_EQ(2U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); EXPECT_EQ(2U, processor()->change_list_size()); } @@ -621,7 +621,7 @@ TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesIgnoreBadUpdates) { AppNotification* n2 = CreateNotification(2); model()->Add(n2); model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, syncer::SyncDataList(), PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -638,7 +638,7 @@ TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesIgnoreBadUpdates) { syncer::SyncError error = model()->ProcessSyncChanges(FROM_HERE, changes); EXPECT_FALSE(error.IsSet()); - EXPECT_EQ(2U, model()->GetAllSyncData(syncable::APP_NOTIFICATIONS).size()); + EXPECT_EQ(2U, model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); EXPECT_EQ(2U, processor()->change_list_size()); } @@ -646,7 +646,7 @@ TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesIgnoreBadUpdates) { TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesEmptyModelWithMax) { const std::string& ext_id = "e1"; model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, syncer::SyncDataList(), PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -658,14 +658,14 @@ TEST_F(AppNotificationManagerSyncTest, ProcessSyncChangesEmptyModelWithMax) { model()->ProcessSyncChanges(FROM_HERE, changes); if (i < AppNotificationManager::kMaxNotificationPerApp) { EXPECT_EQ(i + 1, - model()->GetAllSyncData(syncable::APP_NOTIFICATIONS).size()); + model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); } else { EXPECT_EQ(AppNotificationManager::kMaxNotificationPerApp, - model()->GetAllSyncData(syncable::APP_NOTIFICATIONS).size()); + model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); for (unsigned int j = i; j > i - 5; j--) { EXPECT_EQ( AppNotificationManager::kMaxNotificationPerApp, - model()->GetAllSyncData(syncable::APP_NOTIFICATIONS).size()); + model()->GetAllSyncData(syncer::APP_NOTIFICATIONS).size()); } } } @@ -677,7 +677,7 @@ TEST_F(AppNotificationManagerSyncTest, StopSyncing) { EXPECT_FALSE(model()->models_associated_); model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, syncer::SyncDataList(), PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -685,7 +685,7 @@ TEST_F(AppNotificationManagerSyncTest, StopSyncing) { EXPECT_TRUE(model()->sync_processor_.get()); EXPECT_TRUE(model()->models_associated_); - model()->StopSyncing(syncable::APP_NOTIFICATIONS); + model()->StopSyncing(syncer::APP_NOTIFICATIONS); EXPECT_FALSE(model()->sync_processor_.get()); EXPECT_FALSE(model()->models_associated_); } @@ -693,7 +693,7 @@ TEST_F(AppNotificationManagerSyncTest, StopSyncing) { // Adds get pushed to sync but local only are skipped. TEST_F(AppNotificationManagerSyncTest, AddsGetsSynced) { model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, syncer::SyncDataList(), PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -731,7 +731,7 @@ TEST_F(AppNotificationManagerSyncTest, ClearAllGetsSynced) { initial_data.push_back( AppNotificationManager::CreateSyncDataFromNotification(*n4)); model()->MergeDataAndStartSyncing( - syncable::APP_NOTIFICATIONS, + syncer::APP_NOTIFICATIONS, initial_data, PassProcessor(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index e60dbe3..f9d9be9 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -763,10 +763,10 @@ bool ExtensionService::UninstallExtension( content::Details<const std::string>(&extension_id)); if (app_sync_bundle_.HasExtensionId(extension_id) && - sync_change.sync_data().GetDataType() == syncable::APPS) { + sync_change.sync_data().GetDataType() == syncer::APPS) { app_sync_bundle_.ProcessDeletion(extension_id, sync_change); } else if (extension_sync_bundle_.HasExtensionId(extension_id) && - sync_change.sync_data().GetDataType() == syncable::EXTENSIONS) { + sync_change.sync_data().GetDataType() == syncer::EXTENSIONS) { extension_sync_bundle_.ProcessDeletion(extension_id, sync_change); } @@ -1192,7 +1192,7 @@ void ExtensionService::CheckForUpdatesSoon() { } syncer::SyncError ExtensionService::MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) { @@ -1200,13 +1200,13 @@ syncer::SyncError ExtensionService::MergeDataAndStartSyncing( CHECK(sync_error_factory.get()); switch (type) { - case syncable::EXTENSIONS: + case syncer::EXTENSIONS: extension_sync_bundle_.SetupSync(sync_processor.release(), sync_error_factory.release(), initial_sync_data); break; - case syncable::APPS: + case syncer::APPS: app_sync_bundle_.SetupSync(sync_processor.release(), sync_error_factory.release(), initial_sync_data); @@ -1225,11 +1225,11 @@ syncer::SyncError ExtensionService::MergeDataAndStartSyncing( i != sync_data_list.end(); ++i) { switch (type) { - case syncable::EXTENSIONS: + case syncer::EXTENSIONS: sync_change_list.push_back( extension_sync_bundle_.CreateSyncChange(*i)); break; - case syncable::APPS: + case syncer::APPS: sync_change_list.push_back(app_sync_bundle_.CreateSyncChange(*i)); break; default: @@ -1238,29 +1238,29 @@ syncer::SyncError ExtensionService::MergeDataAndStartSyncing( } - if (type == syncable::EXTENSIONS) { + if (type == syncer::EXTENSIONS) { extension_sync_bundle_.ProcessSyncChangeList(sync_change_list); - } else if (type == syncable::APPS) { + } else if (type == syncer::APPS) { app_sync_bundle_.ProcessSyncChangeList(sync_change_list); } return syncer::SyncError(); } -void ExtensionService::StopSyncing(syncable::ModelType type) { - if (type == syncable::APPS) { +void ExtensionService::StopSyncing(syncer::ModelType type) { + if (type == syncer::APPS) { app_sync_bundle_.Reset(); - } else if (type == syncable::EXTENSIONS) { + } else if (type == syncer::EXTENSIONS) { extension_sync_bundle_.Reset(); } } syncer::SyncDataList ExtensionService::GetAllSyncData( - syncable::ModelType type) const { - if (type == syncable::EXTENSIONS) { + syncer::ModelType type) const { + if (type == syncer::EXTENSIONS) { return extension_sync_bundle_.GetAllSyncData(); - } else if (type == syncable::APPS) { + } else if (type == syncer::APPS) { return app_sync_bundle_.GetAllSyncData(); } @@ -1276,11 +1276,11 @@ syncer::SyncError ExtensionService::ProcessSyncChanges( for (syncer::SyncChangeList::const_iterator i = change_list.begin(); i != change_list.end(); ++i) { - syncable::ModelType type = i->sync_data().GetDataType(); - if (type == syncable::EXTENSIONS) { + syncer::ModelType type = i->sync_data().GetDataType(); + if (type == syncer::EXTENSIONS) { extension_sync_bundle_.ProcessSyncChange( extensions::ExtensionSyncData(*i)); - } else if (type == syncable::APPS) { + } else if (type == syncer::APPS) { app_sync_bundle_.ProcessSyncChange(extensions::AppSyncData(*i)); } } @@ -1350,7 +1350,7 @@ std::vector<extensions::AppSyncData> ExtensionService::GetAppSyncDataList() bool ExtensionService::ProcessExtensionSyncData( const extensions::ExtensionSyncData& extension_sync_data) { if (!ProcessExtensionSyncDataHelper(extension_sync_data, - syncable::EXTENSIONS)) { + syncer::EXTENSIONS)) { extension_sync_bundle_.AddPendingExtension(extension_sync_data.id(), extension_sync_data); CheckForUpdatesSoon(); @@ -1385,7 +1385,7 @@ bool ExtensionService::ProcessAppSyncData( } if (!ProcessExtensionSyncDataHelper(app_sync_data.extension_sync_data(), - syncable::APPS)) { + syncer::APPS)) { app_sync_bundle_.AddPendingApp(id, app_sync_data); CheckForUpdatesSoon(); return false; @@ -1395,12 +1395,12 @@ bool ExtensionService::ProcessAppSyncData( } bool ExtensionService::IsCorrectSyncType(const Extension& extension, - syncable::ModelType type) const { - if (type == syncable::EXTENSIONS && + syncer::ModelType type) const { + if (type == syncer::EXTENSIONS && extension.GetSyncType() == Extension::SYNC_TYPE_EXTENSION) return true; - if (type == syncable::APPS && + if (type == syncer::APPS && extension.GetSyncType() == Extension::SYNC_TYPE_APP) return true; @@ -1409,7 +1409,7 @@ bool ExtensionService::IsCorrectSyncType(const Extension& extension, bool ExtensionService::ProcessExtensionSyncDataHelper( const extensions::ExtensionSyncData& extension_sync_data, - syncable::ModelType type) { + syncer::ModelType type) { const std::string& id = extension_sync_data.id(); const Extension* extension = GetInstalledExtension(id); @@ -1464,9 +1464,9 @@ bool ExtensionService::ProcessExtensionSyncDataHelper( // permissions. const bool kInstallSilently = true; - CHECK(type == syncable::EXTENSIONS || type == syncable::APPS); + CHECK(type == syncer::EXTENSIONS || type == syncer::APPS); ExtensionFilter filter = - (type == syncable::APPS) ? IsSyncableApp : IsSyncableExtension; + (type == syncer::APPS) ? IsSyncableApp : IsSyncableExtension; if (!pending_extension_manager()->AddFromSync( id, diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index c2b0089..0b055b8 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h @@ -422,13 +422,13 @@ class ExtensionService // syncer::SyncableService implementation. virtual syncer::SyncError MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; - virtual void StopSyncing(syncable::ModelType type) OVERRIDE; + virtual void StopSyncing(syncer::ModelType type) OVERRIDE; virtual syncer::SyncDataList GetAllSyncData( - syncable::ModelType type) const OVERRIDE; + syncer::ModelType type) const OVERRIDE; virtual syncer::SyncError ProcessSyncChanges( const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) OVERRIDE; @@ -653,7 +653,7 @@ class ExtensionService // Return true if the sync type of |extension| matches |type|. bool IsCorrectSyncType(const extensions::Extension& extension, - syncable::ModelType type) + syncer::ModelType type) const; // Handles setting the extension specific values in |extension_sync_data| to @@ -662,7 +662,7 @@ class ExtensionService // tried again later. bool ProcessExtensionSyncDataHelper( const extensions::ExtensionSyncData& extension_sync_data, - syncable::ModelType type); + syncer::ModelType type); // Look up an extension by ID, optionally including either or both of enabled // and disabled extensions. diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index ce15b96..d2decbb 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -4229,11 +4229,11 @@ TEST_F(ExtensionServiceTest, GetSyncData) { ASSERT_TRUE(extension); service_->MergeDataAndStartSyncing( - syncable::EXTENSIONS, syncer::SyncDataList(), + syncer::EXTENSIONS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); - syncer::SyncDataList list = service_->GetAllSyncData(syncable::EXTENSIONS); + syncer::SyncDataList list = service_->GetAllSyncData(syncer::EXTENSIONS); ASSERT_EQ(list.size(), 1U); extensions::ExtensionSyncData data(list[0]); EXPECT_EQ(extension->id(), data.id()); @@ -4254,11 +4254,11 @@ TEST_F(ExtensionServiceTest, GetSyncDataTerminated) { TestSyncProcessorStub processor; service_->MergeDataAndStartSyncing( - syncable::EXTENSIONS, syncer::SyncDataList(), + syncer::EXTENSIONS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); - syncer::SyncDataList list = service_->GetAllSyncData(syncable::EXTENSIONS); + syncer::SyncDataList list = service_->GetAllSyncData(syncer::EXTENSIONS); ASSERT_EQ(list.size(), 1U); extensions::ExtensionSyncData data(list[0]); EXPECT_EQ(extension->id(), data.id()); @@ -4277,11 +4277,11 @@ TEST_F(ExtensionServiceTest, GetSyncDataFilter) { ASSERT_TRUE(extension); TestSyncProcessorStub processor; - service_->MergeDataAndStartSyncing(syncable::APPS, syncer::SyncDataList(), + service_->MergeDataAndStartSyncing(syncer::APPS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); - syncer::SyncDataList list = service_->GetAllSyncData(syncable::EXTENSIONS); + syncer::SyncDataList list = service_->GetAllSyncData(syncer::EXTENSIONS); ASSERT_EQ(list.size(), 0U); } @@ -4293,12 +4293,12 @@ TEST_F(ExtensionServiceTest, GetSyncExtensionDataUserSettings) { TestSyncProcessorStub processor; service_->MergeDataAndStartSyncing( - syncable::EXTENSIONS, syncer::SyncDataList(), + syncer::EXTENSIONS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); { - syncer::SyncDataList list = service_->GetAllSyncData(syncable::EXTENSIONS); + syncer::SyncDataList list = service_->GetAllSyncData(syncer::EXTENSIONS); ASSERT_EQ(list.size(), 1U); extensions::ExtensionSyncData data(list[0]); EXPECT_TRUE(data.enabled()); @@ -4307,7 +4307,7 @@ TEST_F(ExtensionServiceTest, GetSyncExtensionDataUserSettings) { service_->DisableExtension(good_crx, Extension::DISABLE_USER_ACTION); { - syncer::SyncDataList list = service_->GetAllSyncData(syncable::EXTENSIONS); + syncer::SyncDataList list = service_->GetAllSyncData(syncer::EXTENSIONS); ASSERT_EQ(list.size(), 1U); extensions::ExtensionSyncData data(list[0]); EXPECT_FALSE(data.enabled()); @@ -4316,7 +4316,7 @@ TEST_F(ExtensionServiceTest, GetSyncExtensionDataUserSettings) { service_->SetIsIncognitoEnabled(good_crx, true); { - syncer::SyncDataList list = service_->GetAllSyncData(syncable::EXTENSIONS); + syncer::SyncDataList list = service_->GetAllSyncData(syncer::EXTENSIONS); ASSERT_EQ(list.size(), 1U); extensions::ExtensionSyncData data(list[0]); EXPECT_FALSE(data.enabled()); @@ -4325,7 +4325,7 @@ TEST_F(ExtensionServiceTest, GetSyncExtensionDataUserSettings) { service_->EnableExtension(good_crx); { - syncer::SyncDataList list = service_->GetAllSyncData(syncable::EXTENSIONS); + syncer::SyncDataList list = service_->GetAllSyncData(syncer::EXTENSIONS); ASSERT_EQ(list.size(), 1U); extensions::ExtensionSyncData data(list[0]); EXPECT_TRUE(data.enabled()); @@ -4342,7 +4342,7 @@ TEST_F(ExtensionServiceTest, SyncForUninstalledExternalExtension) { TestSyncProcessorStub processor; service_->MergeDataAndStartSyncing( - syncable::EXTENSIONS, syncer::SyncDataList(), + syncer::EXTENSIONS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -4375,13 +4375,13 @@ TEST_F(ExtensionServiceTest, GetSyncAppDataUserSettings) { ASSERT_TRUE(app->is_app()); TestSyncProcessorStub processor; - service_->MergeDataAndStartSyncing(syncable::APPS, syncer::SyncDataList(), + service_->MergeDataAndStartSyncing(syncer::APPS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); StringOrdinal initial_ordinal = StringOrdinal::CreateInitialOrdinal(); { - syncer::SyncDataList list = service_->GetAllSyncData(syncable::APPS); + syncer::SyncDataList list = service_->GetAllSyncData(syncer::APPS); ASSERT_EQ(list.size(), 1U); extensions::AppSyncData app_sync_data(list[0]); @@ -4392,7 +4392,7 @@ TEST_F(ExtensionServiceTest, GetSyncAppDataUserSettings) { ExtensionSorting* sorting = service_->extension_prefs()->extension_sorting(); sorting->SetAppLaunchOrdinal(app->id(), initial_ordinal.CreateAfter()); { - syncer::SyncDataList list = service_->GetAllSyncData(syncable::APPS); + syncer::SyncDataList list = service_->GetAllSyncData(syncer::APPS); ASSERT_EQ(list.size(), 1U); extensions::AppSyncData app_sync_data(list[0]); @@ -4402,7 +4402,7 @@ TEST_F(ExtensionServiceTest, GetSyncAppDataUserSettings) { sorting->SetPageOrdinal(app->id(), initial_ordinal.CreateAfter()); { - syncer::SyncDataList list = service_->GetAllSyncData(syncable::APPS); + syncer::SyncDataList list = service_->GetAllSyncData(syncer::APPS); ASSERT_EQ(list.size(), 1U); extensions::AppSyncData app_sync_data(list[0]); @@ -4424,13 +4424,13 @@ TEST_F(ExtensionServiceTest, GetSyncAppDataUserSettingsOnExtensionMoved) { } TestSyncProcessorStub processor; - service_->MergeDataAndStartSyncing(syncable::APPS, syncer::SyncDataList(), + service_->MergeDataAndStartSyncing(syncer::APPS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); service_->OnExtensionMoved(apps[0]->id(), apps[1]->id(), apps[2]->id()); { - syncer::SyncDataList list = service_->GetAllSyncData(syncable::APPS); + syncer::SyncDataList list = service_->GetAllSyncData(syncer::APPS); ASSERT_EQ(list.size(), 3U); extensions::AppSyncData data[kAppCount]; @@ -4463,26 +4463,26 @@ TEST_F(ExtensionServiceTest, GetSyncDataList) { InstallCRX(data_dir_.AppendASCII("theme2.crx"), INSTALL_NEW); TestSyncProcessorStub processor; - service_->MergeDataAndStartSyncing(syncable::APPS, syncer::SyncDataList(), + service_->MergeDataAndStartSyncing(syncer::APPS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); service_->MergeDataAndStartSyncing( - syncable::EXTENSIONS, syncer::SyncDataList(), + syncer::EXTENSIONS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); service_->DisableExtension(page_action, Extension::DISABLE_USER_ACTION); TerminateExtension(theme2_crx); - EXPECT_EQ(0u, service_->GetAllSyncData(syncable::APPS).size()); - EXPECT_EQ(2u, service_->GetAllSyncData(syncable::EXTENSIONS).size()); + EXPECT_EQ(0u, service_->GetAllSyncData(syncer::APPS).size()); + EXPECT_EQ(2u, service_->GetAllSyncData(syncer::EXTENSIONS).size()); } TEST_F(ExtensionServiceTest, ProcessSyncDataUninstall) { InitializeEmptyExtensionService(); TestSyncProcessorStub processor; service_->MergeDataAndStartSyncing( - syncable::EXTENSIONS, syncer::SyncDataList(), + syncer::EXTENSIONS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -4564,7 +4564,7 @@ TEST_F(ExtensionServiceTest, ProcessSyncDataSettings) { InitializeExtensionProcessManager(); TestSyncProcessorStub processor; service_->MergeDataAndStartSyncing( - syncable::EXTENSIONS, syncer::SyncDataList(), + syncer::EXTENSIONS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -4626,7 +4626,7 @@ TEST_F(ExtensionServiceTest, ProcessSyncDataTerminatedExtension) { InitializeExtensionServiceWithUpdater(); TestSyncProcessorStub processor; service_->MergeDataAndStartSyncing( - syncable::EXTENSIONS, syncer::SyncDataList(), + syncer::EXTENSIONS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -4660,7 +4660,7 @@ TEST_F(ExtensionServiceTest, ProcessSyncDataVersionCheck) { InitializeRequestContext(); TestSyncProcessorStub processor; service_->MergeDataAndStartSyncing( - syncable::EXTENSIONS, syncer::SyncDataList(), + syncer::EXTENSIONS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); @@ -4725,7 +4725,7 @@ TEST_F(ExtensionServiceTest, ProcessSyncDataNotInstalled) { InitializeRequestContext(); TestSyncProcessorStub processor; service_->MergeDataAndStartSyncing( - syncable::EXTENSIONS, syncer::SyncDataList(), + syncer::EXTENSIONS, syncer::SyncDataList(), scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessorStub), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); diff --git a/chrome/browser/extensions/settings/settings_apitest.cc b/chrome/browser/extensions/settings/settings_apitest.cc index b2a336c..6655ebe 100644 --- a/chrome/browser/extensions/settings/settings_apitest.cc +++ b/chrome/browser/extensions/settings/settings_apitest.cc @@ -31,7 +31,7 @@ using settings_namespace::ToString; namespace { // TODO(kalman): test both EXTENSION_SETTINGS and APP_SETTINGS. -const syncable::ModelType kModelType = syncable::EXTENSION_SETTINGS; +const syncer::ModelType kModelType = syncer::EXTENSION_SETTINGS; class NoopSyncChangeProcessor : public syncer::SyncChangeProcessor { public: diff --git a/chrome/browser/extensions/settings/settings_backend.cc b/chrome/browser/extensions/settings/settings_backend.cc index 617cff6..b13413e 100644 --- a/chrome/browser/extensions/settings/settings_backend.cc +++ b/chrome/browser/extensions/settings/settings_backend.cc @@ -33,7 +33,7 @@ SettingsBackend::SettingsBackend( base_path_(base_path), quota_(quota), observers_(observers), - sync_type_(syncable::UNSPECIFIED) { + sync_type_(syncer::UNSPECIFIED) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); } @@ -135,7 +135,7 @@ std::set<std::string> SettingsBackend::GetKnownExtensionIDs() const { static void AddAllSyncData( const std::string& extension_id, const DictionaryValue& src, - syncable::ModelType type, + syncer::ModelType type, syncer::SyncDataList* dst) { for (DictionaryValue::Iterator it(src); it.HasNext(); it.Advance()) { dst->push_back(settings_sync_util::CreateData( @@ -144,12 +144,12 @@ static void AddAllSyncData( } syncer::SyncDataList SettingsBackend::GetAllSyncData( - syncable::ModelType type) const { + syncer::ModelType type) const { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); // Ignore the type, it's just for sanity checking; assume that whatever base // path we're constructed with is correct for the sync type. - DCHECK(type == syncable::EXTENSION_SETTINGS || - type == syncable::APP_SETTINGS); + DCHECK(type == syncer::EXTENSION_SETTINGS || + type == syncer::APP_SETTINGS); // For all extensions, get all their settings. This has the effect // of bringing in the entire state of extension settings in memory; sad. @@ -172,14 +172,14 @@ syncer::SyncDataList SettingsBackend::GetAllSyncData( } syncer::SyncError SettingsBackend::MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - DCHECK(type == syncable::EXTENSION_SETTINGS || - type == syncable::APP_SETTINGS); - DCHECK_EQ(sync_type_, syncable::UNSPECIFIED); + DCHECK(type == syncer::EXTENSION_SETTINGS || + type == syncer::APP_SETTINGS); + DCHECK_EQ(sync_type_, syncer::UNSPECIFIED); DCHECK(!sync_processor_.get()); DCHECK(sync_processor.get()); DCHECK(sync_error_factory.get()); @@ -265,11 +265,11 @@ syncer::SyncError SettingsBackend::ProcessSyncChanges( return syncer::SyncError(); } -void SettingsBackend::StopSyncing(syncable::ModelType type) { +void SettingsBackend::StopSyncing(syncer::ModelType type) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - DCHECK(type == syncable::EXTENSION_SETTINGS || - type == syncable::APP_SETTINGS); - DCHECK(sync_type_ == type || sync_type_ == syncable::UNSPECIFIED); + DCHECK(type == syncer::EXTENSION_SETTINGS || + type == syncer::APP_SETTINGS); + DCHECK(sync_type_ == type || sync_type_ == syncer::UNSPECIFIED); for (StorageObjMap::iterator it = storage_objs_.begin(); it != storage_objs_.end(); ++it) { @@ -278,7 +278,7 @@ void SettingsBackend::StopSyncing(syncable::ModelType type) { it->second->StopSyncing(); } - sync_type_ = syncable::UNSPECIFIED; + sync_type_ = syncer::UNSPECIFIED; sync_processor_.reset(); sync_error_factory_.reset(); } diff --git a/chrome/browser/extensions/settings/settings_backend.h b/chrome/browser/extensions/settings/settings_backend.h index 3e9d833..1cc2cc9 100644 --- a/chrome/browser/extensions/settings/settings_backend.h +++ b/chrome/browser/extensions/settings/settings_backend.h @@ -50,16 +50,16 @@ class SettingsBackend : public syncer::SyncableService { // syncer::SyncableService implementation. virtual syncer::SyncDataList GetAllSyncData( - syncable::ModelType type) const OVERRIDE; + syncer::ModelType type) const OVERRIDE; virtual syncer::SyncError MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; virtual syncer::SyncError ProcessSyncChanges( const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) OVERRIDE; - virtual void StopSyncing(syncable::ModelType type) OVERRIDE; + virtual void StopSyncing(syncer::ModelType type) OVERRIDE; private: // Gets a weak reference to the storage area for a given extension, @@ -96,7 +96,7 @@ class SettingsBackend : public syncer::SyncableService { // Current sync model type. Will be UNSPECIFIED if sync hasn't been enabled // yet, and either SETTINGS or APP_SETTINGS if it has been. - syncable::ModelType sync_type_; + syncer::ModelType sync_type_; // Current sync processor, if any. scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; diff --git a/chrome/browser/extensions/settings/settings_frontend.cc b/chrome/browser/extensions/settings/settings_frontend.cc index b3fd10a..7eef6bc 100644 --- a/chrome/browser/extensions/settings/settings_frontend.cc +++ b/chrome/browser/extensions/settings/settings_frontend.cc @@ -264,15 +264,15 @@ SettingsFrontend::~SettingsFrontend() { } syncer::SyncableService* SettingsFrontend::GetBackendForSync( - syncable::ModelType type) const { + syncer::ModelType type) const { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); std::map<settings_namespace::Namespace, BackendWrappers>::const_iterator sync_backends = backends_.find(settings_namespace::SYNC); DCHECK(sync_backends != backends_.end()); switch (type) { - case syncable::APP_SETTINGS: + case syncer::APP_SETTINGS: return sync_backends->second.app->GetBackend(); - case syncable::EXTENSION_SETTINGS: + case syncer::EXTENSION_SETTINGS: return sync_backends->second.extension->GetBackend(); default: NOTREACHED(); diff --git a/chrome/browser/extensions/settings/settings_frontend.h b/chrome/browser/extensions/settings/settings_frontend.h index 8dc4c26..cce3c8b 100644 --- a/chrome/browser/extensions/settings/settings_frontend.h +++ b/chrome/browser/extensions/settings/settings_frontend.h @@ -49,7 +49,7 @@ class SettingsFrontend { // Must only be called from the FILE thread. |type| should be either // APP_SETTINGS or EXTENSION_SETTINGS. - syncer::SyncableService* GetBackendForSync(syncable::ModelType type) const; + syncer::SyncableService* GetBackendForSync(syncer::ModelType type) const; // Runs |callback| on the FILE thread with the storage area for // |extension_id|. If there is no extension with that ID, the storage area diff --git a/chrome/browser/extensions/settings/settings_sync_processor.cc b/chrome/browser/extensions/settings/settings_sync_processor.cc index a4707ef..18c4f07 100644 --- a/chrome/browser/extensions/settings/settings_sync_processor.cc +++ b/chrome/browser/extensions/settings/settings_sync_processor.cc @@ -16,15 +16,14 @@ namespace extensions { SettingsSyncProcessor::SettingsSyncProcessor( const std::string& extension_id, - syncable::ModelType type, + syncer::ModelType type, syncer::SyncChangeProcessor* sync_processor) : extension_id_(extension_id), type_(type), sync_processor_(sync_processor), initialized_(false) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - CHECK(type == syncable::EXTENSION_SETTINGS || - type == syncable::APP_SETTINGS); + CHECK(type == syncer::EXTENSION_SETTINGS || type == syncer::APP_SETTINGS); CHECK(sync_processor); } diff --git a/chrome/browser/extensions/settings/settings_sync_processor.h b/chrome/browser/extensions/settings/settings_sync_processor.h index 42c5d6b..bd55bd8 100644 --- a/chrome/browser/extensions/settings/settings_sync_processor.h +++ b/chrome/browser/extensions/settings/settings_sync_processor.h @@ -27,7 +27,7 @@ namespace extensions { class SettingsSyncProcessor { public: SettingsSyncProcessor(const std::string& extension_id, - syncable::ModelType type, + syncer::ModelType type, syncer::SyncChangeProcessor* sync_processor); ~SettingsSyncProcessor(); @@ -41,14 +41,14 @@ class SettingsSyncProcessor { // be taken, but this must be notified for internal bookkeeping. void NotifyChanges(const ValueStoreChangeList& changes); - syncable::ModelType type() { return type_; } + syncer::ModelType type() { return type_; } private: // ID of the extension the changes are for. const std::string extension_id_; // Sync model type. Either EXTENSION_SETTING or APP_SETTING. - const syncable::ModelType type_; + const syncer::ModelType type_; // The sync processor used to send changes to sync. syncer::SyncChangeProcessor* const sync_processor_; diff --git a/chrome/browser/extensions/settings/settings_sync_unittest.cc b/chrome/browser/extensions/settings/settings_sync_unittest.cc index 483ffe8..7283bde 100644 --- a/chrome/browser/extensions/settings/settings_sync_unittest.cc +++ b/chrome/browser/extensions/settings/settings_sync_unittest.cc @@ -10,13 +10,13 @@ #include "base/memory/scoped_ptr.h" #include "base/message_loop.h" #include "base/scoped_temp_dir.h" -#include "chrome/browser/value_store/failing_value_store.h" #include "chrome/browser/extensions/settings/leveldb_settings_storage_factory.h" #include "chrome/browser/extensions/settings/settings_frontend.h" #include "chrome/browser/extensions/settings/settings_storage_factory.h" #include "chrome/browser/extensions/settings/settings_sync_util.h" #include "chrome/browser/extensions/settings/settings_test_util.h" #include "chrome/browser/extensions/settings/syncable_settings_storage.h" +#include "chrome/browser/value_store/failing_value_store.h" #include "chrome/browser/value_store/testing_value_store.h" #include "content/public/test/test_browser_thread.h" #include "sync/api/sync_change_processor.h" @@ -196,7 +196,7 @@ class TestingValueStoreFactory : public SettingsStorageFactory { void AssignSettingsService(syncer::SyncableService** dst, const SettingsFrontend* frontend, - syncable::ModelType type) { + syncer::ModelType type) { *dst = frontend->GetBackendForSync(type); } @@ -235,7 +235,7 @@ class ExtensionSettingsSyncTest : public testing::Test { } // Gets the syncer::SyncableService for the given sync type. - syncer::SyncableService* GetSyncableService(syncable::ModelType model_type) { + syncer::SyncableService* GetSyncableService(syncer::ModelType model_type) { MessageLoop::current()->RunAllPending(); return frontend_->GetBackendForSync(model_type); } @@ -243,7 +243,7 @@ class ExtensionSettingsSyncTest : public testing::Test { // Gets all the sync data from the SyncableService for a sync type as a map // from extension id to its sync data. std::map<std::string, SettingSyncDataList> GetAllSyncData( - syncable::ModelType model_type) { + syncer::ModelType model_type) { syncer::SyncDataList as_list = GetSyncableService(model_type)->GetAllSyncData(model_type); std::map<std::string, SettingSyncDataList> as_map; @@ -272,7 +272,7 @@ class ExtensionSettingsSyncTest : public testing::Test { // sync by roughly alternative which one to test. TEST_F(ExtensionSettingsSyncTest, NoDataDoesNotInvokeSync) { - syncable::ModelType model_type = syncable::EXTENSION_SETTINGS; + syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Extension::Type type = Extension::TYPE_EXTENSION; EXPECT_EQ(0u, GetAllSyncData(model_type).size()); @@ -297,7 +297,7 @@ TEST_F(ExtensionSettingsSyncTest, NoDataDoesNotInvokeSync) { } TEST_F(ExtensionSettingsSyncTest, InSyncDataDoesNotInvokeSync) { - syncable::ModelType model_type = syncable::APP_SETTINGS; + syncer::ModelType model_type = syncer::APP_SETTINGS; Extension::Type type = Extension::TYPE_PACKAGED_APP; StringValue value1("fooValue"); @@ -347,7 +347,7 @@ TEST_F(ExtensionSettingsSyncTest, InSyncDataDoesNotInvokeSync) { } TEST_F(ExtensionSettingsSyncTest, LocalDataWithNoSyncDataIsPushedToSync) { - syncable::ModelType model_type = syncable::EXTENSION_SETTINGS; + syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Extension::Type type = Extension::TYPE_EXTENSION; StringValue value1("fooValue"); @@ -379,7 +379,7 @@ TEST_F(ExtensionSettingsSyncTest, LocalDataWithNoSyncDataIsPushedToSync) { } TEST_F(ExtensionSettingsSyncTest, AnySyncDataOverwritesLocalData) { - syncable::ModelType model_type = syncable::APP_SETTINGS; + syncer::ModelType model_type = syncer::APP_SETTINGS; Extension::Type type = Extension::TYPE_PACKAGED_APP; StringValue value1("fooValue"); @@ -419,7 +419,7 @@ TEST_F(ExtensionSettingsSyncTest, AnySyncDataOverwritesLocalData) { } TEST_F(ExtensionSettingsSyncTest, ProcessSyncChanges) { - syncable::ModelType model_type = syncable::EXTENSION_SETTINGS; + syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Extension::Type type = Extension::TYPE_EXTENSION; StringValue value1("fooValue"); @@ -492,7 +492,7 @@ TEST_F(ExtensionSettingsSyncTest, ProcessSyncChanges) { } TEST_F(ExtensionSettingsSyncTest, PushToSync) { - syncable::ModelType model_type = syncable::APP_SETTINGS; + syncer::ModelType model_type = syncer::APP_SETTINGS; Extension::Type type = Extension::TYPE_PACKAGED_APP; StringValue value1("fooValue"); @@ -648,13 +648,13 @@ TEST_F(ExtensionSettingsSyncTest, ExtensionAndAppSettingsSyncSeparately) { storage2->Set(DEFAULTS, "bar", value2); std::map<std::string, SettingSyncDataList> extension_sync_data = - GetAllSyncData(syncable::EXTENSION_SETTINGS); + GetAllSyncData(syncer::EXTENSION_SETTINGS); EXPECT_EQ(1u, extension_sync_data.size()); EXPECT_EQ(1u, extension_sync_data["s1"].size()); EXPECT_PRED_FORMAT2(ValuesEq, &value1, &extension_sync_data["s1"][0].value()); std::map<std::string, SettingSyncDataList> app_sync_data = - GetAllSyncData(syncable::APP_SETTINGS); + GetAllSyncData(syncer::APP_SETTINGS); EXPECT_EQ(1u, app_sync_data.size()); EXPECT_EQ(1u, app_sync_data["s2"].size()); EXPECT_PRED_FORMAT2(ValuesEq, &value2, &app_sync_data["s2"][0].value()); @@ -662,35 +662,35 @@ TEST_F(ExtensionSettingsSyncTest, ExtensionAndAppSettingsSyncSeparately) { // Stop each separately, there should be no changes either time. syncer::SyncDataList sync_data; sync_data.push_back(settings_sync_util::CreateData( - "s1", "foo", value1, syncable::EXTENSION_SETTINGS)); + "s1", "foo", value1, syncer::EXTENSION_SETTINGS)); - GetSyncableService(syncable::EXTENSION_SETTINGS)->MergeDataAndStartSyncing( - syncable::EXTENSION_SETTINGS, + GetSyncableService(syncer::EXTENSION_SETTINGS)->MergeDataAndStartSyncing( + syncer::EXTENSION_SETTINGS, sync_data, sync_processor_delegate_.PassAs<syncer::SyncChangeProcessor>(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); - GetSyncableService(syncable::EXTENSION_SETTINGS)-> - StopSyncing(syncable::EXTENSION_SETTINGS); + GetSyncableService(syncer::EXTENSION_SETTINGS)-> + StopSyncing(syncer::EXTENSION_SETTINGS); EXPECT_EQ(0u, sync_processor_->changes().size()); sync_data.clear(); sync_data.push_back(settings_sync_util::CreateData( - "s2", "bar", value2, syncable::APP_SETTINGS)); + "s2", "bar", value2, syncer::APP_SETTINGS)); scoped_ptr<SyncChangeProcessorDelegate> app_settings_delegate_( new SyncChangeProcessorDelegate(sync_processor_.get())); - GetSyncableService(syncable::APP_SETTINGS)->MergeDataAndStartSyncing( - syncable::APP_SETTINGS, + GetSyncableService(syncer::APP_SETTINGS)->MergeDataAndStartSyncing( + syncer::APP_SETTINGS, sync_data, app_settings_delegate_.PassAs<syncer::SyncChangeProcessor>(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); - GetSyncableService(syncable::APP_SETTINGS)-> - StopSyncing(syncable::APP_SETTINGS); + GetSyncableService(syncer::APP_SETTINGS)-> + StopSyncing(syncer::APP_SETTINGS); EXPECT_EQ(0u, sync_processor_->changes().size()); } TEST_F(ExtensionSettingsSyncTest, FailingStartSyncingDisablesSync) { - syncable::ModelType model_type = syncable::EXTENSION_SETTINGS; + syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Extension::Type type = Extension::TYPE_EXTENSION; StringValue fooValue("fooValue"); @@ -890,7 +890,7 @@ TEST_F(ExtensionSettingsSyncTest, FailingStartSyncingDisablesSync) { TEST_F(ExtensionSettingsSyncTest, FailingProcessChangesDisablesSync) { // The test above tests a failing ProcessSyncChanges too, but here test with // an initially passing MergeDataAndStartSyncing. - syncable::ModelType model_type = syncable::APP_SETTINGS; + syncer::ModelType model_type = syncer::APP_SETTINGS; Extension::Type type = Extension::TYPE_PACKAGED_APP; StringValue fooValue("fooValue"); @@ -988,7 +988,7 @@ TEST_F(ExtensionSettingsSyncTest, FailingProcessChangesDisablesSync) { } TEST_F(ExtensionSettingsSyncTest, FailingGetAllSyncDataDoesntStopSync) { - syncable::ModelType model_type = syncable::EXTENSION_SETTINGS; + syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Extension::Type type = Extension::TYPE_EXTENSION; StringValue fooValue("fooValue"); @@ -1043,7 +1043,7 @@ TEST_F(ExtensionSettingsSyncTest, FailingGetAllSyncDataDoesntStopSync) { } TEST_F(ExtensionSettingsSyncTest, FailureToReadChangesToPushDisablesSync) { - syncable::ModelType model_type = syncable::APP_SETTINGS; + syncer::ModelType model_type = syncer::APP_SETTINGS; Extension::Type type = Extension::TYPE_PACKAGED_APP; StringValue fooValue("fooValue"); @@ -1147,7 +1147,7 @@ TEST_F(ExtensionSettingsSyncTest, FailureToReadChangesToPushDisablesSync) { } TEST_F(ExtensionSettingsSyncTest, FailureToPushLocalStateDisablesSync) { - syncable::ModelType model_type = syncable::EXTENSION_SETTINGS; + syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Extension::Type type = Extension::TYPE_EXTENSION; StringValue fooValue("fooValue"); @@ -1238,7 +1238,7 @@ TEST_F(ExtensionSettingsSyncTest, FailureToPushLocalStateDisablesSync) { } TEST_F(ExtensionSettingsSyncTest, FailureToPushLocalChangeDisablesSync) { - syncable::ModelType model_type = syncable::EXTENSION_SETTINGS; + syncer::ModelType model_type = syncer::EXTENSION_SETTINGS; Extension::Type type = Extension::TYPE_EXTENSION; StringValue fooValue("fooValue"); @@ -1336,7 +1336,7 @@ TEST_F(ExtensionSettingsSyncTest, FailureToPushLocalChangeDisablesSync) { TEST_F(ExtensionSettingsSyncTest, LargeOutgoingChangeRejectedButIncomingAccepted) { - syncable::ModelType model_type = syncable::APP_SETTINGS; + syncer::ModelType model_type = syncer::APP_SETTINGS; Extension::Type type = Extension::TYPE_PACKAGED_APP; // This value should be larger than the limit in settings_backend.cc. diff --git a/chrome/browser/extensions/settings/settings_sync_util.cc b/chrome/browser/extensions/settings/settings_sync_util.cc index 1a6ff74..c3e46b7 100644 --- a/chrome/browser/extensions/settings/settings_sync_util.cc +++ b/chrome/browser/extensions/settings/settings_sync_util.cc @@ -45,10 +45,10 @@ syncer::SyncData CreateData( const std::string& extension_id, const std::string& key, const Value& value, - syncable::ModelType type) { + syncer::ModelType type) { sync_pb::EntitySpecifics specifics; switch (type) { - case syncable::EXTENSION_SETTINGS: + case syncer::EXTENSION_SETTINGS: PopulateExtensionSettingSpecifics( extension_id, key, @@ -56,7 +56,7 @@ syncer::SyncData CreateData( specifics.mutable_extension_setting()); break; - case syncable::APP_SETTINGS: + case syncer::APP_SETTINGS: PopulateAppSettingSpecifics( extension_id, key, @@ -76,7 +76,7 @@ syncer::SyncChange CreateAdd( const std::string& extension_id, const std::string& key, const Value& value, - syncable::ModelType type) { + syncer::ModelType type) { return syncer::SyncChange( syncer::SyncChange::ACTION_ADD, CreateData(extension_id, key, value, type)); @@ -86,7 +86,7 @@ syncer::SyncChange CreateUpdate( const std::string& extension_id, const std::string& key, const Value& value, - syncable::ModelType type) { + syncer::ModelType type) { return syncer::SyncChange( syncer::SyncChange::ACTION_UPDATE, CreateData(extension_id, key, value, type)); @@ -95,7 +95,7 @@ syncer::SyncChange CreateUpdate( syncer::SyncChange CreateDelete( const std::string& extension_id, const std::string& key, - syncable::ModelType type) { + syncer::ModelType type) { DictionaryValue no_value; return syncer::SyncChange( syncer::SyncChange::ACTION_DELETE, diff --git a/chrome/browser/extensions/settings/settings_sync_util.h b/chrome/browser/extensions/settings/settings_sync_util.h index dede098..33b026c9 100644 --- a/chrome/browser/extensions/settings/settings_sync_util.h +++ b/chrome/browser/extensions/settings/settings_sync_util.h @@ -23,27 +23,27 @@ syncer::SyncData CreateData( const std::string& extension_id, const std::string& key, const base::Value& value, - syncable::ModelType type); + syncer::ModelType type); // Creates an "add" sync change for an extension or app setting. syncer::SyncChange CreateAdd( const std::string& extension_id, const std::string& key, const base::Value& value, - syncable::ModelType type); + syncer::ModelType type); // Creates an "update" sync change for an extension or app setting. syncer::SyncChange CreateUpdate( const std::string& extension_id, const std::string& key, const base::Value& value, - syncable::ModelType type); + syncer::ModelType type); // Creates a "delete" sync change for an extension or app setting. syncer::SyncChange CreateDelete( const std::string& extension_id, const std::string& key, - syncable::ModelType type); + syncer::ModelType type); } // namespace settings_sync_util diff --git a/chrome/browser/extensions/settings/syncable_settings_storage.cc b/chrome/browser/extensions/settings/syncable_settings_storage.cc index a111b19..4641c34 100644 --- a/chrome/browser/extensions/settings/syncable_settings_storage.cc +++ b/chrome/browser/extensions/settings/syncable_settings_storage.cc @@ -240,7 +240,7 @@ syncer::SyncError SyncableSettingsStorage::ProcessSyncChanges( return syncer::SyncError( FROM_HERE, std::string("Sync is inactive for ") + extension_id_, - syncable::UNSPECIFIED); + syncer::UNSPECIFIED); } std::vector<syncer::SyncError> errors; diff --git a/chrome/browser/extensions/test_extension_service.cc b/chrome/browser/extensions/test_extension_service.cc index 47f03c7..63e7226 100644 --- a/chrome/browser/extensions/test_extension_service.cc +++ b/chrome/browser/extensions/test_extension_service.cc @@ -74,7 +74,7 @@ void TestExtensionService::CheckForUpdatesSoon() { } syncer::SyncError TestExtensionService::MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) { @@ -82,12 +82,12 @@ syncer::SyncError TestExtensionService::MergeDataAndStartSyncing( return syncer::SyncError(); } -void TestExtensionService::StopSyncing(syncable::ModelType type) { +void TestExtensionService::StopSyncing(syncer::ModelType type) { ADD_FAILURE(); } syncer::SyncDataList TestExtensionService::GetAllSyncData( - syncable::ModelType type) const { + syncer::ModelType type) const { ADD_FAILURE(); return syncer::SyncDataList(); } diff --git a/chrome/browser/extensions/test_extension_service.h b/chrome/browser/extensions/test_extension_service.h index 72a012a..af9e7a0 100644 --- a/chrome/browser/extensions/test_extension_service.h +++ b/chrome/browser/extensions/test_extension_service.h @@ -53,13 +53,13 @@ class TestExtensionService : public ExtensionServiceInterface { virtual void CheckForUpdatesSoon() OVERRIDE; virtual syncer::SyncError MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; - virtual void StopSyncing(syncable::ModelType type) OVERRIDE; + virtual void StopSyncing(syncer::ModelType type) OVERRIDE; virtual syncer::SyncDataList GetAllSyncData( - syncable::ModelType type) const OVERRIDE; + syncer::ModelType type) const OVERRIDE; virtual syncer::SyncError ProcessSyncChanges( const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) OVERRIDE; diff --git a/chrome/browser/prefs/pref_model_associator.cc b/chrome/browser/prefs/pref_model_associator.cc index 04bd97a..0ed80e1 100644 --- a/chrome/browser/prefs/pref_model_associator.cc +++ b/chrome/browser/prefs/pref_model_associator.cc @@ -18,7 +18,7 @@ #include "sync/protocol/preference_specifics.pb.h" #include "sync/protocol/sync.pb.h" -using syncable::PREFERENCES; +using syncer::PREFERENCES; PrefModelAssociator::PrefModelAssociator() : models_associated_(false), @@ -107,7 +107,7 @@ void PrefModelAssociator::InitPrefAndAssociate( } syncer::SyncError PrefModelAssociator::MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) { @@ -163,7 +163,7 @@ syncer::SyncError PrefModelAssociator::MergeDataAndStartSyncing( return syncer::SyncError(); } -void PrefModelAssociator::StopSyncing(syncable::ModelType type) { +void PrefModelAssociator::StopSyncing(syncer::ModelType type) { DCHECK_EQ(type, PREFERENCES); models_associated_ = false; sync_processor_.reset(); @@ -274,7 +274,7 @@ Value* PrefModelAssociator::MergeDictionaryValues( // not registered locally as syncable and do not inform the syncer of // non-user controlled preferences. syncer::SyncDataList PrefModelAssociator::GetAllSyncData( - syncable::ModelType type) + syncer::ModelType type) const { DCHECK_EQ(PREFERENCES, type); syncer::SyncDataList current_data; diff --git a/chrome/browser/prefs/pref_model_associator.h b/chrome/browser/prefs/pref_model_associator.h index 4588b92..b263816 100644 --- a/chrome/browser/prefs/pref_model_associator.h +++ b/chrome/browser/prefs/pref_model_associator.h @@ -37,16 +37,16 @@ class PrefModelAssociator // syncer::SyncableService implementation. virtual syncer::SyncDataList GetAllSyncData( - syncable::ModelType type) const OVERRIDE; + syncer::ModelType type) const OVERRIDE; virtual syncer::SyncError ProcessSyncChanges( const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) OVERRIDE; virtual syncer::SyncError MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; - virtual void StopSyncing(syncable::ModelType type) OVERRIDE; + virtual void StopSyncing(syncer::ModelType type) OVERRIDE; // Returns the list of preference names that are registered as syncable, and // hence should be monitored for changes. diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc index f29c6e3..dd42b10 100644 --- a/chrome/browser/search_engines/template_url_service.cc +++ b/chrome/browser/search_engines/template_url_service.cc @@ -864,8 +864,8 @@ void TemplateURLService::Observe(int type, } syncer::SyncDataList TemplateURLService::GetAllSyncData( - syncable::ModelType type) const { - DCHECK_EQ(syncable::SEARCH_ENGINES, type); + syncer::ModelType type) const { + DCHECK_EQ(syncer::SEARCH_ENGINES, type); syncer::SyncDataList current_data; for (TemplateURLVector::const_iterator iter = template_urls_.begin(); @@ -889,7 +889,7 @@ syncer::SyncError TemplateURLService::ProcessSyncChanges( const syncer::SyncChangeList& change_list) { if (!models_associated_) { syncer::SyncError error(FROM_HERE, "Models not yet associated.", - syncable::SEARCH_ENGINES); + syncer::SEARCH_ENGINES); return error; } DCHECK(loaded_); @@ -906,7 +906,7 @@ syncer::SyncError TemplateURLService::ProcessSyncChanges( syncer::SyncError error; for (syncer::SyncChangeList::const_iterator iter = change_list.begin(); iter != change_list.end(); ++iter) { - DCHECK_EQ(syncable::SEARCH_ENGINES, iter->sync_data().GetDataType()); + DCHECK_EQ(syncer::SEARCH_ENGINES, iter->sync_data().GetDataType()); std::string guid = iter->sync_data().GetSpecifics().search_engine().sync_guid(); @@ -1011,12 +1011,12 @@ syncer::SyncError TemplateURLService::ProcessSyncChanges( } syncer::SyncError TemplateURLService::MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) { DCHECK(loaded_); - DCHECK_EQ(type, syncable::SEARCH_ENGINES); + DCHECK_EQ(type, syncer::SEARCH_ENGINES); DCHECK(!sync_processor_.get()); DCHECK(sync_processor.get()); DCHECK(sync_error_factory.get()); @@ -1049,7 +1049,7 @@ syncer::SyncError TemplateURLService::MergeDataAndStartSyncing( // Build maps of our sync GUIDs to syncer::SyncData. SyncDataMap local_data_map = CreateGUIDToSyncDataMap( - GetAllSyncData(syncable::SEARCH_ENGINES)); + GetAllSyncData(syncer::SEARCH_ENGINES)); SyncDataMap sync_data_map = CreateGUIDToSyncDataMap(initial_sync_data); for (SyncDataMap::const_iterator iter = sync_data_map.begin(); @@ -1152,8 +1152,8 @@ syncer::SyncError TemplateURLService::MergeDataAndStartSyncing( return syncer::SyncError(); } -void TemplateURLService::StopSyncing(syncable::ModelType type) { - DCHECK_EQ(type, syncable::SEARCH_ENGINES); +void TemplateURLService::StopSyncing(syncer::ModelType type) { + DCHECK_EQ(type, syncer::SEARCH_ENGINES); models_associated_ = false; sync_processor_.reset(); sync_error_factory_.reset(); diff --git a/chrome/browser/search_engines/template_url_service.h b/chrome/browser/search_engines/template_url_service.h index 050a59c..c029e2b 100644 --- a/chrome/browser/search_engines/template_url_service.h +++ b/chrome/browser/search_engines/template_url_service.h @@ -270,7 +270,7 @@ class TemplateURLService : public WebDataServiceConsumer, // Returns all syncable TemplateURLs from this model as SyncData. This should // include every search engine and no Extension keywords. virtual syncer::SyncDataList GetAllSyncData( - syncable::ModelType type) const OVERRIDE; + syncer::ModelType type) const OVERRIDE; // Process new search engine changes from Sync, merging them into our local // data. This may send notifications if local search engines are added, // updated or removed. @@ -281,11 +281,11 @@ class TemplateURLService : public WebDataServiceConsumer, // to Sync. This may send notifications if local search engines are added, // updated or removed. virtual syncer::SyncError MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; - virtual void StopSyncing(syncable::ModelType type) OVERRIDE; + virtual void StopSyncing(syncer::ModelType type) OVERRIDE; // Processes a local TemplateURL change for Sync. |turl| is the TemplateURL // that has been modified, and |type| is the Sync ChangeType that took place. diff --git a/chrome/browser/search_engines/template_url_service_sync_unittest.cc b/chrome/browser/search_engines/template_url_service_sync_unittest.cc index dbe86d3..a0e3804 100644 --- a/chrome/browser/search_engines/template_url_service_sync_unittest.cc +++ b/chrome/browser/search_engines/template_url_service_sync_unittest.cc @@ -123,7 +123,7 @@ syncer::SyncError TestChangeProcessor::ProcessSyncChanges( const syncer::SyncChangeList& change_list) { if (erroneous_) return syncer::SyncError( - FROM_HERE, "Some error.", syncable::SEARCH_ENGINES); + FROM_HERE, "Some error.", syncer::SEARCH_ENGINES); change_map_.erase(change_map_.begin(), change_map_.end()); for (syncer::SyncChangeList::const_iterator iter = change_list.begin(); @@ -380,7 +380,7 @@ TEST_F(TemplateURLServiceSyncTest, GetAllSyncDataBasic) { model()->Add(CreateTestTemplateURL(ASCIIToUTF16("key2"), "http://key2.com")); model()->Add(CreateTestTemplateURL(ASCIIToUTF16("key3"), "http://key3.com")); syncer::SyncDataList all_sync_data = - model()->GetAllSyncData(syncable::SEARCH_ENGINES); + model()->GetAllSyncData(syncer::SEARCH_ENGINES); EXPECT_EQ(3U, all_sync_data.size()); @@ -399,7 +399,7 @@ TEST_F(TemplateURLServiceSyncTest, GetAllSyncDataNoExtensions) { model()->Add(CreateTestTemplateURL(ASCIIToUTF16("key3"), std::string(chrome::kExtensionScheme) + "://blahblahblah")); syncer::SyncDataList all_sync_data = - model()->GetAllSyncData(syncable::SEARCH_ENGINES); + model()->GetAllSyncData(syncer::SEARCH_ENGINES); EXPECT_EQ(2U, all_sync_data.size()); @@ -419,7 +419,7 @@ TEST_F(TemplateURLServiceSyncTest, GetAllSyncDataNoManagedEngines) { "http://key3.com", std::string(), 100, false, true); model()->Add(managed_turl); syncer::SyncDataList all_sync_data = - model()->GetAllSyncData(syncable::SEARCH_ENGINES); + model()->GetAllSyncData(syncer::SEARCH_ENGINES); EXPECT_EQ(2U, all_sync_data.size()); @@ -753,20 +753,20 @@ TEST_F(TemplateURLServiceSyncTest, MergeSyncAndLocalURLDuplicates) { TEST_F(TemplateURLServiceSyncTest, StartSyncEmpty) { model()->MergeDataAndStartSyncing( - syncable::SEARCH_ENGINES, syncer::SyncDataList(), + syncer::SEARCH_ENGINES, syncer::SyncDataList(), PassProcessor(), CreateAndPassSyncErrorFactory()); - EXPECT_EQ(0U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(0U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); EXPECT_EQ(0U, processor()->change_list_size()); } TEST_F(TemplateURLServiceSyncTest, MergeIntoEmpty) { syncer::SyncDataList initial_data = CreateInitialSyncData(); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); - EXPECT_EQ(3U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(3U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); // We expect the model to have accepted all of the initial sync data. Search // through the model using the GUIDs to ensure that they're present. for (syncer::SyncDataList::const_iterator iter = initial_data.begin(); @@ -787,10 +787,10 @@ TEST_F(TemplateURLServiceSyncTest, MergeInAllNewData) { "xyz")); syncer::SyncDataList initial_data = CreateInitialSyncData(); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); - EXPECT_EQ(6U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(6U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); // We expect the model to have accepted all of the initial sync data. Search // through the model using the GUIDs to ensure that they're present. for (syncer::SyncDataList::const_iterator iter = initial_data.begin(); @@ -820,10 +820,10 @@ TEST_F(TemplateURLServiceSyncTest, MergeSyncIsTheSame) { model()->Add(converted); } - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); - EXPECT_EQ(3U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(3U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); for (syncer::SyncDataList::const_iterator iter = initial_data.begin(); iter != initial_data.end(); ++iter) { std::string guid = GetGUID(*iter); @@ -853,11 +853,11 @@ TEST_F(TemplateURLServiceSyncTest, MergeUpdateFromSync) { initial_data.push_back( TemplateURLService::CreateSyncDataFromTemplateURL(*turl2_older)); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); // Both were local updates, so we expect the same count. - EXPECT_EQ(2U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(2U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); // Check that the first replaced the initial abc TemplateURL. EXPECT_EQ(turl1, model()->GetTemplateURLForGUID("abc")); @@ -884,12 +884,12 @@ TEST_F(TemplateURLServiceSyncTest, MergeAddFromOlderSyncData) { model()->Add(CreateTestTemplateURL(ASCIIToUTF16("unique"), "http://unique.com", "ccc")); // add - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); // The dupe results in a merge. The other two should be added to the model. - EXPECT_EQ(5U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(5U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); // The key1 duplicate results in the local copy winning. Ensure that Sync's // copy was not added, and the local copy is pushed upstream to Sync as an @@ -943,12 +943,12 @@ TEST_F(TemplateURLServiceSyncTest, MergeAddFromNewerSyncData) { model()->Add(CreateTestTemplateURL(ASCIIToUTF16("unique"), "http://unique.com", "ccc", 10)); // add - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); // The dupe results in a merge. The other two should be added to the model. - EXPECT_EQ(5U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(5U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); // The key1 duplicate results in Sync's copy winning. Ensure that Sync's // copy replaced the local copy. @@ -984,7 +984,7 @@ TEST_F(TemplateURLServiceSyncTest, MergeAddFromNewerSyncData) { TEST_F(TemplateURLServiceSyncTest, ProcessChangesEmptyModel) { // We initially have no data. model()->MergeDataAndStartSyncing( - syncable::SEARCH_ENGINES, syncer::SyncDataList(), + syncer::SEARCH_ENGINES, syncer::SyncDataList(), PassProcessor(), CreateAndPassSyncErrorFactory()); // Set up a bunch of ADDs. @@ -998,7 +998,7 @@ TEST_F(TemplateURLServiceSyncTest, ProcessChangesEmptyModel) { model()->ProcessSyncChanges(FROM_HERE, changes); - EXPECT_EQ(3U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(3U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); EXPECT_EQ(0U, processor()->change_list_size()); EXPECT_TRUE(model()->GetTemplateURLForGUID("key1")); EXPECT_TRUE(model()->GetTemplateURLForGUID("key2")); @@ -1006,7 +1006,7 @@ TEST_F(TemplateURLServiceSyncTest, ProcessChangesEmptyModel) { } TEST_F(TemplateURLServiceSyncTest, ProcessChangesNoConflicts) { - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); @@ -1023,7 +1023,7 @@ TEST_F(TemplateURLServiceSyncTest, ProcessChangesNoConflicts) { model()->ProcessSyncChanges(FROM_HERE, changes); // Add one, remove one, update one, so the number shouldn't change. - EXPECT_EQ(3U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(3U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); EXPECT_EQ(0U, processor()->change_list_size()); EXPECT_TRUE(model()->GetTemplateURLForGUID("key1")); EXPECT_TRUE(model()->GetTemplateURLForGUID("key2")); @@ -1036,7 +1036,7 @@ TEST_F(TemplateURLServiceSyncTest, ProcessChangesNoConflicts) { } TEST_F(TemplateURLServiceSyncTest, ProcessChangesWithConflictsSyncWins) { - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); @@ -1051,7 +1051,7 @@ TEST_F(TemplateURLServiceSyncTest, ProcessChangesWithConflictsSyncWins) { model()->ProcessSyncChanges(FROM_HERE, changes); // Add one, update one, so we're up to 4. - EXPECT_EQ(4U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(4U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); // Sync is always newer here, so it should always win. We should create // SyncChanges for the changes to the local entities, since they're synced // too. @@ -1080,7 +1080,7 @@ TEST_F(TemplateURLServiceSyncTest, ProcessChangesWithConflictsSyncWins) { } TEST_F(TemplateURLServiceSyncTest, ProcessChangesWithConflictsLocalWins) { - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); @@ -1097,7 +1097,7 @@ TEST_F(TemplateURLServiceSyncTest, ProcessChangesWithConflictsLocalWins) { model()->ProcessSyncChanges(FROM_HERE, changes); // Add one, update one, so we're up to 4. - EXPECT_EQ(4U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(4U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); // Local data wins twice so two updates are pushed up to Sync. EXPECT_EQ(2U, processor()->change_list_size()); @@ -1134,7 +1134,7 @@ TEST_F(TemplateURLServiceSyncTest, RemoveUpdatedURLOnConflict) { "http://sync.com", "sync", 100, true)); initial_data.push_back( TemplateURLService::CreateSyncDataFromTemplateURL(*turl)); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); TemplateURL* new_turl = @@ -1159,7 +1159,7 @@ TEST_F(TemplateURLServiceSyncTest, RemoveUpdatedURLOnConflict) { TEST_F(TemplateURLServiceSyncTest, ProcessTemplateURLChange) { // Ensure that ProcessTemplateURLChange is called and pushes the correct // changes to Sync whenever local changes are made to TemplateURLs. - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); @@ -1194,7 +1194,7 @@ TEST_F(TemplateURLServiceSyncTest, ProcessTemplateURLChange) { } TEST_F(TemplateURLServiceSyncTest, ProcessChangesWithLocalExtensions) { - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); @@ -1250,7 +1250,7 @@ TEST_F(TemplateURLServiceSyncTest, AutogeneratedKeywordMigrated) { CreateCustomSyncData(*turl, true, turl->url(), turl->sync_guid())); // Now try to sync the data locally. - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); // Both entries should have been added, with explicit keywords. @@ -1296,7 +1296,7 @@ TEST_F(TemplateURLServiceSyncTest, AutogeneratedKeywordConflicts) { "http://other.com/search?q={searchTerms}", "sync2", 150)); initial_data.push_back( CreateCustomSyncData(*turl, true, turl->url(), turl->sync_guid())); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); // In this case, the conflicts should be handled just like any other keyword @@ -1335,7 +1335,7 @@ TEST_F(TemplateURLServiceSyncTest, TwoAutogeneratedKeywordsUsingGoogleBaseURL) { "{google:baseURL}2/search?q={searchTerms}", "key2")); initial_data.push_back( CreateCustomSyncData(*turl, true, turl->url(), turl->sync_guid())); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); // We should still have coalesced the updates to one each. @@ -1385,7 +1385,7 @@ TEST_F(TemplateURLServiceSyncTest, DuplicateEncodingsRemoved) { TemplateURLService::CreateSyncDataFromTemplateURL(*turl)); // Now try to sync the data locally. - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); // The entry should have been added, with duplicate encodings removed. @@ -1405,7 +1405,7 @@ TEST_F(TemplateURLServiceSyncTest, DuplicateEncodingsRemoved) { TEST_F(TemplateURLServiceSyncTest, MergeTwoClientsBasic) { // Start off B with some empty data. - model_b()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model_b()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); @@ -1413,19 +1413,19 @@ TEST_F(TemplateURLServiceSyncTest, MergeTwoClientsBasic) { // has no data. scoped_ptr<SyncChangeProcessorDelegate> delegate_b( new SyncChangeProcessorDelegate(model_b())); - model_a()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, - model_b()->GetAllSyncData(syncable::SEARCH_ENGINES), + model_a()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, + model_b()->GetAllSyncData(syncer::SEARCH_ENGINES), delegate_b.PassAs<syncer::SyncChangeProcessor>(), CreateAndPassSyncErrorFactory()); // They should be consistent. - AssertEquals(model_a()->GetAllSyncData(syncable::SEARCH_ENGINES), - model_b()->GetAllSyncData(syncable::SEARCH_ENGINES)); + AssertEquals(model_a()->GetAllSyncData(syncer::SEARCH_ENGINES), + model_b()->GetAllSyncData(syncer::SEARCH_ENGINES)); } TEST_F(TemplateURLServiceSyncTest, MergeTwoClientsDupesAndConflicts) { // Start off B with some empty data. - model_b()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model_b()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); @@ -1442,23 +1442,23 @@ TEST_F(TemplateURLServiceSyncTest, MergeTwoClientsDupesAndConflicts) { // Merge A and B. scoped_ptr<SyncChangeProcessorDelegate> delegate_b( new SyncChangeProcessorDelegate(model_b())); - model_a()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, - model_b()->GetAllSyncData(syncable::SEARCH_ENGINES), + model_a()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, + model_b()->GetAllSyncData(syncer::SEARCH_ENGINES), delegate_b.PassAs<syncer::SyncChangeProcessor>(), CreateAndPassSyncErrorFactory()); // They should be consistent. - AssertEquals(model_a()->GetAllSyncData(syncable::SEARCH_ENGINES), - model_b()->GetAllSyncData(syncable::SEARCH_ENGINES)); + AssertEquals(model_a()->GetAllSyncData(syncer::SEARCH_ENGINES), + model_b()->GetAllSyncData(syncer::SEARCH_ENGINES)); } TEST_F(TemplateURLServiceSyncTest, StopSyncing) { syncer::SyncError error = - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); ASSERT_FALSE(error.IsSet()); - model()->StopSyncing(syncable::SEARCH_ENGINES); + model()->StopSyncing(syncer::SEARCH_ENGINES); syncer::SyncChangeList changes; changes.push_back(CreateTestSyncChange(syncer::SyncChange::ACTION_UPDATE, @@ -1475,7 +1475,7 @@ TEST_F(TemplateURLServiceSyncTest, StopSyncing) { TEST_F(TemplateURLServiceSyncTest, SyncErrorOnInitialSync) { processor()->set_erroneous(true); syncer::SyncError error = - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); EXPECT_TRUE(error.IsSet()); @@ -1500,7 +1500,7 @@ TEST_F(TemplateURLServiceSyncTest, SyncErrorOnLaterSync) { // Ensure that if the SyncProcessor succeeds in the initial merge, but fails // in future ProcessSyncChanges, we still return an error. syncer::SyncError error = - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); ASSERT_FALSE(error.IsSet()); @@ -1524,7 +1524,7 @@ TEST_F(TemplateURLServiceSyncTest, MergeTwiceWithSameSyncData) { "key1", 10)); // earlier syncer::SyncError error = - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); ASSERT_FALSE(error.IsSet()); @@ -1548,10 +1548,10 @@ TEST_F(TemplateURLServiceSyncTest, MergeTwiceWithSameSyncData) { // Remerge the data again. This simulates shutting down and syncing again // at a different time, but the cloud data has not changed. - model()->StopSyncing(syncable::SEARCH_ENGINES); + model()->StopSyncing(syncer::SEARCH_ENGINES); sync_processor_delegate_.reset(new SyncChangeProcessorDelegate( sync_processor_.get())); - error = model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + error = model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); ASSERT_FALSE(error.IsSet()); @@ -1567,11 +1567,11 @@ TEST_F(TemplateURLServiceSyncTest, SyncedDefaultGUIDArrivesFirst) { scoped_ptr<TemplateURL> turl(CreateTestTemplateURL(ASCIIToUTF16("key2"), "http://key2.com/{searchTerms}", "key2", 90)); initial_data[1] = TemplateURLService::CreateSyncDataFromTemplateURL(*turl); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); model()->SetDefaultSearchProvider(model()->GetTemplateURLForGUID("key2")); - EXPECT_EQ(3U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(3U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); const TemplateURL* default_search = model()->GetDefaultSearchProvider(); ASSERT_TRUE(default_search); @@ -1590,7 +1590,7 @@ TEST_F(TemplateURLServiceSyncTest, SyncedDefaultGUIDArrivesFirst) { "random"))); model()->ProcessSyncChanges(FROM_HERE, changes1); - EXPECT_EQ(4U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(4U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); ASSERT_EQ(default_search, model()->GetDefaultSearchProvider()); // Finally, bring in the expected entry with the right GUID. Ensure that @@ -1601,7 +1601,7 @@ TEST_F(TemplateURLServiceSyncTest, SyncedDefaultGUIDArrivesFirst) { "newdefault"))); model()->ProcessSyncChanges(FROM_HERE, changes2); - EXPECT_EQ(5U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(5U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); ASSERT_NE(default_search, model()->GetDefaultSearchProvider()); ASSERT_EQ("newdefault", model()->GetDefaultSearchProvider()->sync_guid()); } @@ -1630,12 +1630,12 @@ TEST_F(TemplateURLServiceSyncTest, DefaultGuidDeletedAndReplaced) { *turl1)); initial_data.push_back(TemplateURLService::CreateSyncDataFromTemplateURL( *turl2)); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); model()->SetDefaultSearchProvider(model()->GetTemplateURLForGUID("key1")); ASSERT_EQ("key1", model()->GetDefaultSearchProvider()->sync_guid()); - EXPECT_EQ(2U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(2U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); const TemplateURL* default_search = model()->GetDefaultSearchProvider(); ASSERT_TRUE(default_search); @@ -1646,7 +1646,7 @@ TEST_F(TemplateURLServiceSyncTest, DefaultGuidDeletedAndReplaced) { turl1.release())); model()->ProcessSyncChanges(FROM_HERE, changes1); - EXPECT_EQ(1U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(1U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); EXPECT_EQ("key2", model()->GetDefaultSearchProvider()->sync_guid()); EXPECT_EQ("key1", profile_a()->GetTestingPrefService()->GetString( prefs::kSyncedDefaultSearchProviderGUID)); @@ -1668,7 +1668,7 @@ TEST_F(TemplateURLServiceSyncTest, DefaultGuidDeletedAndReplaced) { "newdefault"))); model()->ProcessSyncChanges(FROM_HERE, changes2); - EXPECT_EQ(2U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(2U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); EXPECT_EQ("newdefault", model()->GetDefaultSearchProvider()->sync_guid()); EXPECT_EQ("newdefault", profile_a()->GetTestingPrefService()->GetString( prefs::kSyncedDefaultSearchProviderGUID)); @@ -1702,11 +1702,11 @@ TEST_F(TemplateURLServiceSyncTest, SyncedDefaultArrivesAfterStartup) { "http://key2.com/{searchTerms}", "key2", 90)); initial_data[1] = TemplateURLService::CreateSyncDataFromTemplateURL(*turl); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); // Ensure that the new default has been set. - EXPECT_EQ(4U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(4U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); ASSERT_NE(default_search, model()->GetDefaultSearchProvider()); ASSERT_EQ("key2", model()->GetDefaultSearchProvider()->sync_guid()); } @@ -1731,11 +1731,11 @@ TEST_F(TemplateURLServiceSyncTest, SyncedDefaultAlreadySetOnStartup) { // Now sync the initial data. syncer::SyncDataList initial_data = CreateInitialSyncData(); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); // Ensure that the new entries were added and the default has not changed. - EXPECT_EQ(4U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(4U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); ASSERT_EQ(default_search, model()->GetDefaultSearchProvider()); } @@ -1743,11 +1743,11 @@ TEST_F(TemplateURLServiceSyncTest, SyncWithManagedDefaultSearch) { // First start off with a few entries and make sure we can set an unmanaged // default search provider. syncer::SyncDataList initial_data = CreateInitialSyncData(); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); model()->SetDefaultSearchProvider(model()->GetTemplateURLForGUID("key2")); - EXPECT_EQ(3U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(3U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); ASSERT_FALSE(model()->is_default_search_managed()); ASSERT_TRUE(model()->GetDefaultSearchProvider()); @@ -1771,7 +1771,7 @@ TEST_F(TemplateURLServiceSyncTest, SyncWithManagedDefaultSearch) { "newdefault"))); model()->ProcessSyncChanges(FROM_HERE, changes); - EXPECT_EQ(4U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(4U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); // Change kSyncedDefaultSearchProviderGUID to point to the new entry and // ensure that the DSP remains managed. @@ -1805,10 +1805,10 @@ TEST_F(TemplateURLServiceSyncTest, SyncMergeDeletesDefault) { "http://key1.com/{searchTerms}", "key1", 90)); initial_data[0] = TemplateURLService::CreateSyncDataFromTemplateURL(*turl); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); - EXPECT_EQ(3U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(3U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); EXPECT_FALSE(model()->GetTemplateURLForGUID("whateverguid")); EXPECT_EQ(model()->GetDefaultSearchProvider(), model()->GetTemplateURLForGUID("key1")); @@ -1829,12 +1829,12 @@ TEST_F(TemplateURLServiceSyncTest, LocalDefaultWinsConflict) { "http://key1.com/{searchTerms}", "key1", 90)); initial_data[0] = TemplateURLService::CreateSyncDataFromTemplateURL(*turl); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); // The conflicting TemplateURL should be added, but it should have lost // conflict resolution against the default. - EXPECT_EQ(4U, model()->GetAllSyncData(syncable::SEARCH_ENGINES).size()); + EXPECT_EQ(4U, model()->GetAllSyncData(syncer::SEARCH_ENGINES).size()); const TemplateURL* winner = model()->GetTemplateURLForGUID("whateverguid"); ASSERT_TRUE(winner); EXPECT_EQ(model()->GetDefaultSearchProvider(), winner); @@ -1856,7 +1856,7 @@ TEST_F(TemplateURLServiceSyncTest, DeleteBogusData) { CreateCustomSyncData(*turl, false, turl->url(), std::string())); // Now try to sync the data locally. - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); // Nothing should have been added, and both bogus entries should be marked for @@ -1877,7 +1877,7 @@ TEST_F(TemplateURLServiceSyncTest, PreSyncDeletes) { model()->pre_sync_deletes_.insert("aaa"); model()->Add(CreateTestTemplateURL(ASCIIToUTF16("whatever"), "http://key1.com", "bbb")); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, CreateInitialSyncData(), PassProcessor(), CreateAndPassSyncErrorFactory()); @@ -1943,7 +1943,7 @@ TEST_F(TemplateURLServiceSyncTest, PreSyncUpdates) { initial_data.push_back( TemplateURLService::CreateSyncDataFromTemplateURL(*sync_turl)); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); ASSERT_EQ(added_turl, model()->GetTemplateURLForKeyword( @@ -1967,7 +1967,7 @@ TEST_F(TemplateURLServiceSyncTest, SyncBaseURLs) { "guid")); initial_data.push_back( TemplateURLService::CreateSyncDataFromTemplateURL(*turl)); - model()->MergeDataAndStartSyncing(syncable::SEARCH_ENGINES, initial_data, + model()->MergeDataAndStartSyncing(syncer::SEARCH_ENGINES, initial_data, PassProcessor(), CreateAndPassSyncErrorFactory()); TemplateURL* synced_turl = model()->GetTemplateURLForGUID("guid"); ASSERT_TRUE(synced_turl); diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.cc b/chrome/browser/sync/abstract_profile_sync_service_test.cc index 82b6d5d..f12c501 100644 --- a/chrome/browser/sync/abstract_profile_sync_service_test.cc +++ b/chrome/browser/sync/abstract_profile_sync_service_test.cc @@ -18,6 +18,7 @@ using syncer::TestIdFactory; using content::BrowserThread; +using syncer::ModelType; using syncer::UserShare; using syncer::syncable::BASE_VERSION; using syncer::syncable::CREATE; @@ -25,7 +26,6 @@ using syncer::syncable::IS_DEL; using syncer::syncable::IS_DIR; using syncer::syncable::IS_UNAPPLIED_UPDATE; using syncer::syncable::IS_UNSYNCED; -using syncer::syncable::ModelType; using syncer::syncable::MutableEntry; using syncer::syncable::SERVER_IS_DIR; using syncer::syncable::SERVER_VERSION; @@ -37,7 +37,7 @@ using syncer::syncable::WriteTransaction; /* static */ const std::string ProfileSyncServiceTestHelper::GetTagForType( ModelType model_type) { - return syncable::ModelTypeToRootTag(model_type); + return syncer::ModelTypeToRootTag(model_type); } /* static */ @@ -63,7 +63,7 @@ bool ProfileSyncServiceTestHelper::CreateRoot(ModelType model_type, node.Put(IS_DEL, false); node.Put(syncer::syncable::ID, ids->MakeServer(tag_name)); sync_pb::EntitySpecifics specifics; - syncable::AddDefaultFieldValue(model_type, &specifics); + syncer::AddDefaultFieldValue(model_type, &specifics); node.Put(SPECIFICS, specifics); return true; diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.h b/chrome/browser/sync/abstract_profile_sync_service_test.h index 48b6dec..94a214a 100644 --- a/chrome/browser/sync/abstract_profile_sync_service_test.h +++ b/chrome/browser/sync/abstract_profile_sync_service_test.h @@ -32,9 +32,9 @@ struct UserShare; class ProfileSyncServiceTestHelper { public: - static const std::string GetTagForType(syncable::ModelType model_type); + static const std::string GetTagForType(syncer::ModelType model_type); - static bool CreateRoot(syncable::ModelType model_type, + static bool CreateRoot(syncer::ModelType model_type, syncer::UserShare* service, syncer::TestIdFactory* ids); @@ -57,7 +57,7 @@ class AbstractProfileSyncServiceTest : public testing::Test { virtual void TearDown() OVERRIDE; - bool CreateRoot(syncable::ModelType model_type); + bool CreateRoot(syncer::ModelType model_type); static ProfileKeyedService* BuildTokenService(Profile* profile); protected: @@ -73,7 +73,7 @@ class AbstractProfileSyncServiceTest : public testing::Test { class CreateRootHelper { public: CreateRootHelper(AbstractProfileSyncServiceTest* test, - syncable::ModelType model_type); + syncer::ModelType model_type); virtual ~CreateRootHelper(); const base::Closure& callback() const; @@ -84,7 +84,7 @@ class CreateRootHelper { base::Closure callback_; AbstractProfileSyncServiceTest* test_; - syncable::ModelType model_type_; + syncer::ModelType model_type_; bool success_; }; diff --git a/chrome/browser/sync/backend_migrator.cc b/chrome/browser/sync/backend_migrator.cc index e15dcbb..72e711c 100644 --- a/chrome/browser/sync/backend_migrator.cc +++ b/chrome/browser/sync/backend_migrator.cc @@ -16,11 +16,11 @@ #include "sync/protocol/sync.pb.h" #include "sync/syncable/directory.h" // TODO(tim): Bug 131130. -using syncable::ModelTypeSet; +using syncer::ModelTypeSet; namespace browser_sync { -using syncable::ModelTypeToString; +using syncer::ModelTypeToString; MigrationObserver::~MigrationObserver() {} @@ -45,7 +45,7 @@ BackendMigrator::~BackendMigrator() { #define SDVLOG(verbose_level) DVLOG(verbose_level) << name_ << ": " -void BackendMigrator::MigrateTypes(syncable::ModelTypeSet types) { +void BackendMigrator::MigrateTypes(syncer::ModelTypeSet types) { const ModelTypeSet old_to_migrate = to_migrate_; to_migrate_.PutAll(types); SDVLOG(1) << "MigrateTypes called with " << ModelTypeSetToString(types) @@ -103,7 +103,7 @@ void BackendMigrator::RestartMigration() { ChangeState(DISABLING_TYPES); const ModelTypeSet full_set = service_->GetPreferredDataTypes(); const ModelTypeSet difference = Difference(full_set, to_migrate_); - bool configure_with_nigori = !to_migrate_.Has(syncable::NIGORI); + bool configure_with_nigori = !to_migrate_.Has(syncer::NIGORI); SDVLOG(1) << "BackendMigrator disabling types " << ModelTypeSetToString(to_migrate_) << "; configuring " << ModelTypeSetToString(difference) @@ -135,12 +135,12 @@ void BackendMigrator::OnConfigureDone( namespace { -syncable::ModelTypeSet GetUnsyncedDataTypes(syncer::UserShare* user_share) { +syncer::ModelTypeSet GetUnsyncedDataTypes(syncer::UserShare* user_share) { syncer::ReadTransaction trans(FROM_HERE, user_share); - syncable::ModelTypeSet unsynced_data_types; - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i < syncable::MODEL_TYPE_COUNT; ++i) { - syncable::ModelType type = syncable::ModelTypeFromInt(i); + syncer::ModelTypeSet unsynced_data_types; + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i < syncer::MODEL_TYPE_COUNT; ++i) { + syncer::ModelType type = syncer::ModelTypeFromInt(i); sync_pb::DataTypeProgressMarker progress_marker; trans.GetDirectory()->GetDownloadProgress(type, &progress_marker); if (progress_marker.token().empty()) { @@ -191,13 +191,13 @@ void BackendMigrator::OnConfigureDoneImpl( } if (state_ == DISABLING_TYPES) { - const syncable::ModelTypeSet unsynced_types = + const syncer::ModelTypeSet unsynced_types = GetUnsyncedDataTypes(user_share_); if (!unsynced_types.HasAll(to_migrate_)) { SLOG(WARNING) << "Set of unsynced types: " - << syncable::ModelTypeSetToString(unsynced_types) + << syncer::ModelTypeSetToString(unsynced_types) << " does not contain types to migrate: " - << syncable::ModelTypeSetToString(to_migrate_) + << syncer::ModelTypeSetToString(to_migrate_) << "; not re-enabling yet"; return; } @@ -207,14 +207,14 @@ void BackendMigrator::OnConfigureDoneImpl( // may have chosen to disable types during the migration. const ModelTypeSet full_set = service_->GetPreferredDataTypes(); SDVLOG(1) << "BackendMigrator re-enabling types: " - << syncable::ModelTypeSetToString(full_set); + << syncer::ModelTypeSetToString(full_set); manager_->Configure(full_set, syncer::CONFIGURE_REASON_MIGRATION); } else if (state_ == REENABLING_TYPES) { // We're done! ChangeState(IDLE); SDVLOG(1) << "BackendMigrator: Migration complete for: " - << syncable::ModelTypeSetToString(to_migrate_); + << syncer::ModelTypeSetToString(to_migrate_); to_migrate_.Clear(); if (!migration_done_callback_.is_null()) @@ -226,8 +226,7 @@ BackendMigrator::State BackendMigrator::state() const { return state_; } -syncable::ModelTypeSet - BackendMigrator::GetPendingMigrationTypesForTest() const { +syncer::ModelTypeSet BackendMigrator::GetPendingMigrationTypesForTest() const { return to_migrate_; } diff --git a/chrome/browser/sync/backend_migrator.h b/chrome/browser/sync/backend_migrator.h index c3b2a2f..76c9383 100644 --- a/chrome/browser/sync/backend_migrator.h +++ b/chrome/browser/sync/backend_migrator.h @@ -55,7 +55,7 @@ class BackendMigrator { virtual ~BackendMigrator(); // Starts a sequence of events that will disable and reenable |types|. - void MigrateTypes(syncable::ModelTypeSet types); + void MigrateTypes(syncer::ModelTypeSet types); void AddMigrationObserver(MigrationObserver* observer); bool HasMigrationObserver(MigrationObserver* observer) const; @@ -68,7 +68,7 @@ class BackendMigrator { void OnConfigureDone(const DataTypeManager::ConfigureResult& result); // Returns the types that are currently pending migration (if any). - syncable::ModelTypeSet GetPendingMigrationTypesForTest() const; + syncer::ModelTypeSet GetPendingMigrationTypesForTest() const; private: void ChangeState(State new_state); @@ -94,7 +94,7 @@ class BackendMigrator { ObserverList<MigrationObserver> migration_observers_; - syncable::ModelTypeSet to_migrate_; + syncer::ModelTypeSet to_migrate_; base::WeakPtrFactory<BackendMigrator> weak_ptr_factory_; diff --git a/chrome/browser/sync/backend_migrator_unittest.cc b/chrome/browser/sync/backend_migrator_unittest.cc index 3861fe6..7331072 100644 --- a/chrome/browser/sync/backend_migrator_unittest.cc +++ b/chrome/browser/sync/backend_migrator_unittest.cc @@ -36,9 +36,9 @@ class SyncBackendMigratorTest : public testing::Test { test_user_share_.SetUp(); Mock::VerifyAndClear(manager()); Mock::VerifyAndClear(&service_); - preferred_types_.Put(syncable::BOOKMARKS); - preferred_types_.Put(syncable::PREFERENCES); - preferred_types_.Put(syncable::AUTOFILL); + preferred_types_.Put(syncer::BOOKMARKS); + preferred_types_.Put(syncer::PREFERENCES); + preferred_types_.Put(syncer::AUTOFILL); ON_CALL(service_, GetPreferredDataTypes()). WillByDefault(Return(preferred_types_)); @@ -47,7 +47,7 @@ class SyncBackendMigratorTest : public testing::Test { new BackendMigrator( "Profile0", test_user_share_.user_share(), service(), manager(), base::Closure())); - SetUnsyncedTypes(syncable::ModelTypeSet()); + SetUnsyncedTypes(syncer::ModelTypeSet()); } virtual void TearDown() { @@ -57,12 +57,12 @@ class SyncBackendMigratorTest : public testing::Test { // Marks all types in |unsynced_types| as unsynced and all other // types as synced. - void SetUnsyncedTypes(syncable::ModelTypeSet unsynced_types) { + void SetUnsyncedTypes(syncer::ModelTypeSet unsynced_types) { syncer::WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i < syncable::MODEL_TYPE_COUNT; ++i) { - syncable::ModelType type = syncable::ModelTypeFromInt(i); + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i < syncer::MODEL_TYPE_COUNT; ++i) { + syncer::ModelType type = syncer::ModelTypeFromInt(i); sync_pb::DataTypeProgressMarker progress_marker; if (!unsynced_types.Has(type)) { progress_marker.set_token("dummy"); @@ -72,7 +72,7 @@ class SyncBackendMigratorTest : public testing::Test { } void SendConfigureDone(DataTypeManager::ConfigureStatus status, - syncable::ModelTypeSet requested_types) { + syncer::ModelTypeSet requested_types) { if (status == DataTypeManager::OK) { DataTypeManager::ConfigureResult result(status, requested_types); migrator_->OnConfigureDone(result); @@ -82,7 +82,7 @@ class SyncBackendMigratorTest : public testing::Test { status, requested_types, errors, - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); migrator_->OnConfigureDone(result); } message_loop_.RunAllPending(); @@ -90,9 +90,9 @@ class SyncBackendMigratorTest : public testing::Test { ProfileSyncService* service() { return &service_; } DataTypeManagerMock* manager() { return &manager_; } - syncable::ModelTypeSet preferred_types() { return preferred_types_; } + syncer::ModelTypeSet preferred_types() { return preferred_types_; } BackendMigrator* migrator() { return migrator_.get(); } - void RemovePreferredType(syncable::ModelType type) { + void RemovePreferredType(syncer::ModelType type) { preferred_types_.Remove(type); Mock::VerifyAndClear(&service_); ON_CALL(service_, GetPreferredDataTypes()). @@ -102,7 +102,7 @@ class SyncBackendMigratorTest : public testing::Test { private: scoped_ptr<SyncSessionSnapshot> snap_; MessageLoop message_loop_; - syncable::ModelTypeSet preferred_types_; + syncer::ModelTypeSet preferred_types_; NiceMock<ProfileSyncServiceMock> service_; NiceMock<DataTypeManagerMock> manager_; syncer::TestUserShare test_user_share_; @@ -123,10 +123,10 @@ TEST_F(SyncBackendMigratorTest, Sanity) { migrator()->AddMigrationObserver(&migration_observer); EXPECT_CALL(migration_observer, OnMigrationStateChange()).Times(4); - syncable::ModelTypeSet to_migrate, difference; - to_migrate.Put(syncable::PREFERENCES); - difference.Put(syncable::AUTOFILL); - difference.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet to_migrate, difference; + to_migrate.Put(syncer::PREFERENCES); + difference.Put(syncer::AUTOFILL); + difference.Put(syncer::BOOKMARKS); EXPECT_CALL(*manager(), state()) .WillOnce(Return(DataTypeManager::CONFIGURED)); @@ -140,7 +140,7 @@ TEST_F(SyncBackendMigratorTest, Sanity) { SendConfigureDone(DataTypeManager::OK, difference); EXPECT_EQ(BackendMigrator::REENABLING_TYPES, migrator()->state()); - SetUnsyncedTypes(syncable::ModelTypeSet()); + SetUnsyncedTypes(syncer::ModelTypeSet()); SendConfigureDone(DataTypeManager::OK, preferred_types()); EXPECT_EQ(BackendMigrator::IDLE, migrator()->state()); @@ -150,10 +150,10 @@ TEST_F(SyncBackendMigratorTest, Sanity) { // Test that in the normal case with Nigori a migration transitions through // each state and wind up back in IDLE. TEST_F(SyncBackendMigratorTest, MigrateNigori) { - syncable::ModelTypeSet to_migrate, difference; - to_migrate.Put(syncable::NIGORI); - difference.Put(syncable::AUTOFILL); - difference.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet to_migrate, difference; + to_migrate.Put(syncer::NIGORI); + difference.Put(syncer::AUTOFILL); + difference.Put(syncer::BOOKMARKS); EXPECT_CALL(*manager(), state()) .WillOnce(Return(DataTypeManager::CONFIGURED)); @@ -168,7 +168,7 @@ TEST_F(SyncBackendMigratorTest, MigrateNigori) { SendConfigureDone(DataTypeManager::OK, difference); EXPECT_EQ(BackendMigrator::REENABLING_TYPES, migrator()->state()); - SetUnsyncedTypes(syncable::ModelTypeSet()); + SetUnsyncedTypes(syncer::ModelTypeSet()); SendConfigureDone(DataTypeManager::OK, preferred_types()); EXPECT_EQ(BackendMigrator::IDLE, migrator()->state()); } @@ -177,8 +177,8 @@ TEST_F(SyncBackendMigratorTest, MigrateNigori) { // Test that the migrator waits for the data type manager to be idle before // starting a migration. TEST_F(SyncBackendMigratorTest, WaitToStart) { - syncable::ModelTypeSet to_migrate; - to_migrate.Put(syncable::PREFERENCES); + syncer::ModelTypeSet to_migrate; + to_migrate.Put(syncer::PREFERENCES); EXPECT_CALL(*manager(), state()) .WillOnce(Return(DataTypeManager::CONFIGURING)); @@ -190,8 +190,8 @@ TEST_F(SyncBackendMigratorTest, WaitToStart) { EXPECT_CALL(*manager(), state()) .WillOnce(Return(DataTypeManager::CONFIGURED)); EXPECT_CALL(*manager(), Configure(_, syncer::CONFIGURE_REASON_MIGRATION)); - SetUnsyncedTypes(syncable::ModelTypeSet()); - SendConfigureDone(DataTypeManager::OK, syncable::ModelTypeSet()); + SetUnsyncedTypes(syncer::ModelTypeSet()); + SendConfigureDone(DataTypeManager::OK, syncer::ModelTypeSet()); EXPECT_EQ(BackendMigrator::DISABLING_TYPES, migrator()->state()); } @@ -199,12 +199,12 @@ TEST_F(SyncBackendMigratorTest, WaitToStart) { // Test that the migrator can cope with a migration request while a migration // is in progress. TEST_F(SyncBackendMigratorTest, RestartMigration) { - syncable::ModelTypeSet to_migrate1, to_migrate2, to_migrate_union, bookmarks; - to_migrate1.Put(syncable::PREFERENCES); - to_migrate2.Put(syncable::AUTOFILL); - to_migrate_union.Put(syncable::PREFERENCES); - to_migrate_union.Put(syncable::AUTOFILL); - bookmarks.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet to_migrate1, to_migrate2, to_migrate_union, bookmarks; + to_migrate1.Put(syncer::PREFERENCES); + to_migrate2.Put(syncer::AUTOFILL); + to_migrate_union.Put(syncer::PREFERENCES); + to_migrate_union.Put(syncer::AUTOFILL); + bookmarks.Put(syncer::BOOKMARKS); EXPECT_CALL(*manager(), state()) .WillOnce(Return(DataTypeManager::CONFIGURED)); @@ -215,7 +215,7 @@ TEST_F(SyncBackendMigratorTest, RestartMigration) { EXPECT_EQ(BackendMigrator::DISABLING_TYPES, migrator()->state()); migrator()->MigrateTypes(to_migrate2); - const syncable::ModelTypeSet difference1 = + const syncer::ModelTypeSet difference1 = Difference(preferred_types(), to_migrate1); Mock::VerifyAndClearExpectations(manager()); @@ -233,11 +233,11 @@ TEST_F(SyncBackendMigratorTest, RestartMigration) { // Test that an external invocation of Configure(...) during a migration results // in a migration reattempt. TEST_F(SyncBackendMigratorTest, InterruptedWhileDisablingTypes) { - syncable::ModelTypeSet to_migrate; - syncable::ModelTypeSet difference; - to_migrate.Put(syncable::PREFERENCES); - difference.Put(syncable::AUTOFILL); - difference.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet to_migrate; + syncer::ModelTypeSet difference; + to_migrate.Put(syncer::PREFERENCES); + difference.Put(syncer::AUTOFILL); + difference.Put(syncer::BOOKMARKS); EXPECT_CALL(*manager(), state()) .WillOnce(Return(DataTypeManager::CONFIGURED)); @@ -249,7 +249,7 @@ TEST_F(SyncBackendMigratorTest, InterruptedWhileDisablingTypes) { Mock::VerifyAndClearExpectations(manager()); EXPECT_CALL(*manager(), Configure(HasModelTypes(difference), syncer::CONFIGURE_REASON_MIGRATION)); - SetUnsyncedTypes(syncable::ModelTypeSet()); + SetUnsyncedTypes(syncer::ModelTypeSet()); SendConfigureDone(DataTypeManager::OK, preferred_types()); EXPECT_EQ(BackendMigrator::DISABLING_TYPES, migrator()->state()); @@ -259,10 +259,10 @@ TEST_F(SyncBackendMigratorTest, InterruptedWhileDisablingTypes) { // migrator while it's waiting for disabled types to have been purged // from the sync db. TEST_F(SyncBackendMigratorTest, WaitingForPurge) { - syncable::ModelTypeSet to_migrate, difference; - to_migrate.Put(syncable::PREFERENCES); - to_migrate.Put(syncable::AUTOFILL); - difference.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet to_migrate, difference; + to_migrate.Put(syncer::PREFERENCES); + to_migrate.Put(syncer::AUTOFILL); + difference.Put(syncer::BOOKMARKS); EXPECT_CALL(*manager(), state()) .WillOnce(Return(DataTypeManager::CONFIGURED)); @@ -275,8 +275,8 @@ TEST_F(SyncBackendMigratorTest, WaitingForPurge) { SendConfigureDone(DataTypeManager::OK, difference); EXPECT_EQ(BackendMigrator::DISABLING_TYPES, migrator()->state()); - syncable::ModelTypeSet prefs; - prefs.Put(syncable::PREFERENCES); + syncer::ModelTypeSet prefs; + prefs.Put(syncer::PREFERENCES); SetUnsyncedTypes(prefs); SendConfigureDone(DataTypeManager::OK, difference); EXPECT_EQ(BackendMigrator::DISABLING_TYPES, migrator()->state()); @@ -287,8 +287,8 @@ TEST_F(SyncBackendMigratorTest, WaitingForPurge) { } TEST_F(SyncBackendMigratorTest, MigratedTypeDisabledByUserDuringMigration) { - syncable::ModelTypeSet to_migrate; - to_migrate.Put(syncable::PREFERENCES); + syncer::ModelTypeSet to_migrate; + to_migrate.Put(syncer::PREFERENCES); EXPECT_CALL(*manager(), state()) .WillOnce(Return(DataTypeManager::CONFIGURED)); @@ -296,26 +296,26 @@ TEST_F(SyncBackendMigratorTest, MigratedTypeDisabledByUserDuringMigration) { .Times(2); migrator()->MigrateTypes(to_migrate); - RemovePreferredType(syncable::PREFERENCES); + RemovePreferredType(syncer::PREFERENCES); SetUnsyncedTypes(to_migrate); SendConfigureDone(DataTypeManager::OK, preferred_types()); EXPECT_EQ(BackendMigrator::REENABLING_TYPES, migrator()->state()); - SetUnsyncedTypes(syncable::ModelTypeSet()); + SetUnsyncedTypes(syncer::ModelTypeSet()); SendConfigureDone(DataTypeManager::OK, preferred_types()); EXPECT_EQ(BackendMigrator::IDLE, migrator()->state()); } TEST_F(SyncBackendMigratorTest, ConfigureFailure) { - syncable::ModelTypeSet to_migrate; - to_migrate.Put(syncable::PREFERENCES); + syncer::ModelTypeSet to_migrate; + to_migrate.Put(syncer::PREFERENCES); EXPECT_CALL(*manager(), state()) .WillOnce(Return(DataTypeManager::CONFIGURED)); EXPECT_CALL(*manager(), Configure(_, syncer::CONFIGURE_REASON_MIGRATION)) .Times(1); migrator()->MigrateTypes(to_migrate); - SetUnsyncedTypes(syncable::ModelTypeSet()); - SendConfigureDone(DataTypeManager::ABORTED, syncable::ModelTypeSet()); + SetUnsyncedTypes(syncer::ModelTypeSet()); + SendConfigureDone(DataTypeManager::ABORTED, syncer::ModelTypeSet()); EXPECT_EQ(BackendMigrator::IDLE, migrator()->state()); } diff --git a/chrome/browser/sync/failed_datatypes_handler.cc b/chrome/browser/sync/failed_datatypes_handler.cc index 490140b..effba20 100644 --- a/chrome/browser/sync/failed_datatypes_handler.cc +++ b/chrome/browser/sync/failed_datatypes_handler.cc @@ -15,9 +15,9 @@ FailedDatatypesHandler::FailedDatatypesHandler(ProfileSyncService* service) FailedDatatypesHandler::~FailedDatatypesHandler() { } -syncable::ModelTypeSet GetTypesFromErrorsList( +syncer::ModelTypeSet GetTypesFromErrorsList( const std::vector<syncer::SyncError>& errors) { - syncable::ModelTypeSet result; + syncer::ModelTypeSet result; for (std::vector<syncer::SyncError>::const_iterator it = errors.begin(); it != errors.end(); ++it) { DCHECK(!result.Has(it->type())); @@ -26,8 +26,8 @@ syncable::ModelTypeSet GetTypesFromErrorsList( return result; } -syncable::ModelTypeSet FailedDatatypesHandler::GetFailedTypes() const { - syncable::ModelTypeSet result = GetTypesFromErrorsList(startup_errors_); +syncer::ModelTypeSet FailedDatatypesHandler::GetFailedTypes() const { + syncer::ModelTypeSet result = GetTypesFromErrorsList(startup_errors_); result.PutAll(GetTypesFromErrorsList(runtime_errors_)); return result; } @@ -35,7 +35,7 @@ syncable::ModelTypeSet FailedDatatypesHandler::GetFailedTypes() const { bool FailedDatatypesHandler::UpdateFailedDatatypes( const std::list<syncer::SyncError>& errors, FailureType failure_type) { - const syncable::ModelTypeSet types = GetFailedTypes(); + const syncer::ModelTypeSet types = GetFailedTypes(); if (failure_type == RUNTIME) { runtime_errors_.insert(runtime_errors_.end(), errors.begin(), diff --git a/chrome/browser/sync/failed_datatypes_handler.h b/chrome/browser/sync/failed_datatypes_handler.h index be60136..2eb4a50 100644 --- a/chrome/browser/sync/failed_datatypes_handler.h +++ b/chrome/browser/sync/failed_datatypes_handler.h @@ -40,7 +40,7 @@ class FailedDatatypesHandler { std::vector<syncer::SyncError> GetAllErrors() const; // Returns the types that are failing. - syncable::ModelTypeSet GetFailedTypes() const; + syncer::ModelTypeSet GetFailedTypes() const; private: // Returns if there are any failed types. diff --git a/chrome/browser/sync/glue/app_notification_data_type_controller.cc b/chrome/browser/sync/glue/app_notification_data_type_controller.cc index 5e4a393..c561177 100644 --- a/chrome/browser/sync/glue/app_notification_data_type_controller.cc +++ b/chrome/browser/sync/glue/app_notification_data_type_controller.cc @@ -23,7 +23,7 @@ AppNotificationDataTypeController::AppNotificationDataTypeController( ProfileSyncComponentsFactory* profile_sync_factory, Profile* profile, ProfileSyncService* sync_service) - : UIDataTypeController(syncable::APP_NOTIFICATIONS, + : UIDataTypeController(syncer::APP_NOTIFICATIONS, profile_sync_factory, profile, sync_service) { diff --git a/chrome/browser/sync/glue/app_notification_data_type_controller_unittest.cc b/chrome/browser/sync/glue/app_notification_data_type_controller_unittest.cc index 30e4ee0..1db8296 100644 --- a/chrome/browser/sync/glue/app_notification_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/app_notification_data_type_controller_unittest.cc @@ -86,7 +86,7 @@ class SyncAppNotificationDataTypeControllerTest virtual void TearDown() { // Must be done before we pump the loop. - syncable_service_.StopSyncing(syncable::APP_NOTIFICATIONS); + syncable_service_.StopSyncing(syncer::APP_NOTIFICATIONS); app_notif_dtc_ = NULL; PumpLoop(); } @@ -121,7 +121,7 @@ class SyncAppNotificationDataTypeControllerTest EXPECT_CALL(model_load_callback_, Run(_, _)); // Ownership gets passed to caller of CreateGenericChangeProcessor. EXPECT_CALL(*profile_sync_factory_, - GetSyncableServiceForType(syncable::APP_NOTIFICATIONS)). + GetSyncableServiceForType(syncer::APP_NOTIFICATIONS)). WillOnce(Return(syncable_service_.AsWeakPtr())); EXPECT_CALL(*profile_sync_factory_, CreateSharedChangeProcessor()). WillOnce(MakeSharedChangeProcessor()); @@ -218,7 +218,7 @@ TEST_F(SyncAppNotificationDataTypeControllerTest, StartAssociationFailed) { EXPECT_CALL(start_callback_, Run(DataTypeController::ASSOCIATION_FAILED, _)); syncable_service_.set_merge_data_and_start_syncing_error( - syncer::SyncError(FROM_HERE, "Error", syncable::APP_NOTIFICATIONS)); + syncer::SyncError(FROM_HERE, "Error", syncer::APP_NOTIFICATIONS)); Start(); EXPECT_EQ(DataTypeController::DISABLED, app_notif_dtc_->state()); diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.cc b/chrome/browser/sync/glue/autofill_data_type_controller.cc index 6a00be6..669e247 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller.cc @@ -27,8 +27,8 @@ AutofillDataTypeController::AutofillDataTypeController( profile_sync_factory, profile, sync_service) { } -syncable::ModelType AutofillDataTypeController::type() const { - return syncable::AUTOFILL; +syncer::ModelType AutofillDataTypeController::type() const { + return syncer::AUTOFILL; } syncer::ModelSafeGroup AutofillDataTypeController::model_safe_group() diff --git a/chrome/browser/sync/glue/autofill_data_type_controller.h b/chrome/browser/sync/glue/autofill_data_type_controller.h index 7f398f5..1e7e686 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller.h +++ b/chrome/browser/sync/glue/autofill_data_type_controller.h @@ -29,7 +29,7 @@ class AutofillDataTypeController : public NewNonFrontendDataTypeController, ProfileSyncService* sync_service); // NewNonFrontendDataTypeController implementation. - virtual syncable::ModelType type() const OVERRIDE; + virtual syncer::ModelType type() const OVERRIDE; virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE; // content::NotificationObserver implementation. diff --git a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc index 652b6ab..3476a17 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc @@ -101,10 +101,9 @@ class SyncAutofillDataTypeControllerTest : public testing::Test { last_start_error_ = error; } - void OnLoadFinished(syncable::ModelType type, - syncer::SyncError error) { + void OnLoadFinished(syncer::ModelType type, syncer::SyncError error) { EXPECT_FALSE(error.IsSet()); - EXPECT_EQ(type, syncable::AUTOFILL); + EXPECT_EQ(type, syncer::AUTOFILL); } virtual void TearDown() { diff --git a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc index 0cef8b4..2889ed5 100644 --- a/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc +++ b/chrome/browser/sync/glue/autofill_profile_data_type_controller.cc @@ -34,8 +34,8 @@ AutofillProfileDataTypeController::AutofillProfileDataTypeController( personal_data_(NULL) { } -syncable::ModelType AutofillProfileDataTypeController::type() const { - return syncable::AUTOFILL_PROFILE; +syncer::ModelType AutofillProfileDataTypeController::type() const { + return syncer::AUTOFILL_PROFILE; } syncer::ModelSafeGroup diff --git a/chrome/browser/sync/glue/autofill_profile_data_type_controller.h b/chrome/browser/sync/glue/autofill_profile_data_type_controller.h index 32561fe..141cbee 100644 --- a/chrome/browser/sync/glue/autofill_profile_data_type_controller.h +++ b/chrome/browser/sync/glue/autofill_profile_data_type_controller.h @@ -29,7 +29,7 @@ class AutofillProfileDataTypeController ProfileSyncService* sync_service); // NewNonFrontendDataTypeController implementation. - virtual syncable::ModelType type() const OVERRIDE; + virtual syncer::ModelType type() const OVERRIDE; virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE; // content::NotificationObserver implementation. diff --git a/chrome/browser/sync/glue/backend_data_type_configurer.h b/chrome/browser/sync/glue/backend_data_type_configurer.h index 43ab25a..4e22a2f 100644 --- a/chrome/browser/sync/glue/backend_data_type_configurer.h +++ b/chrome/browser/sync/glue/backend_data_type_configurer.h @@ -34,10 +34,10 @@ class BackendDataTypeConfigurer { // Nigori. virtual void ConfigureDataTypes( syncer::ConfigureReason reason, - syncable::ModelTypeSet types_to_add, - syncable::ModelTypeSet types_to_remove, + syncer::ModelTypeSet types_to_add, + syncer::ModelTypeSet types_to_remove, NigoriState nigori_state, - base::Callback<void(syncable::ModelTypeSet)> ready_task, + base::Callback<void(syncer::ModelTypeSet)> ready_task, base::Callback<void()> retry_callback) = 0; protected: diff --git a/chrome/browser/sync/glue/bookmark_change_processor.cc b/chrome/browser/sync/glue/bookmark_change_processor.cc index fcce75e..63eb3f6 100644 --- a/chrome/browser/sync/glue/bookmark_change_processor.cc +++ b/chrome/browser/sync/glue/bookmark_change_processor.cc @@ -230,12 +230,12 @@ void BookmarkChangeProcessor::BookmarkNodeChanged(BookmarkModel* model, LOG(ERROR) << "Deleted entry."; } else { syncer::Cryptographer* crypto = trans.GetCryptographer(); - syncable::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes()); + syncer::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes()); const sync_pb::EntitySpecifics& specifics = sync_node.GetEntry()->Get(syncer::syncable::SPECIFICS); CHECK(specifics.has_encrypted()); const bool can_decrypt = crypto->CanDecrypt(specifics.encrypted()); - const bool agreement = encrypted_types.Has(syncable::BOOKMARKS); + const bool agreement = encrypted_types.Has(syncer::BOOKMARKS); if (!agreement && !can_decrypt) { error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE, "Could not InitByIdLookup on BookmarkNodeChanged, " @@ -357,7 +357,7 @@ bool BookmarkChangeProcessor::PlaceSyncNode(MoveOrCreate operation, if (index == 0) { // Insert into first position. success = (operation == CREATE) ? - dst->InitByCreation(syncable::BOOKMARKS, sync_parent, NULL) : + dst->InitByCreation(syncer::BOOKMARKS, sync_parent, NULL) : dst->SetPosition(sync_parent, NULL); if (success) { DCHECK_EQ(dst->GetParentId(), sync_parent.GetId()); @@ -373,7 +373,7 @@ bool BookmarkChangeProcessor::PlaceSyncNode(MoveOrCreate operation, return false; } success = (operation == CREATE) ? - dst->InitByCreation(syncable::BOOKMARKS, sync_parent, &sync_prev) : + dst->InitByCreation(syncer::BOOKMARKS, sync_parent, &sync_prev) : dst->SetPosition(sync_parent, &sync_prev); if (success) { DCHECK_EQ(dst->GetParentId(), sync_parent.GetId()); diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.cc b/chrome/browser/sync/glue/bookmark_data_type_controller.cc index b59701d..570f4d7 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller.cc @@ -28,8 +28,8 @@ BookmarkDataTypeController::BookmarkDataTypeController( sync_service) { } -syncable::ModelType BookmarkDataTypeController::type() const { - return syncable::BOOKMARKS; +syncer::ModelType BookmarkDataTypeController::type() const { + return syncer::BOOKMARKS; } void BookmarkDataTypeController::Observe( diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller.h b/chrome/browser/sync/glue/bookmark_data_type_controller.h index 15992eb..3825c76 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller.h +++ b/chrome/browser/sync/glue/bookmark_data_type_controller.h @@ -25,7 +25,7 @@ class BookmarkDataTypeController : public FrontendDataTypeController, ProfileSyncService* sync_service); // FrontendDataTypeController interface. - virtual syncable::ModelType type() const OVERRIDE; + virtual syncer::ModelType type() const OVERRIDE; // content::NotificationObserver interface. virtual void Observe(int type, diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc index 600454c..16cef81 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc @@ -229,7 +229,7 @@ TEST_F(SyncBookmarkDataTypeControllerTest, StartAssociationFailed) { EXPECT_CALL(*model_associator_, AssociateModels()). WillRepeatedly(Return(syncer::SyncError(FROM_HERE, "error", - syncable::BOOKMARKS))); + syncer::BOOKMARKS))); EXPECT_CALL(start_callback_, Run(DataTypeController::ASSOCIATION_FAILED, _)); diff --git a/chrome/browser/sync/glue/bookmark_model_associator.cc b/chrome/browser/sync/glue/bookmark_model_associator.cc index f810eb7..2b07033 100644 --- a/chrome/browser/sync/glue/bookmark_model_associator.cc +++ b/chrome/browser/sync/glue/bookmark_model_associator.cc @@ -663,9 +663,9 @@ bool BookmarkModelAssociator::LoadAssociations() { bool BookmarkModelAssociator::CryptoReadyIfNecessary() { // We only access the cryptographer while holding a transaction. syncer::ReadTransaction trans(FROM_HERE, user_share_); - const syncable::ModelTypeSet encrypted_types = + const syncer::ModelTypeSet encrypted_types = syncer::GetEncryptedTypes(&trans); - return !encrypted_types.Has(syncable::BOOKMARKS) || + return !encrypted_types.Has(syncer::BOOKMARKS) || trans.GetCryptographer()->is_ready(); } diff --git a/chrome/browser/sync/glue/bookmark_model_associator.h b/chrome/browser/sync/glue/bookmark_model_associator.h index e6e0131..8513bc4 100644 --- a/chrome/browser/sync/glue/bookmark_model_associator.h +++ b/chrome/browser/sync/glue/bookmark_model_associator.h @@ -35,7 +35,7 @@ namespace browser_sync { class BookmarkModelAssociator : public PerDataTypeAssociatorInterface<BookmarkNode, int64> { public: - static syncable::ModelType model_type() { return syncable::BOOKMARKS; } + static syncer::ModelType model_type() { return syncer::BOOKMARKS; } // |expect_mobile_bookmarks_folder| controls whether or not we // expect the mobile bookmarks permanent folder to be created. // Should be set to true only by mobile clients. diff --git a/chrome/browser/sync/glue/bridged_sync_notifier.cc b/chrome/browser/sync/glue/bridged_sync_notifier.cc index 61a7c900..a9de057 100644 --- a/chrome/browser/sync/glue/bridged_sync_notifier.cc +++ b/chrome/browser/sync/glue/bridged_sync_notifier.cc @@ -49,13 +49,13 @@ void BridgedSyncNotifier::UpdateCredentials( } void BridgedSyncNotifier::UpdateEnabledTypes( - syncable::ModelTypeSet enabled_types) { + syncer::ModelTypeSet enabled_types) { if (delegate_.get()) delegate_->UpdateEnabledTypes(enabled_types); } void BridgedSyncNotifier::SendNotification( - syncable::ModelTypeSet changed_types) { + syncer::ModelTypeSet changed_types) { if (delegate_.get()) delegate_->SendNotification(changed_types); } diff --git a/chrome/browser/sync/glue/bridged_sync_notifier.h b/chrome/browser/sync/glue/bridged_sync_notifier.h index 1ce4770..b856080ae 100644 --- a/chrome/browser/sync/glue/bridged_sync_notifier.h +++ b/chrome/browser/sync/glue/bridged_sync_notifier.h @@ -39,9 +39,9 @@ class BridgedSyncNotifier : public syncer::SyncNotifier { virtual void UpdateCredentials( const std::string& email, const std::string& token) OVERRIDE; virtual void UpdateEnabledTypes( - syncable::ModelTypeSet enabled_types) OVERRIDE; + syncer::ModelTypeSet enabled_types) OVERRIDE; virtual void SendNotification( - syncable::ModelTypeSet changed_types) OVERRIDE; + syncer::ModelTypeSet changed_types) OVERRIDE; private: // The notification bridge that we register the observers with. diff --git a/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc b/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc index 71fab0d..e45ddf3 100644 --- a/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc +++ b/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc @@ -25,7 +25,7 @@ namespace { using ::testing::NiceMock; using ::testing::StrictMock; using content::BrowserThread; -using syncer::syncable::HasModelTypes; +using syncer::HasModelTypes; class MockChromeSyncNotificationBridge : public ChromeSyncNotificationBridge { public: @@ -49,8 +49,8 @@ class MockSyncNotifier : public syncer::SyncNotifier { MOCK_METHOD1(SetUniqueId, void(const std::string&)); MOCK_METHOD1(SetStateDeprecated, void(const std::string&)); MOCK_METHOD2(UpdateCredentials, void(const std::string&, const std::string&)); - MOCK_METHOD1(UpdateEnabledTypes, void(syncable::ModelTypeSet)); - MOCK_METHOD1(SendNotification, void(syncable::ModelTypeSet)); + MOCK_METHOD1(UpdateEnabledTypes, void(syncer::ModelTypeSet)); + MOCK_METHOD1(SendNotification, void(syncer::ModelTypeSet)); }; // All tests just verify that each call is passed through to the delegate, with @@ -106,16 +106,14 @@ TEST_F(BridgedSyncNotifierTest, UpdateCredentials) { } TEST_F(BridgedSyncNotifierTest, UpdateEnabledTypes) { - syncable::ModelTypeSet enabled_types(syncable::BOOKMARKS, - syncable::PREFERENCES); + syncer::ModelTypeSet enabled_types(syncer::BOOKMARKS, syncer::PREFERENCES); EXPECT_CALL(*mock_delegate_, UpdateEnabledTypes(HasModelTypes(enabled_types))); bridged_notifier_.UpdateEnabledTypes(enabled_types); } TEST_F(BridgedSyncNotifierTest, SendNotification) { - syncable::ModelTypeSet changed_types(syncable::SESSIONS, - syncable::EXTENSIONS); + syncer::ModelTypeSet changed_types(syncer::SESSIONS, syncer::EXTENSIONS); EXPECT_CALL(*mock_delegate_, SendNotification(HasModelTypes(changed_types))); bridged_notifier_.SendNotification(changed_types); } diff --git a/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc b/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc index 06e1e82..5ae44d0 100644 --- a/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc +++ b/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc @@ -42,9 +42,9 @@ class SyncBrowserThreadModelWorkerTest : public testing::Test { // DoWork hasn't executed within action_timeout_ms() ms. void ScheduleWork() { // We wait until the callback is done. So it is safe to use unretained. - syncer::WorkCallback c = - base::Bind(&SyncBrowserThreadModelWorkerTest::DoWork, - base::Unretained(this)); + syncer::WorkCallback c = + base::Bind(&SyncBrowserThreadModelWorkerTest::DoWork, + base::Unretained(this)); timer()->Start( FROM_HERE, TimeDelta::FromMilliseconds(TestTimeouts::action_timeout_ms()), diff --git a/chrome/browser/sync/glue/change_processor_mock.h b/chrome/browser/sync/glue/change_processor_mock.h index 03ea5ef..eed753c 100644 --- a/chrome/browser/sync/glue/change_processor_mock.h +++ b/chrome/browser/sync/glue/change_processor_mock.h @@ -33,7 +33,7 @@ class ChangeProcessorMock MOCK_METHOD3(CreateAndUploadError, syncer::SyncError(const tracked_objects::Location&, const std::string&, - syncable::ModelType)); + syncer::ModelType)); }; diff --git a/chrome/browser/sync/glue/chrome_sync_notification_bridge.cc b/chrome/browser/sync/glue/chrome_sync_notification_bridge.cc index 5b871de..9936fa0 100644 --- a/chrome/browser/sync/glue/chrome_sync_notification_bridge.cc +++ b/chrome/browser/sync/glue/chrome_sync_notification_bridge.cc @@ -28,7 +28,7 @@ ChromeSyncNotificationBridge::ChromeSyncNotificationBridge( ChromeSyncNotificationBridge::~ChromeSyncNotificationBridge() {} void ChromeSyncNotificationBridge::UpdateEnabledTypes( - const syncable::ModelTypeSet types) { + const syncer::ModelTypeSet types) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); enabled_types_ = types; } @@ -59,14 +59,14 @@ void ChromeSyncNotificationBridge::Observe( return; } - content::Details<const syncable::ModelTypePayloadMap> + content::Details<const syncer::ModelTypePayloadMap> payload_details(details); - syncable::ModelTypePayloadMap payload_map = *(payload_details.ptr()); + syncer::ModelTypePayloadMap payload_map = *(payload_details.ptr()); if (payload_map.empty()) { // No model types to invalidate, invalidating all enabled types. payload_map = - syncable::ModelTypePayloadMapFromEnumSet(enabled_types_, std::string()); + syncer::ModelTypePayloadMapFromEnumSet(enabled_types_, std::string()); } observers_->Notify( diff --git a/chrome/browser/sync/glue/chrome_sync_notification_bridge.h b/chrome/browser/sync/glue/chrome_sync_notification_bridge.h index 9f35ef0..cc133bd 100644 --- a/chrome/browser/sync/glue/chrome_sync_notification_bridge.h +++ b/chrome/browser/sync/glue/chrome_sync_notification_bridge.h @@ -32,7 +32,7 @@ class ChromeSyncNotificationBridge : public content::NotificationObserver { virtual ~ChromeSyncNotificationBridge(); // Must be called on UI thread. - void UpdateEnabledTypes(const syncable::ModelTypeSet enabled_types); + void UpdateEnabledTypes(const syncer::ModelTypeSet enabled_types); // These can be called on any thread. virtual void AddObserver(syncer::SyncNotifierObserver* observer); @@ -45,7 +45,7 @@ class ChromeSyncNotificationBridge : public content::NotificationObserver { private: content::NotificationRegistrar registrar_; - syncable::ModelTypeSet enabled_types_; + syncer::ModelTypeSet enabled_types_; // Because [Add/Remove]Observer can be called from any thread, we need a // thread-safe observerlist. diff --git a/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc b/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc index ff0b0ad..ffd42fd 100644 --- a/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc +++ b/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc @@ -42,7 +42,7 @@ class FakeSyncNotifierObserverIO public: FakeSyncNotifierObserverIO( ChromeSyncNotificationBridge* bridge, - const syncable::ModelTypePayloadMap& expected_payloads) + const syncer::ModelTypePayloadMap& expected_payloads) : bridge_(bridge), received_improper_notification_(false), notification_count_(0), @@ -57,7 +57,7 @@ class FakeSyncNotifierObserverIO // SyncNotifierObserver implementation. virtual void OnIncomingNotification( - const syncable::ModelTypePayloadMap& type_payloads, + const syncer::ModelTypePayloadMap& type_payloads, syncer::IncomingNotificationSource source) OVERRIDE { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); notification_count_++; @@ -86,7 +86,7 @@ class FakeSyncNotifierObserverIO ChromeSyncNotificationBridge* bridge_; bool received_improper_notification_; size_t notification_count_; - syncable::ModelTypePayloadMap expected_payloads_; + syncer::ModelTypePayloadMap expected_payloads_; }; class ChromeSyncNotificationBridgeTest : public testing::Test { @@ -133,14 +133,14 @@ class ChromeSyncNotificationBridgeTest : public testing::Test { } void CreateObserverOnIOThread( - syncable::ModelTypePayloadMap expected_payloads) { + syncer::ModelTypePayloadMap expected_payloads) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); io_observer_ = new FakeSyncNotifierObserverIO(&bridge_, expected_payloads); } void CreateObserverWithExpectedPayload( - syncable::ModelTypePayloadMap expected_payloads) { + syncer::ModelTypePayloadMap expected_payloads) { ASSERT_TRUE(BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, @@ -169,11 +169,11 @@ class ChromeSyncNotificationBridgeTest : public testing::Test { void TriggerRefreshNotification( int type, - const syncable::ModelTypePayloadMap& payload_map) { + const syncer::ModelTypePayloadMap& payload_map) { content::NotificationService::current()->Notify( type, content::Source<Profile>(&mock_profile_), - content::Details<const syncable::ModelTypePayloadMap>(&payload_map)); + content::Details<const syncer::ModelTypePayloadMap>(&payload_map)); } MessageLoop ui_loop_; @@ -190,8 +190,8 @@ class ChromeSyncNotificationBridgeTest : public testing::Test { // Adds an observer on the UI thread, triggers a local refresh notification, and // ensures the bridge posts a LOCAL_NOTIFICATION with the proper payload to it. TEST_F(ChromeSyncNotificationBridgeTest, LocalNotification) { - syncable::ModelTypePayloadMap payload_map; - payload_map[syncable::SESSIONS] = ""; + syncer::ModelTypePayloadMap payload_map; + payload_map[syncer::SESSIONS] = ""; StrictMock<syncer::MockSyncNotifierObserver> observer; EXPECT_CALL(observer, OnIncomingNotification(payload_map, @@ -207,8 +207,8 @@ TEST_F(ChromeSyncNotificationBridgeTest, LocalNotification) { // and ensures the bridge posts a REMOTE_NOTIFICATION with the proper payload // to it. TEST_F(ChromeSyncNotificationBridgeTest, RemoteNotification) { - syncable::ModelTypePayloadMap payload_map; - payload_map[syncable::BOOKMARKS] = ""; + syncer::ModelTypePayloadMap payload_map; + payload_map[syncer::BOOKMARKS] = ""; StrictMock<syncer::MockSyncNotifierObserver> observer; EXPECT_CALL(observer, OnIncomingNotification(payload_map, @@ -224,10 +224,10 @@ TEST_F(ChromeSyncNotificationBridgeTest, RemoteNotification) { // with empty payload map and ensures the bridge posts a // LOCAL_NOTIFICATION with the proper payload to it. TEST_F(ChromeSyncNotificationBridgeTest, LocalNotificationEmptyPayloadMap) { - const syncable::ModelTypeSet enabled_types( - syncable::BOOKMARKS, syncable::PASSWORDS); - const syncable::ModelTypePayloadMap enabled_types_payload_map = - syncable::ModelTypePayloadMapFromEnumSet(enabled_types, std::string()); + const syncer::ModelTypeSet enabled_types( + syncer::BOOKMARKS, syncer::PASSWORDS); + const syncer::ModelTypePayloadMap enabled_types_payload_map = + syncer::ModelTypePayloadMapFromEnumSet(enabled_types, std::string()); StrictMock<syncer::MockSyncNotifierObserver> observer; EXPECT_CALL(observer, @@ -237,7 +237,7 @@ TEST_F(ChromeSyncNotificationBridgeTest, LocalNotificationEmptyPayloadMap) { // Set enabled types on the bridge. bridge_.UpdateEnabledTypes(enabled_types); TriggerRefreshNotification(chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, - syncable::ModelTypePayloadMap()); + syncer::ModelTypePayloadMap()); ui_loop_.RunAllPending(); Mock::VerifyAndClearExpectations(&observer); } @@ -246,10 +246,10 @@ TEST_F(ChromeSyncNotificationBridgeTest, LocalNotificationEmptyPayloadMap) { // with empty payload map and ensures the bridge posts a // REMOTE_NOTIFICATION with the proper payload to it. TEST_F(ChromeSyncNotificationBridgeTest, RemoteNotificationEmptyPayloadMap) { - const syncable::ModelTypeSet enabled_types( - syncable::BOOKMARKS, syncable::TYPED_URLS); - const syncable::ModelTypePayloadMap enabled_types_payload_map = - syncable::ModelTypePayloadMapFromEnumSet(enabled_types, std::string()); + const syncer::ModelTypeSet enabled_types( + syncer::BOOKMARKS, syncer::TYPED_URLS); + const syncer::ModelTypePayloadMap enabled_types_payload_map = + syncer::ModelTypePayloadMapFromEnumSet(enabled_types, std::string()); StrictMock<syncer::MockSyncNotifierObserver> observer; EXPECT_CALL(observer, @@ -259,7 +259,7 @@ TEST_F(ChromeSyncNotificationBridgeTest, RemoteNotificationEmptyPayloadMap) { // Set enabled types on the bridge. bridge_.UpdateEnabledTypes(enabled_types); TriggerRefreshNotification(chrome::NOTIFICATION_SYNC_REFRESH_REMOTE, - syncable::ModelTypePayloadMap()); + syncer::ModelTypePayloadMap()); ui_loop_.RunAllPending(); Mock::VerifyAndClearExpectations(&observer); } @@ -268,8 +268,8 @@ TEST_F(ChromeSyncNotificationBridgeTest, RemoteNotificationEmptyPayloadMap) { // the UI thread. We finally verify the proper notification was received by the // observer and destroy it on the I/O thread. TEST_F(ChromeSyncNotificationBridgeTest, BasicThreaded) { - syncable::ModelTypePayloadMap payload_map; - payload_map[syncable::SESSIONS] = ""; + syncer::ModelTypePayloadMap payload_map; + payload_map[syncer::SESSIONS] = ""; CreateObserverWithExpectedPayload(payload_map); TriggerRefreshNotification(chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, payload_map); diff --git a/chrome/browser/sync/glue/data_type_controller.cc b/chrome/browser/sync/glue/data_type_controller.cc index 218e717..b7fc7c3 100644 --- a/chrome/browser/sync/glue/data_type_controller.cc +++ b/chrome/browser/sync/glue/data_type_controller.cc @@ -16,10 +16,10 @@ bool DataTypeController::IsUnrecoverableResult(StartResult result) { syncer::SyncError DataTypeController::CreateAndUploadError( const tracked_objects::Location& location, const std::string& message, - syncable::ModelType type) { + syncer::ModelType type) { // TODO(sync): remove this once search engines triggers less errors, such as // due to crbug.com/130448. - if (type != syncable::SEARCH_ENGINES) + if (type != syncer::SEARCH_ENGINES) ChromeReportUnrecoverableError(); return syncer::SyncError(location, message, type); } @@ -32,11 +32,11 @@ void DataTypeController::RecordUnrecoverableError( << message << " at location " << from_here.ToString(); UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeRunFailures", type(), - syncable::MODEL_TYPE_COUNT); + syncer::MODEL_TYPE_COUNT); // TODO(sync): remove this once search engines triggers less errors, such as // due to crbug.com/130448. - if (type() != syncable::SEARCH_ENGINES) + if (type() != syncer::SEARCH_ENGINES) ChromeReportUnrecoverableError(); } diff --git a/chrome/browser/sync/glue/data_type_controller.h b/chrome/browser/sync/glue/data_type_controller.h index 0bae719..e620364 100644 --- a/chrome/browser/sync/glue/data_type_controller.h +++ b/chrome/browser/sync/glue/data_type_controller.h @@ -66,12 +66,12 @@ class DataTypeController typedef base::Callback<void(StartResult, const syncer::SyncError&)> StartCallback; - typedef base::Callback<void(syncable::ModelType, + typedef base::Callback<void(syncer::ModelType, syncer::SyncError)> ModelLoadCallback; - typedef std::map<syncable::ModelType, + typedef std::map<syncer::ModelType, scoped_refptr<DataTypeController> > TypeMap; - typedef std::map<syncable::ModelType, DataTypeController::State> StateMap; + typedef std::map<syncer::ModelType, DataTypeController::State> StateMap; // Returns true if the start result should trigger an unrecoverable error. // Public so unit tests can use this function as well. @@ -95,7 +95,7 @@ class DataTypeController virtual void Stop() = 0; // Unique model type for this data type controller. - virtual syncable::ModelType type() const = 0; + virtual syncer::ModelType type() const = 0; // Name of this data type. For logging purposes only. virtual std::string name() const = 0; @@ -113,7 +113,7 @@ class DataTypeController virtual syncer::SyncError CreateAndUploadError( const tracked_objects::Location& location, const std::string& message, - syncable::ModelType type) OVERRIDE; + syncer::ModelType type) OVERRIDE; protected: friend struct content::BrowserThread::DeleteOnThread< diff --git a/chrome/browser/sync/glue/data_type_controller_mock.h b/chrome/browser/sync/glue/data_type_controller_mock.h index ef467c3..2ad53ab 100644 --- a/chrome/browser/sync/glue/data_type_controller_mock.h +++ b/chrome/browser/sync/glue/data_type_controller_mock.h @@ -26,7 +26,7 @@ class ModelLoadCallbackMock { ModelLoadCallbackMock(); virtual ~ModelLoadCallbackMock(); - MOCK_METHOD2(Run, void(syncable::ModelType, syncer::SyncError)); + MOCK_METHOD2(Run, void(syncer::ModelType, syncer::SyncError)); }; } // namespace browser_sync diff --git a/chrome/browser/sync/glue/data_type_error_handler.h b/chrome/browser/sync/glue/data_type_error_handler.h index 94e8409..04a74cf 100644 --- a/chrome/browser/sync/glue/data_type_error_handler.h +++ b/chrome/browser/sync/glue/data_type_error_handler.h @@ -29,7 +29,7 @@ class DataTypeErrorHandler { virtual syncer::SyncError CreateAndUploadError( const tracked_objects::Location& location, const std::string& message, - syncable::ModelType type) = 0; + syncer::ModelType type) = 0; protected: virtual ~DataTypeErrorHandler() { } diff --git a/chrome/browser/sync/glue/data_type_error_handler_mock.h b/chrome/browser/sync/glue/data_type_error_handler_mock.h index 3ef7165..c5f794a 100644 --- a/chrome/browser/sync/glue/data_type_error_handler_mock.h +++ b/chrome/browser/sync/glue/data_type_error_handler_mock.h @@ -21,7 +21,7 @@ class DataTypeErrorHandlerMock : public DataTypeErrorHandler { MOCK_METHOD3(CreateAndUploadError, syncer::SyncError(const tracked_objects::Location&, const std::string&, - syncable::ModelType)); + syncer::ModelType)); }; diff --git a/chrome/browser/sync/glue/data_type_manager.cc b/chrome/browser/sync/glue/data_type_manager.cc index 86a44b09..28310dc 100644 --- a/chrome/browser/sync/glue/data_type_manager.cc +++ b/chrome/browser/sync/glue/data_type_manager.cc @@ -20,7 +20,7 @@ DataTypeManager::ConfigureResult::ConfigureResult( ConfigureStatus status, TypeSet requested_types, const std::list<syncer::SyncError>& failed_data_types, - syncable::ModelTypeSet waiting_to_start) + syncer::ModelTypeSet waiting_to_start) : status(status), requested_types(requested_types), failed_data_types(failed_data_types), diff --git a/chrome/browser/sync/glue/data_type_manager.h b/chrome/browser/sync/glue/data_type_manager.h index db2ec3c..1c0fecb 100644 --- a/chrome/browser/sync/glue/data_type_manager.h +++ b/chrome/browser/sync/glue/data_type_manager.h @@ -50,7 +50,7 @@ class DataTypeManager { UNRECOVERABLE_ERROR // We got an unrecoverable error during startup. }; - typedef syncable::ModelTypeSet TypeSet; + typedef syncer::ModelTypeSet TypeSet; // Note: |errors| is only filled when status is not OK. struct ConfigureResult { @@ -60,7 +60,7 @@ class DataTypeManager { ConfigureResult(ConfigureStatus status, TypeSet requested_types, const std::list<syncer::SyncError>& failed_data_types, - syncable::ModelTypeSet waiting_to_start); + syncer::ModelTypeSet waiting_to_start); ~ConfigureResult(); ConfigureStatus status; TypeSet requested_types; @@ -73,7 +73,7 @@ class DataTypeManager { // forward here and allow these types to continue loading in the // background. When these types are loaded DataTypeManager will // be informed and another configured cycle will be started. - syncable::ModelTypeSet waiting_to_start; + syncer::ModelTypeSet waiting_to_start; }; virtual ~DataTypeManager() {} diff --git a/chrome/browser/sync/glue/data_type_manager_impl.cc b/chrome/browser/sync/glue/data_type_manager_impl.cc index 92f965a..8bc6c31 100644 --- a/chrome/browser/sync/glue/data_type_manager_impl.cc +++ b/chrome/browser/sync/glue/data_type_manager_impl.cc @@ -113,16 +113,16 @@ void DataTypeManagerImpl::Restart( // The task will be invoked when updates are downloaded. state_ = DOWNLOAD_PENDING; // Hopefully http://crbug.com/79970 will make this less verbose. - syncable::ModelTypeSet all_types; + syncer::ModelTypeSet all_types; for (DataTypeController::TypeMap::const_iterator it = controllers_->begin(); it != controllers_->end(); ++it) { all_types.Put(it->first); } - const syncable::ModelTypeSet types_to_add = last_requested_types_; + const syncer::ModelTypeSet types_to_add = last_requested_types_; // Check that types_to_add \subseteq all_types. DCHECK(all_types.HasAll(types_to_add)); // Set types_to_remove to all_types \setminus types_to_add. - const syncable::ModelTypeSet types_to_remove = + const syncer::ModelTypeSet types_to_remove = Difference(all_types, types_to_add); configurer_->ConfigureDataTypes( reason, @@ -181,7 +181,7 @@ void DataTypeManagerImpl::OnDownloadRetry() { } void DataTypeManagerImpl::DownloadReady( - syncable::ModelTypeSet failed_configuration_types) { + syncer::ModelTypeSet failed_configuration_types) { DCHECK_EQ(state_, DOWNLOAD_PENDING); // Ignore |failed_configuration_types| if we need to reconfigure @@ -196,7 +196,7 @@ void DataTypeManagerImpl::DownloadReady( ChromeReportUnrecoverableError(); std::string error_msg = "Configuration failed for types " + - syncable::ModelTypeSetToString(failed_configuration_types); + syncer::ModelTypeSetToString(failed_configuration_types); syncer::SyncError error(FROM_HERE, error_msg, failed_configuration_types.First().Get()); Abort(UNRECOVERABLE_ERROR, error); @@ -300,7 +300,7 @@ void DataTypeManagerImpl::Abort(ConfigureStatus status, ConfigureResult result(status, last_requested_types_, error_list, - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); NotifyDone(result); } diff --git a/chrome/browser/sync/glue/data_type_manager_impl.h b/chrome/browser/sync/glue/data_type_manager_impl.h index cf65b43..584f7a9 100644 --- a/chrome/browser/sync/glue/data_type_manager_impl.h +++ b/chrome/browser/sync/glue/data_type_manager_impl.h @@ -65,7 +65,7 @@ class DataTypeManagerImpl : public DataTypeManager, void Restart(syncer::ConfigureReason reason, BackendDataTypeConfigurer::NigoriState nigori_state); - void DownloadReady(syncable::ModelTypeSet failed_configuration_types); + void DownloadReady(syncer::ModelTypeSet failed_configuration_types); // Notification from the SBH that download failed due to a transient // error and it will be retried. @@ -88,7 +88,7 @@ class DataTypeManagerImpl : public DataTypeManager, // This list is determined at startup by various command line flags. const DataTypeController::TypeMap* controllers_; State state_; - std::map<syncable::ModelType, int> start_order_; + std::map<syncer::ModelType, int> start_order_; TypeSet last_requested_types_; // Whether an attempt to reconfigure was made while we were busy configuring. diff --git a/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc b/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc index 874b9ad..5769c28 100644 --- a/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc +++ b/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc @@ -22,13 +22,13 @@ namespace browser_sync { -using syncable::ModelType; -using syncable::ModelTypeSet; -using syncable::ModelTypeToString; -using syncable::BOOKMARKS; -using syncable::APPS; -using syncable::PASSWORDS; -using syncable::PREFERENCES; +using syncer::ModelType; +using syncer::ModelTypeSet; +using syncer::ModelTypeToString; +using syncer::BOOKMARKS; +using syncer::APPS; +using syncer::PASSWORDS; +using syncer::PREFERENCES; using testing::_; using testing::Mock; using testing::ResultOf; @@ -215,7 +215,7 @@ TEST_P(SyncDataTypeManagerImplTest, ConfigureSlowLoadingType) { SetConfigureStartExpectation(); SetConfigureDoneExpectation(DataTypeManager::PARTIAL_SUCCESS); - syncable::ModelTypeSet types; + syncer::ModelTypeSet types; types.Put(BOOKMARKS); types.Put(APPS); diff --git a/chrome/browser/sync/glue/data_type_manager_mock.cc b/chrome/browser/sync/glue/data_type_manager_mock.cc index be50dbb..9c420b0 100644 --- a/chrome/browser/sync/glue/data_type_manager_mock.cc +++ b/chrome/browser/sync/glue/data_type_manager_mock.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -9,7 +9,7 @@ namespace browser_sync { DataTypeManagerMock::DataTypeManagerMock() - : result_(OK, syncable::ModelTypeSet()) { + : result_(OK, syncer::ModelTypeSet()) { // By default, calling Configure will send a SYNC_CONFIGURE_START // and SYNC_CONFIGURE_DONE notification with a DataTypeManager::OK diff --git a/chrome/browser/sync/glue/extension_data_type_controller.cc b/chrome/browser/sync/glue/extension_data_type_controller.cc index d76a631..398613a 100644 --- a/chrome/browser/sync/glue/extension_data_type_controller.cc +++ b/chrome/browser/sync/glue/extension_data_type_controller.cc @@ -12,7 +12,7 @@ namespace browser_sync { ExtensionDataTypeController::ExtensionDataTypeController( - syncable::ModelType type, + syncer::ModelType type, ProfileSyncComponentsFactory* profile_sync_factory, Profile* profile, ProfileSyncService* sync_service) @@ -20,8 +20,7 @@ ExtensionDataTypeController::ExtensionDataTypeController( profile_sync_factory, profile, sync_service) { - DCHECK(type == syncable::EXTENSIONS || - type == syncable::APPS); + DCHECK(type == syncer::EXTENSIONS || type == syncer::APPS); } ExtensionDataTypeController::~ExtensionDataTypeController() {} diff --git a/chrome/browser/sync/glue/extension_data_type_controller.h b/chrome/browser/sync/glue/extension_data_type_controller.h index d78d7c5..8f117ae 100644 --- a/chrome/browser/sync/glue/extension_data_type_controller.h +++ b/chrome/browser/sync/glue/extension_data_type_controller.h @@ -19,7 +19,7 @@ namespace browser_sync { class ExtensionDataTypeController : public UIDataTypeController { public: ExtensionDataTypeController( - syncable::ModelType type, // Either EXTENSIONS or APPS. + syncer::ModelType type, // Either EXTENSIONS or APPS. ProfileSyncComponentsFactory* profile_sync_factory, Profile* profile, ProfileSyncService* sync_service); diff --git a/chrome/browser/sync/glue/extension_setting_data_type_controller.cc b/chrome/browser/sync/glue/extension_setting_data_type_controller.cc index 7b4d11c..1170277 100644 --- a/chrome/browser/sync/glue/extension_setting_data_type_controller.cc +++ b/chrome/browser/sync/glue/extension_setting_data_type_controller.cc @@ -19,7 +19,7 @@ using content::BrowserThread; namespace browser_sync { ExtensionSettingDataTypeController::ExtensionSettingDataTypeController( - syncable::ModelType type, + syncer::ModelType type, ProfileSyncComponentsFactory* profile_sync_factory, Profile* profile, ProfileSyncService* profile_sync_service) @@ -30,11 +30,10 @@ ExtensionSettingDataTypeController::ExtensionSettingDataTypeController( profile_(profile), profile_sync_service_(profile_sync_service) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - DCHECK(type == syncable::EXTENSION_SETTINGS || - type == syncable::APP_SETTINGS); + DCHECK(type == syncer::EXTENSION_SETTINGS || type == syncer::APP_SETTINGS); } -syncable::ModelType ExtensionSettingDataTypeController::type() const { +syncer::ModelType ExtensionSettingDataTypeController::type() const { return type_; } diff --git a/chrome/browser/sync/glue/extension_setting_data_type_controller.h b/chrome/browser/sync/glue/extension_setting_data_type_controller.h index c578c20..ddb3272 100644 --- a/chrome/browser/sync/glue/extension_setting_data_type_controller.h +++ b/chrome/browser/sync/glue/extension_setting_data_type_controller.h @@ -30,13 +30,13 @@ class ExtensionSettingDataTypeController public: ExtensionSettingDataTypeController( // Either EXTENSION_SETTINGS or APP_SETTINGS. - syncable::ModelType type, + syncer::ModelType type, ProfileSyncComponentsFactory* profile_sync_factory, Profile* profile, ProfileSyncService* profile_sync_service); // NonFrontendDataTypeController implementation - virtual syncable::ModelType type() const OVERRIDE; + virtual syncer::ModelType type() const OVERRIDE; virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE; private: @@ -49,7 +49,7 @@ class ExtensionSettingDataTypeController virtual bool StartModels() OVERRIDE; // Either EXTENSION_SETTINGS or APP_SETTINGS. - syncable::ModelType type_; + syncer::ModelType type_; // These only used on the UI thread. Profile* profile_; diff --git a/chrome/browser/sync/glue/fake_data_type_controller.cc b/chrome/browser/sync/glue/fake_data_type_controller.cc index 28b5611..09feff2 100644 --- a/chrome/browser/sync/glue/fake_data_type_controller.cc +++ b/chrome/browser/sync/glue/fake_data_type_controller.cc @@ -10,7 +10,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" -using syncable::ModelType; +using syncer::ModelType; namespace browser_sync { FakeDataTypeController::FakeDataTypeController(ModelType type) diff --git a/chrome/browser/sync/glue/fake_data_type_controller.h b/chrome/browser/sync/glue/fake_data_type_controller.h index 173e9f9..f541dad 100644 --- a/chrome/browser/sync/glue/fake_data_type_controller.h +++ b/chrome/browser/sync/glue/fake_data_type_controller.h @@ -21,7 +21,7 @@ namespace browser_sync { // functionality.) class FakeDataTypeController : public DataTypeController { public: - explicit FakeDataTypeController(syncable::ModelType type); + explicit FakeDataTypeController(syncer::ModelType type); virtual void LoadModels( const ModelLoadCallback& model_load_callback) OVERRIDE; @@ -34,7 +34,7 @@ class FakeDataTypeController : public DataTypeController { virtual void Stop() OVERRIDE; - virtual syncable::ModelType type() const OVERRIDE; + virtual syncer::ModelType type() const OVERRIDE; virtual std::string name() const OVERRIDE; @@ -60,7 +60,7 @@ class FakeDataTypeController : public DataTypeController { private: DataTypeController::State state_; bool model_load_delayed_; - syncable::ModelType type_; + syncer::ModelType type_; StartCallback last_start_callback_; ModelLoadCallback model_load_callback_; }; diff --git a/chrome/browser/sync/glue/fake_generic_change_processor.cc b/chrome/browser/sync/glue/fake_generic_change_processor.cc index 47a2228..eb143ac 100644 --- a/chrome/browser/sync/glue/fake_generic_change_processor.cc +++ b/chrome/browser/sync/glue/fake_generic_change_processor.cc @@ -16,7 +16,7 @@ FakeGenericChangeProcessor::FakeGenericChangeProcessor() sync_model_has_user_created_nodes_(true), sync_model_has_user_created_nodes_success_(true), crypto_ready_if_necessary_(true), - type_(syncable::UNSPECIFIED) {} + type_(syncer::UNSPECIFIED) {} FakeGenericChangeProcessor::~FakeGenericChangeProcessor() {} @@ -48,20 +48,20 @@ syncer::SyncError FakeGenericChangeProcessor::ProcessSyncChanges( } syncer::SyncError FakeGenericChangeProcessor::GetSyncDataForType( - syncable::ModelType type, syncer::SyncDataList* current_sync_data) { + syncer::ModelType type, syncer::SyncDataList* current_sync_data) { type_ = type; return get_sync_data_for_type_error_; } bool FakeGenericChangeProcessor::SyncModelHasUserCreatedNodes( - syncable::ModelType type, bool* has_nodes) { + syncer::ModelType type, bool* has_nodes) { type_ = type; *has_nodes = sync_model_has_user_created_nodes_; return sync_model_has_user_created_nodes_success_; } bool FakeGenericChangeProcessor::CryptoReadyIfNecessary( - syncable::ModelType type) { + syncer::ModelType type) { type_ = type; return crypto_ready_if_necessary_; } diff --git a/chrome/browser/sync/glue/fake_generic_change_processor.h b/chrome/browser/sync/glue/fake_generic_change_processor.h index 13684db..c5d4a05 100644 --- a/chrome/browser/sync/glue/fake_generic_change_processor.h +++ b/chrome/browser/sync/glue/fake_generic_change_processor.h @@ -30,11 +30,11 @@ class FakeGenericChangeProcessor : public GenericChangeProcessor { const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) OVERRIDE; virtual syncer::SyncError GetSyncDataForType( - syncable::ModelType type, + syncer::ModelType type, syncer::SyncDataList* current_sync_data) OVERRIDE; - virtual bool SyncModelHasUserCreatedNodes(syncable::ModelType type, + virtual bool SyncModelHasUserCreatedNodes(syncer::ModelType type, bool* has_nodes) OVERRIDE; - virtual bool CryptoReadyIfNecessary(syncable::ModelType type) OVERRIDE; + virtual bool CryptoReadyIfNecessary(syncer::ModelType type) OVERRIDE; private: syncer::SyncError process_sync_changes_error_; @@ -42,7 +42,7 @@ class FakeGenericChangeProcessor : public GenericChangeProcessor { bool sync_model_has_user_created_nodes_; bool sync_model_has_user_created_nodes_success_; bool crypto_ready_if_necessary_; - syncable::ModelType type_; + syncer::ModelType type_; }; } // namespace browser_sync diff --git a/chrome/browser/sync/glue/frontend_data_type_controller.cc b/chrome/browser/sync/glue/frontend_data_type_controller.cc index 7c53fc8..234dd17 100644 --- a/chrome/browser/sync/glue/frontend_data_type_controller.cc +++ b/chrome/browser/sync/glue/frontend_data_type_controller.cc @@ -127,7 +127,7 @@ syncer::ModelSafeGroup FrontendDataTypeController::model_safe_group() std::string FrontendDataTypeController::name() const { // For logging only. - return syncable::ModelTypeToString(type()); + return syncer::ModelTypeToString(type()); } DataTypeController::State FrontendDataTypeController::state() const { @@ -264,7 +264,7 @@ void FrontendDataTypeController::RecordAssociationTime(base::TimeDelta time) { void FrontendDataTypeController::RecordStartFailure(StartResult result) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeStartFailures", type(), - syncable::MODEL_TYPE_COUNT); + syncer::MODEL_TYPE_COUNT); #define PER_DATA_TYPE_MACRO(type_str) \ UMA_HISTOGRAM_ENUMERATION("Sync." type_str "StartFailure", result, \ MAX_START_RESULT); diff --git a/chrome/browser/sync/glue/frontend_data_type_controller.h b/chrome/browser/sync/glue/frontend_data_type_controller.h index 4b34bbb..86abd7b 100644 --- a/chrome/browser/sync/glue/frontend_data_type_controller.h +++ b/chrome/browser/sync/glue/frontend_data_type_controller.h @@ -36,7 +36,7 @@ class ChangeProcessor; // don't have to worry about thread safety. The main start/stop funtionality is // implemented by default. // Derived classes must implement (at least): -// syncable::ModelType type() const +// syncer::ModelType type() const // void CreateSyncComponents(); // NOTE: This class is deprecated! New sync datatypes should be using the // syncer::SyncableService API and the UIDataTypeController instead. @@ -53,7 +53,7 @@ class FrontendDataTypeController : public DataTypeController { const ModelLoadCallback& model_load_callback) OVERRIDE; virtual void StartAssociating(const StartCallback& start_callback) OVERRIDE; virtual void Stop() OVERRIDE; - virtual syncable::ModelType type() const = 0; + virtual syncer::ModelType type() const = 0; virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE; virtual std::string name() const OVERRIDE; virtual State state() const OVERRIDE; diff --git a/chrome/browser/sync/glue/frontend_data_type_controller_mock.h b/chrome/browser/sync/glue/frontend_data_type_controller_mock.h index cbc5916..a4e428d 100644 --- a/chrome/browser/sync/glue/frontend_data_type_controller_mock.h +++ b/chrome/browser/sync/glue/frontend_data_type_controller_mock.h @@ -24,7 +24,7 @@ class FrontendDataTypeControllerMock : public FrontendDataTypeController { MOCK_METHOD0(Stop, void()); MOCK_METHOD0(enabled, bool()); - MOCK_CONST_METHOD0(type, syncable::ModelType()); + MOCK_CONST_METHOD0(type, syncer::ModelType()); MOCK_CONST_METHOD0(name, std::string()); MOCK_CONST_METHOD0(model_safe_group, syncer::ModelSafeGroup()); MOCK_CONST_METHOD0(state, State()); diff --git a/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc b/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc index ac5391f..ec34e50 100644 --- a/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc @@ -46,7 +46,7 @@ class FrontendDataTypeControllerFake : public FrontendDataTypeController { profile, sync_service), mock_(mock) {} - virtual syncable::ModelType type() const { return syncable::BOOKMARKS; } + virtual syncer::ModelType type() const { return syncer::BOOKMARKS; } private: virtual void CreateSyncComponents() { @@ -209,7 +209,7 @@ TEST_F(SyncFrontendDataTypeControllerTest, StartAssociationFailed) { EXPECT_CALL(*model_associator_, AssociateModels()). WillOnce(Return(syncer::SyncError(FROM_HERE, "error", - syncable::PREFERENCES))); + syncer::PREFERENCES))); EXPECT_CALL(*dtc_mock_, RecordAssociationTime(_)); SetStartFailExpectations(DataTypeController::ASSOCIATION_FAILED); diff --git a/chrome/browser/sync/glue/generic_change_processor.cc b/chrome/browser/sync/glue/generic_change_processor.cc index 1bbeb4e..006db90 100644 --- a/chrome/browser/sync/glue/generic_change_processor.cc +++ b/chrome/browser/sync/glue/generic_change_processor.cc @@ -79,7 +79,7 @@ void GenericChangeProcessor::CommitChangesFromSyncModel() { if (syncer_changes_.empty()) return; if (!local_service_) { - syncable::ModelType type = syncer_changes_[0].sync_data().GetDataType(); + syncer::ModelType type = syncer_changes_[0].sync_data().GetDataType(); syncer::SyncError error(FROM_HERE, "Local service destroyed.", type); error_handler()->OnSingleDatatypeUnrecoverableError(error.location(), error.message()); @@ -95,13 +95,13 @@ void GenericChangeProcessor::CommitChangesFromSyncModel() { } syncer::SyncError GenericChangeProcessor::GetSyncDataForType( - syncable::ModelType type, + syncer::ModelType type, syncer::SyncDataList* current_sync_data) { DCHECK(CalledOnValidThread()); - std::string type_name = syncable::ModelTypeToString(type); + std::string type_name = syncer::ModelTypeToString(type); syncer::ReadTransaction trans(FROM_HERE, share_handle()); syncer::ReadNode root(&trans); - if (root.InitByTagLookup(syncable::ModelTypeToRootTag(type)) != + if (root.InitByTagLookup(syncer::ModelTypeToRootTag(type)) != syncer::BaseNode::INIT_OK) { syncer::SyncError error(FROM_HERE, "Server did not create the top-level " + type_name + @@ -111,7 +111,7 @@ syncer::SyncError GenericChangeProcessor::GetSyncDataForType( } // TODO(akalin): We'll have to do a tree traversal for bookmarks. - DCHECK_NE(type, syncable::BOOKMARKS); + DCHECK_NE(type, syncer::BOOKMARKS); int64 sync_child_id = root.GetFirstChildId(); while (sync_child_id != syncer::kInvalidId) { @@ -141,7 +141,7 @@ syncer::SyncError LogLookupFailure( syncer::BaseNode::InitByLookupResult lookup_result, const tracked_objects::Location& from_here, const std::string& error_prefix, - syncable::ModelType type, + syncer::ModelType type, DataTypeErrorHandler* error_handler) { switch (lookup_result) { case syncer::BaseNode::INIT_FAILED_ENTRY_NOT_GOOD: { @@ -193,11 +193,12 @@ syncer::SyncError LogLookupFailure( } } -syncer::SyncError AttemptDelete(const syncer::SyncChange& change, - syncable::ModelType type, - const std::string& type_str, - syncer::WriteNode* node, - DataTypeErrorHandler* error_handler) { +syncer::SyncError AttemptDelete( + const syncer::SyncChange& change, + syncer::ModelType type, + const std::string& type_str, + syncer::WriteNode* node, + DataTypeErrorHandler* error_handler) { DCHECK_EQ(change.change_type(), syncer::SyncChange::ACTION_DELETE); if (change.sync_data().IsLocal()) { const std::string& tag = change.sync_data().GetTag(); @@ -250,9 +251,9 @@ syncer::SyncError GenericChangeProcessor::ProcessSyncChanges( iter != list_of_changes.end(); ++iter) { const syncer::SyncChange& change = *iter; - DCHECK_NE(change.sync_data().GetDataType(), syncable::UNSPECIFIED); - syncable::ModelType type = change.sync_data().GetDataType(); - std::string type_str = syncable::ModelTypeToString(type); + DCHECK_NE(change.sync_data().GetDataType(), syncer::UNSPECIFIED); + syncer::ModelType type = change.sync_data().GetDataType(); + std::string type_str = syncer::ModelTypeToString(type); syncer::WriteNode sync_node(&trans); if (change.change_type() == syncer::SyncChange::ACTION_DELETE) { syncer::SyncError error = @@ -267,7 +268,7 @@ syncer::SyncError GenericChangeProcessor::ProcessSyncChanges( // etc.). syncer::ReadNode root_node(&trans); if (root_node.InitByTagLookup( - syncable::ModelTypeToRootTag(change.sync_data().GetDataType())) != + syncer::ModelTypeToRootTag(change.sync_data().GetDataType())) != syncer::BaseNode::INIT_OK) { syncer::SyncError error(FROM_HERE, "Failed to look up root node for type " + type_str, @@ -366,7 +367,7 @@ syncer::SyncError GenericChangeProcessor::ProcessSyncChanges( return error; } else { syncer::Cryptographer* crypto = trans.GetCryptographer(); - syncable::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes()); + syncer::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes()); const sync_pb::EntitySpecifics& specifics = sync_node.GetEntry()->Get(syncer::syncable::SPECIFICS); CHECK(specifics.has_encrypted()); @@ -436,18 +437,18 @@ syncer::SyncError GenericChangeProcessor::ProcessSyncChanges( } bool GenericChangeProcessor::SyncModelHasUserCreatedNodes( - syncable::ModelType type, + syncer::ModelType type, bool* has_nodes) { DCHECK(CalledOnValidThread()); DCHECK(has_nodes); - DCHECK_NE(type, syncable::UNSPECIFIED); - std::string type_name = syncable::ModelTypeToString(type); + DCHECK_NE(type, syncer::UNSPECIFIED); + std::string type_name = syncer::ModelTypeToString(type); std::string err_str = "Server did not create the top-level " + type_name + " node. We might be running against an out-of-date server."; *has_nodes = false; syncer::ReadTransaction trans(FROM_HERE, share_handle()); syncer::ReadNode type_root_node(&trans); - if (type_root_node.InitByTagLookup(syncable::ModelTypeToRootTag(type)) != + if (type_root_node.InitByTagLookup(syncer::ModelTypeToRootTag(type)) != syncer::BaseNode::INIT_OK) { LOG(ERROR) << err_str; return false; @@ -459,12 +460,12 @@ bool GenericChangeProcessor::SyncModelHasUserCreatedNodes( return true; } -bool GenericChangeProcessor::CryptoReadyIfNecessary(syncable::ModelType type) { +bool GenericChangeProcessor::CryptoReadyIfNecessary(syncer::ModelType type) { DCHECK(CalledOnValidThread()); - DCHECK_NE(type, syncable::UNSPECIFIED); + DCHECK_NE(type, syncer::UNSPECIFIED); // We only access the cryptographer while holding a transaction. syncer::ReadTransaction trans(FROM_HERE, share_handle()); - const syncable::ModelTypeSet encrypted_types = GetEncryptedTypes(&trans); + const syncer::ModelTypeSet encrypted_types = GetEncryptedTypes(&trans); return !encrypted_types.Has(type) || trans.GetCryptographer()->is_ready(); } diff --git a/chrome/browser/sync/glue/generic_change_processor.h b/chrome/browser/sync/glue/generic_change_processor.h index 223cd6b..0f84f54 100644 --- a/chrome/browser/sync/glue/generic_change_processor.h +++ b/chrome/browser/sync/glue/generic_change_processor.h @@ -61,14 +61,15 @@ class GenericChangeProcessor : public ChangeProcessor, const syncer::SyncChangeList& change_list) OVERRIDE; // Fills |current_sync_data| with all the syncer data for the specified type. - virtual syncer::SyncError GetSyncDataForType(syncable::ModelType type, - syncer::SyncDataList* current_sync_data); + virtual syncer::SyncError GetSyncDataForType( + syncer::ModelType type, + syncer::SyncDataList* current_sync_data); // Generic versions of AssociatorInterface methods. Called by // syncer::SyncableServiceAdapter or the DataTypeController. - virtual bool SyncModelHasUserCreatedNodes(syncable::ModelType type, + virtual bool SyncModelHasUserCreatedNodes(syncer::ModelType type, bool* has_nodes); - virtual bool CryptoReadyIfNecessary(syncable::ModelType type); + virtual bool CryptoReadyIfNecessary(syncer::ModelType type); protected: // ChangeProcessor interface. diff --git a/chrome/browser/sync/glue/model_association_manager.cc b/chrome/browser/sync/glue/model_association_manager.cc index e9cd9b3..fe38916 100644 --- a/chrome/browser/sync/glue/model_association_manager.cc +++ b/chrome/browser/sync/glue/model_association_manager.cc @@ -13,9 +13,9 @@ #include "chrome/browser/sync/glue/model_association_manager.h" -#include "content/public/browser/browser_thread.h" #include <algorithm> #include <functional> +#include "content/public/browser/browser_thread.h" #include "base/debug/trace_event.h" @@ -25,7 +25,7 @@ using content::BrowserThread; -using syncable::ModelTypeSet; +using syncer::ModelTypeSet; namespace browser_sync { // The amount of time we wait for a datatype to load. If the type has @@ -35,26 +35,26 @@ namespace browser_sync { const int64 kDataTypeLoadWaitTimeInSeconds = 120; namespace { -static const syncable::ModelType kStartOrder[] = { - syncable::NIGORI, // Listed for completeness. - syncable::BOOKMARKS, // UI thread datatypes. - syncable::PREFERENCES, - syncable::EXTENSIONS, - syncable::APPS, - syncable::THEMES, - syncable::SEARCH_ENGINES, - syncable::SESSIONS, - syncable::APP_NOTIFICATIONS, - syncable::AUTOFILL, // Non-UI thread datatypes. - syncable::AUTOFILL_PROFILE, - syncable::EXTENSION_SETTINGS, - syncable::APP_SETTINGS, - syncable::TYPED_URLS, - syncable::PASSWORDS, +static const syncer::ModelType kStartOrder[] = { + syncer::NIGORI, // Listed for completeness. + syncer::BOOKMARKS, // UI thread datatypes. + syncer::PREFERENCES, + syncer::EXTENSIONS, + syncer::APPS, + syncer::THEMES, + syncer::SEARCH_ENGINES, + syncer::SESSIONS, + syncer::APP_NOTIFICATIONS, + syncer::AUTOFILL, // Non-UI thread datatypes. + syncer::AUTOFILL_PROFILE, + syncer::EXTENSION_SETTINGS, + syncer::APP_SETTINGS, + syncer::TYPED_URLS, + syncer::PASSWORDS, }; COMPILE_ASSERT(arraysize(kStartOrder) == - syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE, + syncer::MODEL_TYPE_COUNT - syncer::FIRST_REAL_MODEL_TYPE, kStartOrder_IncorrectSize); // Comparator used when sorting data type controllers. @@ -62,7 +62,7 @@ class SortComparator : public std::binary_function<DataTypeController*, DataTypeController*, bool> { public: - explicit SortComparator(std::map<syncable::ModelType, int>* order) + explicit SortComparator(std::map<syncer::ModelType, int>* order) : order_(order) { } // Returns true if lhs precedes rhs. @@ -71,7 +71,7 @@ class SortComparator : public std::binary_function<DataTypeController*, } private: - std::map<syncable::ModelType, int>* order_; + std::map<syncer::ModelType, int>* order_; }; } // namespace @@ -99,8 +99,7 @@ ModelAssociationManager::ModelAssociationManager( ModelAssociationManager::~ModelAssociationManager() { } -void ModelAssociationManager::Initialize( - syncable::ModelTypeSet desired_types) { +void ModelAssociationManager::Initialize(syncer::ModelTypeSet desired_types) { // TODO(tim): Bug 134550. CHECKing to ensure no reentrancy on dev channel. // Remove this. CHECK_EQ(state_, IDLE); @@ -229,7 +228,7 @@ void ModelAssociationManager::Stop() { DataTypeManager::ConfigureResult result(DataTypeManager::ABORTED, desired_types_, failed_datatypes_info_, - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); result_processor_->OnModelAssociationDone(result); } @@ -254,7 +253,7 @@ bool ModelAssociationManager::GetControllersNeedingStart( needs_start->push_back(dtc->second.get()); if (dtc->second->state() == DataTypeController::DISABLED) { DVLOG(1) << "ModelAssociationManager: Found "\ - << syncable::ModelTypeToString(dtc->second->type()) + << syncer::ModelTypeToString(dtc->second->type()) << " in disabled state."; } } @@ -267,10 +266,10 @@ void ModelAssociationManager::AppendToFailedDatatypesAndLogError( const syncer::SyncError& error) { failed_datatypes_info_.push_back(error); LOG(ERROR) << "Failed to associate models for " - << syncable::ModelTypeToString(error.type()); + << syncer::ModelTypeToString(error.type()); UMA_HISTOGRAM_ENUMERATION("Sync.ConfigureFailed", error.type(), - syncable::MODEL_TYPE_COUNT); + syncer::MODEL_TYPE_COUNT); } void ModelAssociationManager::TypeStartCallback( @@ -341,7 +340,7 @@ void ModelAssociationManager::TypeStartCallback( DataTypeManager::ConfigureResult configure_result(configure_status, desired_types_, errors, - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); result_processor_->OnModelAssociationDone(configure_result); } @@ -374,9 +373,9 @@ void ModelAssociationManager::LoadModelForNextType() { } void ModelAssociationManager::ModelLoadCallback( - syncable::ModelType type, syncer::SyncError error) { + syncer::ModelType type, syncer::SyncError error) { DVLOG(1) << "ModelAssociationManager: ModelLoadCallback for " - << syncable::ModelTypeToString(type); + << syncer::ModelTypeToString(type); if (state_ == CONFIGURING) { DVLOG(1) << "ModelAssociationManager: ModelLoadCallback while configuring"; for (std::vector<DataTypeController*>::iterator it = @@ -467,7 +466,7 @@ void ModelAssociationManager::StartAssociatingNextType() { DataTypeManager::CONFIGURE_BLOCKED, desired_types_, failed_datatypes_info_, - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); state_ = IDLE; result_processor_->OnModelAssociationDone(configure_result); return; @@ -492,8 +491,8 @@ void ModelAssociationManager::StartAssociatingNextType() { return; } -syncable::ModelTypeSet ModelAssociationManager::GetTypesWaitingToLoad() { - syncable::ModelTypeSet result; +syncer::ModelTypeSet ModelAssociationManager::GetTypesWaitingToLoad() { + syncer::ModelTypeSet result; for (std::vector<DataTypeController*>::const_iterator it = pending_model_load_.begin(); it != pending_model_load_.end(); diff --git a/chrome/browser/sync/glue/model_association_manager.h b/chrome/browser/sync/glue/model_association_manager.h index 6e00068..4167926 100644 --- a/chrome/browser/sync/glue/model_association_manager.h +++ b/chrome/browser/sync/glue/model_association_manager.h @@ -48,7 +48,7 @@ class ModelAssociationManager { // should be called before communicating with sync server. A subsequent call // of Initialize is only allowed if the ModelAssociationManager has invoked // |OnModelAssociationDone| on the |ModelAssociationResultProcessor|. - void Initialize(syncable::ModelTypeSet desired_types); + void Initialize(syncer::ModelTypeSet desired_types); // Can be called at any time. Synchronously stops all datatypes. void Stop(); @@ -101,7 +101,7 @@ class ModelAssociationManager { // Callback that will be invoked when the models finish loading. This callback // will be passed to |LoadModels| function. - void ModelLoadCallback(syncable::ModelType type, syncer::SyncError error); + void ModelLoadCallback(syncer::ModelType type, syncer::SyncError error); // Calls the |LoadModels| method on the next controller waiting to start. void LoadModelForNextType(); @@ -116,13 +116,13 @@ class ModelAssociationManager { DataTypeController::StartResult result, const syncer::SyncError& error); - syncable::ModelTypeSet GetTypesWaitingToLoad(); + syncer::ModelTypeSet GetTypesWaitingToLoad(); State state_; - syncable::ModelTypeSet desired_types_; + syncer::ModelTypeSet desired_types_; std::list<syncer::SyncError> failed_datatypes_info_; - std::map<syncable::ModelType, int> start_order_; + std::map<syncer::ModelType, int> start_order_; // This illustration explains the movement of one DTC through various lists. // Consider a dataype, say, BOOKMARKS which is NOT_RUNNING and will be diff --git a/chrome/browser/sync/glue/model_association_manager_unittest.cc b/chrome/browser/sync/glue/model_association_manager_unittest.cc index 3d1f90d..e8a13d9 100644 --- a/chrome/browser/sync/glue/model_association_manager_unittest.cc +++ b/chrome/browser/sync/glue/model_association_manager_unittest.cc @@ -24,7 +24,7 @@ class MockModelAssociationResultProcessor : FakeDataTypeController* GetController( const DataTypeController::TypeMap& controllers, - syncable::ModelType model_type) { + syncer::ModelType model_type) { DataTypeController::TypeMap::const_iterator it = controllers.find(model_type); if (it == controllers.end()) { @@ -69,17 +69,17 @@ class ModelAssociationManagerTest : public testing::Test { // Start a type and make sure ModelAssociationManager callst the |Start| // method and calls the callback when it is done. TEST_F(ModelAssociationManagerTest, SimpleModelStart) { - controllers_[syncable::BOOKMARKS] = - new FakeDataTypeController(syncable::BOOKMARKS); + controllers_[syncer::BOOKMARKS] = + new FakeDataTypeController(syncer::BOOKMARKS); ModelAssociationManager model_association_manager(&controllers_, &result_processor_); - syncable::ModelTypeSet types; - types.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet types; + types.Put(syncer::BOOKMARKS); DataTypeManager::ConfigureResult expected_result( DataTypeManager::OK, types, std::list<syncer::SyncError>(), - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); EXPECT_CALL(result_processor_, OnModelAssociationDone(_)). WillOnce(VerifyResult(expected_result)); @@ -87,27 +87,27 @@ TEST_F(ModelAssociationManagerTest, SimpleModelStart) { model_association_manager.StopDisabledTypes(); model_association_manager.StartAssociationAsync(); - EXPECT_EQ(GetController(controllers_, syncable::BOOKMARKS)->state(), + EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), DataTypeController::MODEL_LOADED); - GetController(controllers_, syncable::BOOKMARKS)->FinishStart( + GetController(controllers_, syncer::BOOKMARKS)->FinishStart( DataTypeController::OK); } // Start a type and call stop before it finishes associating. TEST_F(ModelAssociationManagerTest, StopModelBeforeFinish) { - controllers_[syncable::BOOKMARKS] = - new FakeDataTypeController(syncable::BOOKMARKS); + controllers_[syncer::BOOKMARKS] = + new FakeDataTypeController(syncer::BOOKMARKS); ModelAssociationManager model_association_manager(&controllers_, &result_processor_); - syncable::ModelTypeSet types; - types.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet types; + types.Put(syncer::BOOKMARKS); DataTypeManager::ConfigureResult expected_result( DataTypeManager::ABORTED, types, std::list<syncer::SyncError>(), - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); EXPECT_CALL(result_processor_, OnModelAssociationDone(_)). WillOnce(VerifyResult(expected_result)); @@ -116,26 +116,26 @@ TEST_F(ModelAssociationManagerTest, StopModelBeforeFinish) { model_association_manager.StopDisabledTypes(); model_association_manager.StartAssociationAsync(); - EXPECT_EQ(GetController(controllers_, syncable::BOOKMARKS)->state(), + EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), DataTypeController::MODEL_LOADED); model_association_manager.Stop(); - EXPECT_EQ(GetController(controllers_, syncable::BOOKMARKS)->state(), + EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), DataTypeController::NOT_RUNNING); } // Start a type, let it finish and then call stop. TEST_F(ModelAssociationManagerTest, StopAfterFinish) { - controllers_[syncable::BOOKMARKS] = - new FakeDataTypeController(syncable::BOOKMARKS); + controllers_[syncer::BOOKMARKS] = + new FakeDataTypeController(syncer::BOOKMARKS); ModelAssociationManager model_association_manager(&controllers_, &result_processor_); - syncable::ModelTypeSet types; - types.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet types; + types.Put(syncer::BOOKMARKS); DataTypeManager::ConfigureResult expected_result( DataTypeManager::OK, types, std::list<syncer::SyncError>(), - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); EXPECT_CALL(result_processor_, OnModelAssociationDone(_)). WillOnce(VerifyResult(expected_result)); @@ -143,32 +143,32 @@ TEST_F(ModelAssociationManagerTest, StopAfterFinish) { model_association_manager.StopDisabledTypes(); model_association_manager.StartAssociationAsync(); - EXPECT_EQ(GetController(controllers_, syncable::BOOKMARKS)->state(), + EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), DataTypeController::MODEL_LOADED); - GetController(controllers_, syncable::BOOKMARKS)->FinishStart( + GetController(controllers_, syncer::BOOKMARKS)->FinishStart( DataTypeController::OK); model_association_manager.Stop(); - EXPECT_EQ(GetController(controllers_, syncable::BOOKMARKS)->state(), + EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), DataTypeController::NOT_RUNNING); } // Make a type fail model association and verify correctness. TEST_F(ModelAssociationManagerTest, TypeFailModelAssociation) { - controllers_[syncable::BOOKMARKS] = - new FakeDataTypeController(syncable::BOOKMARKS); + controllers_[syncer::BOOKMARKS] = + new FakeDataTypeController(syncer::BOOKMARKS); ModelAssociationManager model_association_manager(&controllers_, &result_processor_); - syncable::ModelTypeSet types; - types.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet types; + types.Put(syncer::BOOKMARKS); std::list<syncer::SyncError> errors; - syncer::SyncError error(FROM_HERE, "Failed", syncable::BOOKMARKS); + syncer::SyncError error(FROM_HERE, "Failed", syncer::BOOKMARKS); errors.push_back(error); DataTypeManager::ConfigureResult expected_result( DataTypeManager::PARTIAL_SUCCESS, types, errors, - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); EXPECT_CALL(result_processor_, OnModelAssociationDone(_)). WillOnce(VerifyResult(expected_result)); @@ -176,28 +176,28 @@ TEST_F(ModelAssociationManagerTest, TypeFailModelAssociation) { model_association_manager.StopDisabledTypes(); model_association_manager.StartAssociationAsync(); - EXPECT_EQ(GetController(controllers_, syncable::BOOKMARKS)->state(), + EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), DataTypeController::MODEL_LOADED); - GetController(controllers_, syncable::BOOKMARKS)->FinishStart( + GetController(controllers_, syncer::BOOKMARKS)->FinishStart( DataTypeController::ASSOCIATION_FAILED); } // Ensure configuring stops when a type returns a unrecoverable error. TEST_F(ModelAssociationManagerTest, TypeReturnUnrecoverableError) { - controllers_[syncable::BOOKMARKS] = - new FakeDataTypeController(syncable::BOOKMARKS); + controllers_[syncer::BOOKMARKS] = + new FakeDataTypeController(syncer::BOOKMARKS); ModelAssociationManager model_association_manager(&controllers_, &result_processor_); - syncable::ModelTypeSet types; - types.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet types; + types.Put(syncer::BOOKMARKS); std::list<syncer::SyncError> errors; - syncer::SyncError error(FROM_HERE, "Failed", syncable::BOOKMARKS); + syncer::SyncError error(FROM_HERE, "Failed", syncer::BOOKMARKS); errors.push_back(error); DataTypeManager::ConfigureResult expected_result( DataTypeManager::UNRECOVERABLE_ERROR, types, errors, - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); EXPECT_CALL(result_processor_, OnModelAssociationDone(_)). WillOnce(VerifyResult(expected_result)); @@ -205,25 +205,25 @@ TEST_F(ModelAssociationManagerTest, TypeReturnUnrecoverableError) { model_association_manager.StopDisabledTypes(); model_association_manager.StartAssociationAsync(); - EXPECT_EQ(GetController(controllers_, syncable::BOOKMARKS)->state(), + EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), DataTypeController::MODEL_LOADED); - GetController(controllers_, syncable::BOOKMARKS)->FinishStart( + GetController(controllers_, syncer::BOOKMARKS)->FinishStart( DataTypeController::UNRECOVERABLE_ERROR); } TEST_F(ModelAssociationManagerTest, InitializeAbortsLoad) { - controllers_[syncable::BOOKMARKS] = - new FakeDataTypeController(syncable::BOOKMARKS); - controllers_[syncable::THEMES] = - new FakeDataTypeController(syncable::THEMES); + controllers_[syncer::BOOKMARKS] = + new FakeDataTypeController(syncer::BOOKMARKS); + controllers_[syncer::THEMES] = + new FakeDataTypeController(syncer::THEMES); - GetController(controllers_, syncable::BOOKMARKS)->SetDelayModelLoad(); + GetController(controllers_, syncer::BOOKMARKS)->SetDelayModelLoad(); ModelAssociationManager model_association_manager(&controllers_, &result_processor_); - syncable::ModelTypeSet types(syncable::BOOKMARKS, syncable::THEMES); + syncer::ModelTypeSet types(syncer::BOOKMARKS, syncer::THEMES); - syncable::ModelTypeSet expected_types_waiting_to_load; - expected_types_waiting_to_load.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet expected_types_waiting_to_load; + expected_types_waiting_to_load.Put(syncer::BOOKMARKS); DataTypeManager::ConfigureResult expected_result_partially_done( DataTypeManager::PARTIAL_SUCCESS, types, @@ -246,7 +246,7 @@ TEST_F(ModelAssociationManagerTest, InitializeAbortsLoad) { task.Run(); // Bookmark load times out here. // Apps finishes associating here. - GetController(controllers_, syncable::THEMES)->FinishStart( + GetController(controllers_, syncer::THEMES)->FinishStart( DataTypeController::OK); // At this point, BOOKMARKS is still waiting to load (as evidenced by @@ -257,18 +257,18 @@ TEST_F(ModelAssociationManagerTest, InitializeAbortsLoad) { // to the type having completed loading. EXPECT_CALL(result_processor_, OnTypesLoaded()).Times(0); - EXPECT_EQ(GetController(controllers_, syncable::BOOKMARKS)->state(), + EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), DataTypeController::MODEL_STARTING); model_association_manager.Initialize(types); - EXPECT_EQ(GetController(controllers_, syncable::BOOKMARKS)->state(), + EXPECT_EQ(GetController(controllers_, syncer::BOOKMARKS)->state(), DataTypeController::NOT_RUNNING); DataTypeManager::ConfigureResult expected_result_done( DataTypeManager::OK, types, std::list<syncer::SyncError>(), - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); EXPECT_CALL(result_processor_, OnModelAssociationDone(_)). WillOnce(VerifyResult(expected_result_done)); @@ -276,27 +276,27 @@ TEST_F(ModelAssociationManagerTest, InitializeAbortsLoad) { model_association_manager.StartAssociationAsync(); GetController(controllers_, - syncable::BOOKMARKS)->SimulateModelLoadFinishing(); - GetController(controllers_, syncable::BOOKMARKS)->FinishStart( + syncer::BOOKMARKS)->SimulateModelLoadFinishing(); + GetController(controllers_, syncer::BOOKMARKS)->FinishStart( DataTypeController::OK); } // Start 2 types. One of which timeout loading. Ensure that type is // fully configured eventually. TEST_F(ModelAssociationManagerTest, ModelStartWithSlowLoadingType) { - controllers_[syncable::BOOKMARKS] = - new FakeDataTypeController(syncable::BOOKMARKS); - controllers_[syncable::APPS] = - new FakeDataTypeController(syncable::APPS); - GetController(controllers_, syncable::BOOKMARKS)->SetDelayModelLoad(); + controllers_[syncer::BOOKMARKS] = + new FakeDataTypeController(syncer::BOOKMARKS); + controllers_[syncer::APPS] = + new FakeDataTypeController(syncer::APPS); + GetController(controllers_, syncer::BOOKMARKS)->SetDelayModelLoad(); ModelAssociationManager model_association_manager(&controllers_, &result_processor_); - syncable::ModelTypeSet types; - types.Put(syncable::BOOKMARKS); - types.Put(syncable::APPS); + syncer::ModelTypeSet types; + types.Put(syncer::BOOKMARKS); + types.Put(syncer::APPS); - syncable::ModelTypeSet expected_types_waiting_to_load; - expected_types_waiting_to_load.Put(syncable::BOOKMARKS); + syncer::ModelTypeSet expected_types_waiting_to_load; + expected_types_waiting_to_load.Put(syncer::BOOKMARKS); DataTypeManager::ConfigureResult expected_result_partially_done( DataTypeManager::PARTIAL_SUCCESS, types, @@ -307,7 +307,7 @@ TEST_F(ModelAssociationManagerTest, ModelStartWithSlowLoadingType) { DataTypeManager::OK, types, std::list<syncer::SyncError>(), - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); EXPECT_CALL(result_processor_, OnModelAssociationDone(_)). WillOnce(VerifyResult(expected_result_partially_done)); @@ -328,11 +328,11 @@ TEST_F(ModelAssociationManagerTest, ModelStartWithSlowLoadingType) { task.Run(); // Simulate delayed loading of bookmark model. - GetController(controllers_, syncable::APPS)->FinishStart( + GetController(controllers_, syncer::APPS)->FinishStart( DataTypeController::OK); GetController(controllers_, - syncable::BOOKMARKS)->SimulateModelLoadFinishing(); + syncer::BOOKMARKS)->SimulateModelLoadFinishing(); EXPECT_CALL(result_processor_, OnModelAssociationDone(_)). WillOnce(VerifyResult(expected_result_done)); @@ -343,9 +343,9 @@ TEST_F(ModelAssociationManagerTest, ModelStartWithSlowLoadingType) { model_association_manager.StartAssociationAsync(); GetController(controllers_, - syncable::BOOKMARKS)->SimulateModelLoadFinishing(); + syncer::BOOKMARKS)->SimulateModelLoadFinishing(); - GetController(controllers_, syncable::BOOKMARKS)->FinishStart( + GetController(controllers_, syncer::BOOKMARKS)->FinishStart( DataTypeController::OK); } diff --git a/chrome/browser/sync/glue/new_non_frontend_data_type_controller_mock.h b/chrome/browser/sync/glue/new_non_frontend_data_type_controller_mock.h index 5aced58..4d6d8b0 100644 --- a/chrome/browser/sync/glue/new_non_frontend_data_type_controller_mock.h +++ b/chrome/browser/sync/glue/new_non_frontend_data_type_controller_mock.h @@ -25,7 +25,7 @@ class NewNonFrontendDataTypeControllerMock MOCK_METHOD0(Stop, void()); MOCK_METHOD0(enabled, bool()); - MOCK_CONST_METHOD0(type, syncable::ModelType()); + MOCK_CONST_METHOD0(type, syncer::ModelType()); MOCK_CONST_METHOD0(name, std::string()); MOCK_CONST_METHOD0(model_safe_group, syncer::ModelSafeGroup()); MOCK_CONST_METHOD0(state, State()); diff --git a/chrome/browser/sync/glue/new_non_frontend_data_type_controller_unittest.cc b/chrome/browser/sync/glue/new_non_frontend_data_type_controller_unittest.cc index acad7b0..57d7a2e 100644 --- a/chrome/browser/sync/glue/new_non_frontend_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/new_non_frontend_data_type_controller_unittest.cc @@ -30,7 +30,7 @@ namespace { using base::WaitableEvent; using content::BrowserThread; -using syncable::AUTOFILL_PROFILE; +using syncer::AUTOFILL_PROFILE; using testing::_; using testing::AtLeast; using testing::DoAll; @@ -72,7 +72,7 @@ class NewNonFrontendDataTypeControllerFake blocked_(false), mock_(mock) {} - virtual syncable::ModelType type() const OVERRIDE { + virtual syncer::ModelType type() const OVERRIDE { return AUTOFILL_PROFILE; } virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE { diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller.cc b/chrome/browser/sync/glue/non_frontend_data_type_controller.cc index 1b8f9df..1c3ddeb 100644 --- a/chrome/browser/sync/glue/non_frontend_data_type_controller.cc +++ b/chrome/browser/sync/glue/non_frontend_data_type_controller.cc @@ -154,49 +154,49 @@ void NonFrontendDataTypeController::Stop() { // thread to finish the StartImpl() task. switch (state_) { case ASSOCIATING: - if (type() == syncable::PASSWORDS) { + if (type() == syncer::PASSWORDS) { LOG(INFO) << " Type is Passwords"; StopWhileAssociating(); - } else if (type() == syncable::TYPED_URLS) { + } else if (type() == syncer::TYPED_URLS) { LOG(INFO) << " Type is TypedUrl"; StopWhileAssociating(); - } else if (type() == syncable::APPS) { + } else if (type() == syncer::APPS) { LOG(INFO) << "Type is Apps"; StopWhileAssociating(); - } else if (type() == syncable::EXTENSIONS) { + } else if (type() == syncer::EXTENSIONS) { LOG(INFO) << "Type is Extension"; StopWhileAssociating(); - } else if (type() == syncable::PREFERENCES) { + } else if (type() == syncer::PREFERENCES) { LOG(INFO) << "Type is Preferences(Does not belong to non-frontend)"; StopWhileAssociating(); - } else if (type() == syncable::EXTENSION_SETTINGS) { + } else if (type() == syncer::EXTENSION_SETTINGS) { LOG(INFO) << "Type is Extension Settings"; StopWhileAssociating(); - } else if (type() == syncable::APP_SETTINGS) { + } else if (type() == syncer::APP_SETTINGS) { LOG(INFO) << "Type is App Settings."; StopWhileAssociating(); - } else if (type() == syncable::BOOKMARKS) { + } else if (type() == syncer::BOOKMARKS) { LOG(INFO) << "Type is BOOKMARKS."; StopWhileAssociating(); - } else if (type() == syncable::AUTOFILL_PROFILE) { + } else if (type() == syncer::AUTOFILL_PROFILE) { LOG(INFO) << "Type is AUTOFILL_PROFILE."; StopWhileAssociating(); - } else if (type() == syncable::AUTOFILL) { + } else if (type() == syncer::AUTOFILL) { LOG(INFO) << "Type is AUTOFILL."; StopWhileAssociating(); - } else if (type() == syncable::THEMES) { + } else if (type() == syncer::THEMES) { LOG(INFO) << "Type is THEMES."; StopWhileAssociating(); - } else if (type() == syncable::NIGORI) { + } else if (type() == syncer::NIGORI) { LOG(INFO) << "Type is NIGORI."; StopWhileAssociating(); - } else if (type() == syncable::SEARCH_ENGINES) { + } else if (type() == syncer::SEARCH_ENGINES) { LOG(INFO) << "Type is SEARCH_ENGINES."; StopWhileAssociating(); - } else if (type() == syncable::SESSIONS) { + } else if (type() == syncer::SESSIONS) { LOG(INFO) << "Type is SESSIONS."; StopWhileAssociating(); - } else if (type() == syncable::APP_NOTIFICATIONS) { + } else if (type() == syncer::APP_NOTIFICATIONS) { LOG(INFO) << "Type is APP_NOTIFICATIONS."; StopWhileAssociating(); } else { @@ -243,7 +243,7 @@ void NonFrontendDataTypeController::Stop() { std::string NonFrontendDataTypeController::name() const { // For logging only. - return syncable::ModelTypeToString(type()); + return syncer::ModelTypeToString(type()); } DataTypeController::State NonFrontendDataTypeController::state() const { @@ -368,7 +368,7 @@ void NonFrontendDataTypeController::RecordAssociationTime( void NonFrontendDataTypeController::RecordStartFailure(StartResult result) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeStartFailures", type(), - syncable::MODEL_TYPE_COUNT); + syncer::MODEL_TYPE_COUNT); #define PER_DATA_TYPE_MACRO(type_str) \ UMA_HISTOGRAM_ENUMERATION("Sync." type_str "StartFailure", result, \ MAX_START_RESULT); diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller.h b/chrome/browser/sync/glue/non_frontend_data_type_controller.h index 6e9173f..177802a 100644 --- a/chrome/browser/sync/glue/non_frontend_data_type_controller.h +++ b/chrome/browser/sync/glue/non_frontend_data_type_controller.h @@ -55,7 +55,7 @@ class NonFrontendDataTypeController : public DataTypeController { const ModelLoadCallback& model_load_callback) OVERRIDE; virtual void StartAssociating(const StartCallback& start_callback) OVERRIDE; virtual void Stop() OVERRIDE; - virtual syncable::ModelType type() const = 0; + virtual syncer::ModelType type() const = 0; virtual syncer::ModelSafeGroup model_safe_group() const = 0; virtual std::string name() const OVERRIDE; virtual State state() const OVERRIDE; diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller_mock.h b/chrome/browser/sync/glue/non_frontend_data_type_controller_mock.h index cd73c1b..66e6b65 100644 --- a/chrome/browser/sync/glue/non_frontend_data_type_controller_mock.h +++ b/chrome/browser/sync/glue/non_frontend_data_type_controller_mock.h @@ -24,7 +24,7 @@ class NonFrontendDataTypeControllerMock : public NonFrontendDataTypeController { MOCK_METHOD0(Stop, void()); MOCK_METHOD0(enabled, bool()); - MOCK_CONST_METHOD0(type, syncable::ModelType()); + MOCK_CONST_METHOD0(type, syncer::ModelType()); MOCK_CONST_METHOD0(name, std::string()); MOCK_CONST_METHOD0(model_safe_group, syncer::ModelSafeGroup()); MOCK_CONST_METHOD0(state, State()); diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc b/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc index 39c21dd..7f0a37d 100644 --- a/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc @@ -61,7 +61,7 @@ class NonFrontendDataTypeControllerFake : public NonFrontendDataTypeController { sync_service), mock_(mock) {} - virtual syncable::ModelType type() const { return syncable::BOOKMARKS; } + virtual syncer::ModelType type() const { return syncer::BOOKMARKS; } virtual syncer::ModelSafeGroup model_safe_group() const { return syncer::GROUP_DB; } @@ -250,7 +250,7 @@ TEST_F(SyncNonFrontendDataTypeControllerTest, StartAssociationFailed) { WillOnce(DoAll(SetArgumentPointee<0>(true), Return(true))); EXPECT_CALL(*model_associator_, AssociateModels()). WillOnce( - Return(syncer::SyncError(FROM_HERE, "Error", syncable::AUTOFILL))); + Return(syncer::SyncError(FROM_HERE, "Error", syncer::AUTOFILL))); EXPECT_CALL(*dtc_mock_, RecordAssociationTime(_)); SetStartFailExpectations(DataTypeController::ASSOCIATION_FAILED); // Set up association to fail with an association failed error. diff --git a/chrome/browser/sync/glue/password_change_processor.cc b/chrome/browser/sync/glue/password_change_processor.cc index 67b506d..bb10d91 100644 --- a/chrome/browser/sync/glue/password_change_processor.cc +++ b/chrome/browser/sync/glue/password_change_processor.cc @@ -83,7 +83,7 @@ void PasswordChangeProcessor::Observe( case PasswordStoreChange::ADD: { syncer::WriteNode sync_node(&trans); syncer::WriteNode::InitUniqueByCreationResult result = - sync_node.InitUniqueByCreation(syncable::PASSWORDS, password_root, + sync_node.InitUniqueByCreation(syncer::PASSWORDS, password_root, tag); if (result == syncer::WriteNode::INIT_SUCCESS) { PasswordModelAssociator::WriteToSyncNode(change->form(), &sync_node); @@ -208,7 +208,7 @@ void PasswordChangeProcessor::ApplyChangesFromSyncModel( // Check that the changed node is a child of the passwords folder. DCHECK_EQ(password_root.GetId(), sync_node.GetParentId()); - DCHECK_EQ(syncable::PASSWORDS, sync_node.GetModelType()); + DCHECK_EQ(syncer::PASSWORDS, sync_node.GetModelType()); const sync_pb::PasswordSpecificsData& password_data = sync_node.GetPasswordSpecifics(); diff --git a/chrome/browser/sync/glue/password_data_type_controller.cc b/chrome/browser/sync/glue/password_data_type_controller.cc index e431751..d071cb9 100644 --- a/chrome/browser/sync/glue/password_data_type_controller.cc +++ b/chrome/browser/sync/glue/password_data_type_controller.cc @@ -28,8 +28,8 @@ PasswordDataTypeController::PasswordDataTypeController( sync_service) { } -syncable::ModelType PasswordDataTypeController::type() const { - return syncable::PASSWORDS; +syncer::ModelType PasswordDataTypeController::type() const { + return syncer::PASSWORDS; } syncer::ModelSafeGroup PasswordDataTypeController::model_safe_group() diff --git a/chrome/browser/sync/glue/password_data_type_controller.h b/chrome/browser/sync/glue/password_data_type_controller.h index f9a0fc7..7d73695 100644 --- a/chrome/browser/sync/glue/password_data_type_controller.h +++ b/chrome/browser/sync/glue/password_data_type_controller.h @@ -25,7 +25,7 @@ class PasswordDataTypeController : public NonFrontendDataTypeController { ProfileSyncService* sync_service); // NonFrontendDataTypeController implementation - virtual syncable::ModelType type() const OVERRIDE; + virtual syncer::ModelType type() const OVERRIDE; virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE; protected: diff --git a/chrome/browser/sync/glue/password_model_associator.cc b/chrome/browser/sync/glue/password_model_associator.cc index e91e3ec..219de0d 100644 --- a/chrome/browser/sync/glue/password_model_associator.cc +++ b/chrome/browser/sync/glue/password_model_associator.cc @@ -92,7 +92,7 @@ syncer::SyncError PasswordModelAssociator::AssociateModels() { std::string tag = MakeTag(**ix); syncer::ReadNode node(&trans); - if (node.InitByClientTagLookup(syncable::PASSWORDS, tag) == + if (node.InitByClientTagLookup(syncer::PASSWORDS, tag) == syncer::BaseNode::INIT_OK) { const sync_pb::PasswordSpecificsData& password = node.GetPasswordSpecifics(); @@ -102,7 +102,7 @@ syncer::SyncError PasswordModelAssociator::AssociateModels() { if (MergePasswords(password, **ix, &new_password)) { syncer::WriteNode write_node(&trans); - if (write_node.InitByClientTagLookup(syncable::PASSWORDS, tag) != + if (write_node.InitByClientTagLookup(syncer::PASSWORDS, tag) != syncer::BaseNode::INIT_OK) { STLDeleteElements(&passwords); return error_handler_->CreateAndUploadError( @@ -118,7 +118,7 @@ syncer::SyncError PasswordModelAssociator::AssociateModels() { } else { syncer::WriteNode node(&trans); syncer::WriteNode::InitUniqueByCreationResult result = - node.InitUniqueByCreation(syncable::PASSWORDS, password_root, tag); + node.InitUniqueByCreation(syncer::PASSWORDS, password_root, tag); if (result != syncer::WriteNode::INIT_SUCCESS) { STLDeleteElements(&passwords); return error_handler_->CreateAndUploadError( diff --git a/chrome/browser/sync/glue/password_model_associator.h b/chrome/browser/sync/glue/password_model_associator.h index 5c995f4..793eb0f 100644 --- a/chrome/browser/sync/glue/password_model_associator.h +++ b/chrome/browser/sync/glue/password_model_associator.h @@ -47,7 +47,7 @@ class PasswordModelAssociator public: typedef std::vector<webkit::forms::PasswordForm> PasswordVector; - static syncable::ModelType model_type() { return syncable::PASSWORDS; } + static syncer::ModelType model_type() { return syncer::PASSWORDS; } PasswordModelAssociator(ProfileSyncService* sync_service, PasswordStore* password_store, DataTypeErrorHandler* error_handler); diff --git a/chrome/browser/sync/glue/search_engine_data_type_controller.cc b/chrome/browser/sync/glue/search_engine_data_type_controller.cc index 4be17da..c2baa83 100644 --- a/chrome/browser/sync/glue/search_engine_data_type_controller.cc +++ b/chrome/browser/sync/glue/search_engine_data_type_controller.cc @@ -22,7 +22,7 @@ SearchEngineDataTypeController::SearchEngineDataTypeController( ProfileSyncComponentsFactory* profile_sync_factory, Profile* profile, ProfileSyncService* sync_service) - : UIDataTypeController(syncable::SEARCH_ENGINES, + : UIDataTypeController(syncer::SEARCH_ENGINES, profile_sync_factory, profile, sync_service) { diff --git a/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc b/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc index e5e8d70..77456ef 100644 --- a/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/search_engine_data_type_controller_unittest.cc @@ -55,7 +55,7 @@ class SyncSearchEngineDataTypeControllerTest : public testing::Test { virtual void TearDown() { // Must be done before we pump the loop. - syncable_service_.StopSyncing(syncable::SEARCH_ENGINES); + syncable_service_.StopSyncing(syncer::SEARCH_ENGINES); search_engine_dtc_ = NULL; test_util_.TearDown(); } @@ -70,7 +70,7 @@ class SyncSearchEngineDataTypeControllerTest : public testing::Test { // Ownership gets passed to caller of CreateGenericChangeProcessor. EXPECT_CALL(model_load_callback_, Run(_, _)); EXPECT_CALL(*profile_sync_factory_, - GetSyncableServiceForType(syncable::SEARCH_ENGINES)). + GetSyncableServiceForType(syncer::SEARCH_ENGINES)). WillOnce(Return(syncable_service_.AsWeakPtr())); EXPECT_CALL(*profile_sync_factory_, CreateSharedChangeProcessor()). WillOnce(MakeSharedChangeProcessor()); @@ -79,11 +79,11 @@ class SyncSearchEngineDataTypeControllerTest : public testing::Test { } void SetActivateExpectations() { - EXPECT_CALL(service_, ActivateDataType(syncable::SEARCH_ENGINES, _, _)); + EXPECT_CALL(service_, ActivateDataType(syncer::SEARCH_ENGINES, _, _)); } void SetStopExpectations() { - EXPECT_CALL(service_, DeactivateDataType(syncable::SEARCH_ENGINES)); + EXPECT_CALL(service_, DeactivateDataType(syncer::SEARCH_ENGINES)); } void Start() { @@ -161,7 +161,7 @@ TEST_F(SyncSearchEngineDataTypeControllerTest, StartAssociationFailed) { EXPECT_CALL(start_callback_, Run(DataTypeController::ASSOCIATION_FAILED, _)); syncable_service_.set_merge_data_and_start_syncing_error( - syncer::SyncError(FROM_HERE, "Error", syncable::SEARCH_ENGINES)); + syncer::SyncError(FROM_HERE, "Error", syncer::SEARCH_ENGINES)); Start(); EXPECT_EQ(DataTypeController::DISABLED, search_engine_dtc_->state()); diff --git a/chrome/browser/sync/glue/session_change_processor.cc b/chrome/browser/sync/glue/session_change_processor.cc index b5d7392..c055b07 100644 --- a/chrome/browser/sync/glue/session_change_processor.cc +++ b/chrome/browser/sync/glue/session_change_processor.cc @@ -213,13 +213,13 @@ void SessionChangeProcessor::Observe( entry->GetVirtualURL().is_valid() && entry->GetVirtualURL().spec() == kNTPOpenTabSyncURL) { DVLOG(1) << "Triggering sync refresh for sessions datatype."; - const syncable::ModelType type = syncable::SESSIONS; - syncable::ModelTypePayloadMap payload_map; + const syncer::ModelType type = syncer::SESSIONS; + syncer::ModelTypePayloadMap payload_map; payload_map[type] = ""; content::NotificationService::current()->Notify( chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, content::Source<Profile>(profile_), - content::Details<const syncable::ModelTypePayloadMap>(&payload_map)); + content::Details<const syncer::ModelTypePayloadMap>(&payload_map)); } } @@ -277,8 +277,8 @@ void SessionChangeProcessor::ApplyChangesFromSyncModel( // Deletions are all or nothing (since we only ever delete entire // sessions). Therefore we don't care if it's a tab node or meta node, // and just ensure we've disassociated. - DCHECK_EQ(syncable::GetModelTypeFromSpecifics(it->specifics), - syncable::SESSIONS); + DCHECK_EQ(syncer::GetModelTypeFromSpecifics(it->specifics), + syncer::SESSIONS); const sync_pb::SessionSpecifics& specifics = it->specifics.session(); if (specifics.session_tag() == local_tag) { // Another client has attempted to delete our local data (possibly by @@ -303,7 +303,7 @@ void SessionChangeProcessor::ApplyChangesFromSyncModel( // Check that the changed node is a child of the session folder. DCHECK(root.GetId() == sync_node.GetParentId()); - DCHECK(syncable::SESSIONS == sync_node.GetModelType()); + DCHECK(syncer::SESSIONS == sync_node.GetModelType()); const sync_pb::SessionSpecifics& specifics( sync_node.GetSessionSpecifics()); diff --git a/chrome/browser/sync/glue/session_data_type_controller.cc b/chrome/browser/sync/glue/session_data_type_controller.cc index fe1cbcb..a8f627f 100644 --- a/chrome/browser/sync/glue/session_data_type_controller.cc +++ b/chrome/browser/sync/glue/session_data_type_controller.cc @@ -28,8 +28,8 @@ SessionModelAssociator* SessionDataTypeController::GetModelAssociator() { return reinterpret_cast<SessionModelAssociator*>(model_associator_.get()); } -syncable::ModelType SessionDataTypeController::type() const { - return syncable::SESSIONS; +syncer::ModelType SessionDataTypeController::type() const { + return syncer::SESSIONS; } bool SessionDataTypeController::StartModels() { diff --git a/chrome/browser/sync/glue/session_data_type_controller.h b/chrome/browser/sync/glue/session_data_type_controller.h index fc4309a..d3c19f1 100644 --- a/chrome/browser/sync/glue/session_data_type_controller.h +++ b/chrome/browser/sync/glue/session_data_type_controller.h @@ -28,7 +28,7 @@ class SessionDataTypeController : public FrontendDataTypeController, SessionModelAssociator* GetModelAssociator(); // FrontendDataTypeController implementation. - virtual syncable::ModelType type() const OVERRIDE; + virtual syncer::ModelType type() const OVERRIDE; // NotificationObserver interface. virtual void Observe(int type, diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc index 597c35c..393334a 100644 --- a/chrome/browser/sync/glue/session_model_associator.cc +++ b/chrome/browser/sync/glue/session_model_associator.cc @@ -52,7 +52,7 @@ using content::BrowserThread; using content::NavigationEntry; using prefs::kSyncSessionsGUID; -using syncable::SESSIONS; +using syncer::SESSIONS; namespace browser_sync { @@ -745,7 +745,7 @@ syncer::SyncError SessionModelAssociator::AssociateModels() { syncer::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare()); syncer::ReadNode root(&trans); - if (root.InitByTagLookup(syncable::ModelTypeToRootTag(model_type())) != + if (root.InitByTagLookup(syncer::ModelTypeToRootTag(model_type())) != syncer::BaseNode::INIT_OK) { return error_handler_->CreateAndUploadError( FROM_HERE, @@ -1397,13 +1397,13 @@ void SessionModelAssociator::TabNodePool::FreeTabNode(int64 sync_id) { void SessionModelAssociator::AttemptSessionsDataRefresh() const { DVLOG(1) << "Triggering sync refresh for sessions datatype."; - const syncable::ModelType type = syncable::SESSIONS; - syncable::ModelTypePayloadMap payload_map; + const syncer::ModelType type = syncer::SESSIONS; + syncer::ModelTypePayloadMap payload_map; payload_map[type] = ""; content::NotificationService::current()->Notify( chrome::NOTIFICATION_SYNC_REFRESH_LOCAL, content::Source<Profile>(profile_), - content::Details<const syncable::ModelTypePayloadMap>(&payload_map)); + content::Details<const syncer::ModelTypePayloadMap>(&payload_map)); } bool SessionModelAssociator::GetLocalSession( @@ -1581,7 +1581,7 @@ void SessionModelAssociator::BlockUntilLocalChangeForTest( bool SessionModelAssociator::CryptoReadyIfNecessary() { // We only access the cryptographer while holding a transaction. syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); - const syncable::ModelTypeSet encrypted_types = + const syncer::ModelTypeSet encrypted_types = syncer::GetEncryptedTypes(&trans); return !encrypted_types.Has(SESSIONS) || sync_service_->IsCryptographerReady(&trans); diff --git a/chrome/browser/sync/glue/session_model_associator.h b/chrome/browser/sync/glue/session_model_associator.h index 76f49fb..24a1f9a 100644 --- a/chrome/browser/sync/glue/session_model_associator.h +++ b/chrome/browser/sync/glue/session_model_associator.h @@ -218,7 +218,7 @@ class SessionModelAssociator void FaviconsUpdated(const std::set<GURL>& urls); // Returns the syncable model type. - static syncable::ModelType model_type() { return syncable::SESSIONS; } + static syncer::ModelType model_type() { return syncer::SESSIONS; } // Testing only. Will cause the associator to call MessageLoop::Quit() // when a local change is made, or when timeout_milli occurs, whichever is diff --git a/chrome/browser/sync/glue/shared_change_processor.cc b/chrome/browser/sync/glue/shared_change_processor.cc index dd25227..1e536d1 100644 --- a/chrome/browser/sync/glue/shared_change_processor.cc +++ b/chrome/browser/sync/glue/shared_change_processor.cc @@ -17,7 +17,7 @@ namespace browser_sync { SharedChangeProcessor::SharedChangeProcessor() : disconnected_(false), - type_(syncable::UNSPECIFIED), + type_(syncer::UNSPECIFIED), sync_service_(NULL), generic_change_processor_(NULL), error_handler_(NULL) { @@ -49,11 +49,11 @@ base::WeakPtr<syncer::SyncableService> SharedChangeProcessor::Connect( ProfileSyncComponentsFactory* sync_factory, ProfileSyncService* sync_service, DataTypeErrorHandler* error_handler, - syncable::ModelType type) { + syncer::ModelType type) { DCHECK(sync_factory); DCHECK(sync_service); DCHECK(error_handler); - DCHECK_NE(type, syncable::UNSPECIFIED); + DCHECK_NE(type, syncer::UNSPECIFIED); backend_loop_ = base::MessageLoopProxy::current(); AutoLock lock(monitor_lock_); if (disconnected_) diff --git a/chrome/browser/sync/glue/shared_change_processor.h b/chrome/browser/sync/glue/shared_change_processor.h index 5b2fae5..cb90af6 100644 --- a/chrome/browser/sync/glue/shared_change_processor.h +++ b/chrome/browser/sync/glue/shared_change_processor.h @@ -64,7 +64,7 @@ class SharedChangeProcessor ProfileSyncComponentsFactory* sync_factory, ProfileSyncService* sync_service, DataTypeErrorHandler* error_handler, - syncable::ModelType type); + syncer::ModelType type); // Disconnects from the generic change processor. May be called from any // thread. After this, all attempts to interact with the change processor by @@ -109,7 +109,7 @@ class SharedChangeProcessor bool disconnected_; // The sync datatype we were last connected to. - syncable::ModelType type_; + syncer::ModelType type_; // The ProfileSyncService we're currently connected to. ProfileSyncService* sync_service_; diff --git a/chrome/browser/sync/glue/shared_change_processor_mock.h b/chrome/browser/sync/glue/shared_change_processor_mock.h index ec7d141..c41455a 100644 --- a/chrome/browser/sync/glue/shared_change_processor_mock.h +++ b/chrome/browser/sync/glue/shared_change_processor_mock.h @@ -21,7 +21,7 @@ class SharedChangeProcessorMock : public SharedChangeProcessor { ProfileSyncComponentsFactory*, ProfileSyncService*, DataTypeErrorHandler*, - syncable::ModelType)); + syncer::ModelType)); MOCK_METHOD0(Disconnect, bool()); MOCK_METHOD2(ProcessSyncChanges, syncer::SyncError(const tracked_objects::Location&, diff --git a/chrome/browser/sync/glue/shared_change_processor_unittest.cc b/chrome/browser/sync/glue/shared_change_processor_unittest.cc index f40dc22..16e0c7c 100644 --- a/chrome/browser/sync/glue/shared_change_processor_unittest.cc +++ b/chrome/browser/sync/glue/shared_change_processor_unittest.cc @@ -102,12 +102,12 @@ class SyncSharedChangeProcessorTest : public testing::Test { void ConnectOnDBThread( const scoped_refptr<SharedChangeProcessor>& shared_change_processor) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); - EXPECT_CALL(sync_factory_, GetSyncableServiceForType(syncable::AUTOFILL)). + EXPECT_CALL(sync_factory_, GetSyncableServiceForType(syncer::AUTOFILL)). WillOnce(GetWeakPtrToSyncableService(db_syncable_service_.get())); EXPECT_TRUE(shared_change_processor->Connect(&sync_factory_, &sync_service_, &error_handler_, - syncable::AUTOFILL)); + syncer::AUTOFILL)); } MessageLoopForUI ui_loop_; diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc index 01a943a..963ccab 100644 --- a/chrome/browser/sync/glue/sync_backend_host.cc +++ b/chrome/browser/sync/glue/sync_backend_host.cc @@ -98,7 +98,7 @@ class SyncBackendHost::Core virtual void OnStopSyncingPermanently() OVERRIDE; virtual void OnUpdatedToken(const std::string& token) OVERRIDE; virtual void OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) OVERRIDE; virtual void OnEncryptionComplete() OVERRIDE; virtual void OnActionableError( @@ -120,7 +120,7 @@ class SyncBackendHost::Core void DoUpdateCredentials(const syncer::SyncCredentials& credentials); // Called when the user disables or enables a sync type. - void DoUpdateEnabledTypes(const syncable::ModelTypeSet& enabled_types); + void DoUpdateEnabledTypes(const syncer::ModelTypeSet& enabled_types); // Called to tell the syncapi to start syncing (generally after // initialization and authentication). @@ -161,7 +161,7 @@ class SyncBackendHost::Core virtual void DoRequestConfig( const syncer::ModelSafeRoutingInfo& routing_info, - syncable::ModelTypeSet types_to_config, + syncer::ModelTypeSet types_to_config, syncer::ConfigureReason reason); // Start the configuration mode. |callback| is called on the sync @@ -366,7 +366,7 @@ void SyncBackendHost::Initialize( SyncFrontend* frontend, const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, const GURL& sync_service_url, - syncable::ModelTypeSet initial_types, + syncer::ModelTypeSet initial_types, const SyncCredentials& credentials, bool delete_sync_data_folder, syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, @@ -378,10 +378,10 @@ void SyncBackendHost::Initialize( frontend_ = frontend; DCHECK(frontend); - syncable::ModelTypeSet initial_types_with_nigori(initial_types); + syncer::ModelTypeSet initial_types_with_nigori(initial_types); CHECK(sync_prefs_.get()); if (sync_prefs_->HasSyncSetupCompleted()) { - initial_types_with_nigori.Put(syncable::NIGORI); + initial_types_with_nigori.Put(syncer::NIGORI); } registrar_.reset(new SyncBackendRegistrar(initial_types_with_nigori, @@ -423,7 +423,7 @@ void SyncBackendHost::UpdateCredentials(const SyncCredentials& credentials) { void SyncBackendHost::StartSyncingWithServer() { SDVLOG(1) << "SyncBackendHost::StartSyncingWithServer called."; - syncer::ModelSafeRoutingInfo routing_info; + syncer::ModelSafeRoutingInfo routing_info; registrar_->GetModelSafeRoutingInfo(&routing_info); sync_thread_.message_loop()->PostTask(FROM_HERE, @@ -586,19 +586,19 @@ void SyncBackendHost::Shutdown(bool sync_disabled) { void SyncBackendHost::ConfigureDataTypes( syncer::ConfigureReason reason, - syncable::ModelTypeSet types_to_add, - syncable::ModelTypeSet types_to_remove, + syncer::ModelTypeSet types_to_add, + syncer::ModelTypeSet types_to_remove, NigoriState nigori_state, - base::Callback<void(syncable::ModelTypeSet)> ready_task, + base::Callback<void(syncer::ModelTypeSet)> ready_task, base::Callback<void()> retry_callback) { - syncable::ModelTypeSet types_to_add_with_nigori = types_to_add; - syncable::ModelTypeSet types_to_remove_with_nigori = types_to_remove; + syncer::ModelTypeSet types_to_add_with_nigori = types_to_add; + syncer::ModelTypeSet types_to_remove_with_nigori = types_to_remove; if (nigori_state == WITH_NIGORI) { - types_to_add_with_nigori.Put(syncable::NIGORI); - types_to_remove_with_nigori.Remove(syncable::NIGORI); + types_to_add_with_nigori.Put(syncer::NIGORI); + types_to_remove_with_nigori.Remove(syncer::NIGORI); } else { - types_to_add_with_nigori.Remove(syncable::NIGORI); - types_to_remove_with_nigori.Put(syncable::NIGORI); + types_to_add_with_nigori.Remove(syncer::NIGORI); + types_to_remove_with_nigori.Put(syncer::NIGORI); } // Only one configure is allowed at a time. DCHECK(!pending_config_mode_state_.get()); @@ -618,7 +618,7 @@ void SyncBackendHost::ConfigureDataTypes( // callers can assume that the data types are cleaned up once // configuration is done. if (!types_to_remove_with_nigori.Empty()) { - syncer::ModelSafeRoutingInfo routing_info; + syncer::ModelSafeRoutingInfo routing_info; registrar_->GetModelSafeRoutingInfo(&routing_info); sync_thread_.message_loop()->PostTask( FROM_HERE, @@ -647,12 +647,12 @@ void SyncBackendHost::EnableEncryptEverything() { } void SyncBackendHost::ActivateDataType( - syncable::ModelType type, syncer::ModelSafeGroup group, + syncer::ModelType type, syncer::ModelSafeGroup group, ChangeProcessor* change_processor) { registrar_->ActivateDataType(type, group, change_processor, GetUserShare()); } -void SyncBackendHost::DeactivateDataType(syncable::ModelType type) { +void SyncBackendHost::DeactivateDataType(syncer::ModelType type) { registrar_->DeactivateDataType(type); } @@ -694,7 +694,7 @@ bool SyncBackendHost::IsCryptographerReady( } void SyncBackendHost::GetModelSafeRoutingInfo( - syncer::ModelSafeRoutingInfo* out) const { + syncer::ModelSafeRoutingInfo* out) const { if (initialized()) { CHECK(registrar_.get()); registrar_->GetModelSafeRoutingInfo(out); @@ -718,7 +718,7 @@ void SyncBackendHost::HandleSyncCycleCompletedOnFrontendLoop( SDVLOG(1) << "Got snapshot " << snapshot.ToString(); - const syncable::ModelTypeSet to_migrate = + const syncer::ModelTypeSet to_migrate = snapshot.model_neutral_state().types_needing_local_migration; if (!to_migrate.Empty()) frontend_->OnMigrationNeededForTypes(to_migrate); @@ -732,22 +732,22 @@ void SyncBackendHost::HandleSyncCycleCompletedOnFrontendLoop( // if this sync cycle has initialized all of the types we've been // waiting for. if (pending_download_state_.get()) { - const syncable::ModelTypeSet types_to_add = + const syncer::ModelTypeSet types_to_add = pending_download_state_->types_to_add; - const syncable::ModelTypeSet added_types = + const syncer::ModelTypeSet added_types = pending_download_state_->added_types; DCHECK(types_to_add.HasAll(added_types)); - const syncable::ModelTypeSet initial_sync_ended = + const syncer::ModelTypeSet initial_sync_ended = snapshot.initial_sync_ended(); - const syncable::ModelTypeSet failed_configuration_types = + const syncer::ModelTypeSet failed_configuration_types = Difference(added_types, initial_sync_ended); SDVLOG(1) << "Added types: " - << syncable::ModelTypeSetToString(added_types) + << syncer::ModelTypeSetToString(added_types) << ", configured types: " - << syncable::ModelTypeSetToString(initial_sync_ended) + << syncer::ModelTypeSetToString(initial_sync_ended) << ", failed configuration types: " - << syncable::ModelTypeSetToString(failed_configuration_types); + << syncer::ModelTypeSetToString(failed_configuration_types); if (!failed_configuration_types.Empty() && snapshot.retry_scheduled()) { @@ -790,11 +790,9 @@ void SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop() { SDVLOG(1) << "Syncer in config mode. SBH executing " << "FinishConfigureDataTypesOnFrontendLoop"; - - syncer::ModelSafeRoutingInfo routing_info; + syncer::ModelSafeRoutingInfo routing_info; registrar_->GetModelSafeRoutingInfo(&routing_info); - const syncable::ModelTypeSet enabled_types = - GetRoutingInfoTypes(routing_info); + const syncer::ModelTypeSet enabled_types = GetRoutingInfoTypes(routing_info); // Update |chrome_sync_notification_bridge_|'s enabled types here as it has // to happen on the UI thread. @@ -820,26 +818,25 @@ void SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop() { if (pending_config_mode_state_->added_types.Empty()) { SDVLOG(1) << "No new types added; calling ready_task directly"; // No new types - just notify the caller that the types are available. - const syncable::ModelTypeSet failed_configuration_types; + const syncer::ModelTypeSet failed_configuration_types; pending_config_mode_state_->ready_task.Run(failed_configuration_types); } else { pending_download_state_.reset(pending_config_mode_state_.release()); // Always configure nigori if it's enabled. - syncable::ModelTypeSet types_to_config = - pending_download_state_->added_types; + syncer::ModelTypeSet types_to_config = pending_download_state_->added_types; if (IsNigoriEnabled()) { // Note: Nigori is the only type that gets added with a nonempty // progress marker during config. If the server returns a migration // error then we will go into unrecoverable error. We dont handle it // explicitly because server might help us out here by not sending a // migraiton error for nigori during config. - types_to_config.Put(syncable::NIGORI); + types_to_config.Put(syncer::NIGORI); } SDVLOG(1) << "Types " - << syncable::ModelTypeSetToString(types_to_config) + << syncer::ModelTypeSetToString(types_to_config) << " added; calling DoRequestConfig"; - syncer::ModelSafeRoutingInfo routing_info; + syncer::ModelSafeRoutingInfo routing_info; registrar_->GetModelSafeRoutingInfo(&routing_info); sync_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(&SyncBackendHost::Core::DoRequestConfig, @@ -1011,7 +1008,7 @@ void SyncBackendHost::Core::OnUpdatedToken(const std::string& token) { } void SyncBackendHost::Core::OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) { if (!sync_loop_) return; @@ -1108,7 +1105,7 @@ void SyncBackendHost::Core::DoUpdateCredentials( } void SyncBackendHost::Core::DoUpdateEnabledTypes( - const syncable::ModelTypeSet& enabled_types) { + const syncer::ModelTypeSet& enabled_types) { DCHECK_EQ(MessageLoop::current(), sync_loop_); sync_manager_->UpdateEnabledTypes(enabled_types); } @@ -1178,7 +1175,7 @@ void SyncBackendHost::Core::DoShutdown(bool sync_disabled) { void SyncBackendHost::Core::DoRequestConfig( const syncer::ModelSafeRoutingInfo& routing_info, - syncable::ModelTypeSet types_to_config, + syncer::ModelTypeSet types_to_config, syncer::ConfigureReason reason) { DCHECK_EQ(MessageLoop::current(), sync_loop_); sync_manager_->RequestConfig(routing_info, types_to_config, reason); @@ -1270,8 +1267,8 @@ void SyncBackendHost::HandleInitializationCompletedOnFrontendLoop( initialization_state_ = DOWNLOADING_NIGORI; ConfigureDataTypes( syncer::CONFIGURE_REASON_NEW_CLIENT, - syncable::ModelTypeSet(), - syncable::ModelTypeSet(), + syncer::ModelTypeSet(), + syncer::ModelTypeSet(), WITH_NIGORI, // Calls back into this function. base::Bind( @@ -1364,7 +1361,7 @@ void SyncBackendHost::NotifyUpdatedToken(const std::string& token) { } void SyncBackendHost::NotifyEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) { if (!frontend_) return; @@ -1400,7 +1397,7 @@ void SyncBackendHost::HandleConnectionStatusChangeOnFrontendLoop( void SyncBackendHost::HandleNigoriConfigurationCompletedOnFrontendLoop( const syncer::WeakHandle<syncer::JsBackend>& js_backend, - const syncable::ModelTypeSet failed_configuration_types) { + const syncer::ModelTypeSet failed_configuration_types) { HandleInitializationCompletedOnFrontendLoop( js_backend, failed_configuration_types.Empty()); } diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h index 50feda2..02352f4 100644 --- a/chrome/browser/sync/glue/sync_backend_host.h +++ b/chrome/browser/sync/glue/sync_backend_host.h @@ -108,7 +108,7 @@ class SyncFrontend { // of encrypted types is syncer::Cryptographer::SensitiveTypes() and that // the encrypt everything flag is false. virtual void OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) = 0; // Called after we finish encrypting the current set of encrypted @@ -116,16 +116,14 @@ class SyncFrontend { virtual void OnEncryptionComplete() = 0; // Called to perform migration of |types|. - virtual void OnMigrationNeededForTypes( - syncable::ModelTypeSet types) = 0; + virtual void OnMigrationNeededForTypes(syncer::ModelTypeSet types) = 0; // Inform the Frontend that new datatypes are available for registration. virtual void OnExperimentsChanged( const syncer::Experiments& experiments) = 0; // Called when the sync cycle returns there is an user actionable error. - virtual void OnActionableError( - const syncer::SyncProtocolError& error) = 0; + virtual void OnActionableError(const syncer::SyncProtocolError& error) = 0; protected: // Don't delete through SyncFrontend interface. @@ -169,7 +167,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { SyncFrontend* frontend, const syncer::WeakHandle<syncer::JsEventHandler>& event_handler, const GURL& service_url, - syncable::ModelTypeSet initial_types, + syncer::ModelTypeSet initial_types, const syncer::SyncCredentials& credentials, bool delete_sync_data_folder, syncer::UnrecoverableErrorHandler* unrecoverable_error_handler, @@ -224,10 +222,10 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // is non-empty, then an error was encountered). virtual void ConfigureDataTypes( syncer::ConfigureReason reason, - syncable::ModelTypeSet types_to_add, - syncable::ModelTypeSet types_to_remove, + syncer::ModelTypeSet types_to_add, + syncer::ModelTypeSet types_to_remove, NigoriState nigori_state, - base::Callback<void(syncable::ModelTypeSet)> ready_task, + base::Callback<void(syncer::ModelTypeSet)> ready_task, base::Callback<void()> retry_callback) OVERRIDE; // Makes an asynchronous call to syncer to switch to config mode. When done @@ -242,11 +240,11 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // no changes are dropped between model association and change // processor activation. void ActivateDataType( - syncable::ModelType type, syncer::ModelSafeGroup group, + syncer::ModelType type, syncer::ModelSafeGroup group, ChangeProcessor* change_processor); // Deactivates change processing for the given data type. - void DeactivateDataType(syncable::ModelType type); + void DeactivateDataType(syncer::ModelType type); // Called on |frontend_loop_| to obtain a handle to the UserShare needed // for creating transactions. @@ -308,7 +306,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { MessageLoop* sync_loop; SyncBackendRegistrar* registrar; - syncer::ModelSafeRoutingInfo routing_info; + syncer::ModelSafeRoutingInfo routing_info; std::vector<syncer::ModelSafeWorker*> workers; syncer::ExtensionsActivityMonitor* extensions_activity_monitor; syncer::WeakHandle<syncer::JsEventHandler> event_handler; @@ -369,7 +367,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // The ready_task will be run when configuration is done with the // set of all types that failed configuration (i.e., if its // argument is non-empty, then an error was encountered). - base::Callback<void(syncable::ModelTypeSet)> ready_task; + base::Callback<void(syncer::ModelTypeSet)> ready_task; // The retry callback will be run when the download failed due to a // transient error. This is to notify DTM so it can apropriately inform @@ -380,10 +378,10 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // The set of types that we are waiting to be initially synced in a // configuration cycle. - syncable::ModelTypeSet types_to_add; + syncer::ModelTypeSet types_to_add; // Additional details about which types were added. - syncable::ModelTypeSet added_types; + syncer::ModelTypeSet added_types; syncer::ConfigureReason reason; bool retry_in_progress; }; @@ -441,7 +439,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // Invoked when the set of encrypted types or the encrypt // everything flag changes. void NotifyEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything); // Invoked when sync finishes encrypting new datatypes. @@ -458,7 +456,7 @@ class SyncBackendHost : public BackendDataTypeConfigurer { // part of the initialization process. void HandleNigoriConfigurationCompletedOnFrontendLoop( const syncer::WeakHandle<syncer::JsBackend>& js_backend, - syncable::ModelTypeSet failed_configuration_types); + syncer::ModelTypeSet failed_configuration_types); // Must be called on |frontend_loop_|. |done_callback| is called on // |frontend_loop_|. diff --git a/chrome/browser/sync/glue/sync_backend_host_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_unittest.cc index 8d57f25..14774a4 100644 --- a/chrome/browser/sync/glue/sync_backend_host_unittest.cc +++ b/chrome/browser/sync/glue/sync_backend_host_unittest.cc @@ -46,9 +46,9 @@ class MockSyncFrontend : public SyncFrontend { const sync_pb::EncryptedData&)); MOCK_METHOD0(OnPassphraseAccepted, void()); MOCK_METHOD2(OnEncryptedTypesChanged, - void(syncable::ModelTypeSet, bool)); + void(syncer::ModelTypeSet, bool)); MOCK_METHOD0(OnEncryptionComplete, void()); - MOCK_METHOD1(OnMigrationNeededForTypes, void(syncable::ModelTypeSet)); + MOCK_METHOD1(OnMigrationNeededForTypes, void(syncer::ModelTypeSet)); MOCK_METHOD1(OnExperimentsChanged, void(const syncer::Experiments&)); MOCK_METHOD1(OnActionableError, @@ -108,7 +108,7 @@ TEST_F(SyncBackendHostTest, InitShutdown) { backend.Initialize(&mock_frontend, syncer::WeakHandle<syncer::JsEventHandler>(), GURL(k_mock_url), - syncable::ModelTypeSet(), + syncer::ModelTypeSet(), credentials, true, &handler, diff --git a/chrome/browser/sync/glue/sync_backend_registrar.cc b/chrome/browser/sync/glue/sync_backend_registrar.cc index f36475c..d347fe8 100644 --- a/chrome/browser/sync/glue/sync_backend_registrar.cc +++ b/chrome/browser/sync/glue/sync_backend_registrar.cc @@ -53,7 +53,7 @@ bool IsOnThreadForGroup(syncer::ModelSafeGroup group) { } // namespace SyncBackendRegistrar::SyncBackendRegistrar( - syncable::ModelTypeSet initial_types, + syncer::ModelTypeSet initial_types, const std::string& name, Profile* profile, MessageLoop* sync_loop) : name_(name), @@ -73,7 +73,7 @@ SyncBackendRegistrar::SyncBackendRegistrar( // routing_info map. We set them to group passive, meaning that // updates will be applied to sync, but not dispatched to the native // models. - for (syncable::ModelTypeSet::Iterator it = initial_types.First(); + for (syncer::ModelTypeSet::Iterator it = initial_types.First(); it.Good(); it.Inc()) { routing_info_[it.Get()] = syncer::GROUP_PASSIVE; } @@ -83,9 +83,9 @@ SyncBackendRegistrar::SyncBackendRegistrar( if (history_service) { workers_[syncer::GROUP_HISTORY] = new HistoryModelWorker(history_service); } else { - LOG_IF(WARNING, initial_types.Has(syncable::TYPED_URLS)) + LOG_IF(WARNING, initial_types.Has(syncer::TYPED_URLS)) << "History store disabled, cannot sync Omnibox History"; - routing_info_.erase(syncable::TYPED_URLS); + routing_info_.erase(syncer::TYPED_URLS); } scoped_refptr<PasswordStore> password_store = @@ -93,9 +93,9 @@ SyncBackendRegistrar::SyncBackendRegistrar( if (password_store.get()) { workers_[syncer::GROUP_PASSWORD] = new PasswordModelWorker(password_store); } else { - LOG_IF(WARNING, initial_types.Has(syncable::PASSWORDS)) + LOG_IF(WARNING, initial_types.Has(syncer::PASSWORDS)) << "Password store not initialized, cannot sync passwords"; - routing_info_.erase(syncable::PASSWORDS); + routing_info_.erase(syncer::PASSWORDS); } } @@ -107,27 +107,27 @@ SyncBackendRegistrar::~SyncBackendRegistrar() { bool SyncBackendRegistrar::IsNigoriEnabled() const { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); base::AutoLock lock(lock_); - return routing_info_.find(syncable::NIGORI) != routing_info_.end(); + return routing_info_.find(syncer::NIGORI) != routing_info_.end(); } -syncable::ModelTypeSet SyncBackendRegistrar::ConfigureDataTypes( - syncable::ModelTypeSet types_to_add, - syncable::ModelTypeSet types_to_remove) { +syncer::ModelTypeSet SyncBackendRegistrar::ConfigureDataTypes( + syncer::ModelTypeSet types_to_add, + syncer::ModelTypeSet types_to_remove) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(Intersection(types_to_add, types_to_remove).Empty()); - syncable::ModelTypeSet filtered_types_to_add = types_to_add; + syncer::ModelTypeSet filtered_types_to_add = types_to_add; if (workers_.count(syncer::GROUP_HISTORY) == 0) { LOG(WARNING) << "No history worker -- removing TYPED_URLS"; - filtered_types_to_add.Remove(syncable::TYPED_URLS); + filtered_types_to_add.Remove(syncer::TYPED_URLS); } if (workers_.count(syncer::GROUP_PASSWORD) == 0) { LOG(WARNING) << "No password worker -- removing PASSWORDS"; - filtered_types_to_add.Remove(syncable::PASSWORDS); + filtered_types_to_add.Remove(syncer::PASSWORDS); } base::AutoLock lock(lock_); - syncable::ModelTypeSet newly_added_types; - for (syncable::ModelTypeSet::Iterator it = + syncer::ModelTypeSet newly_added_types; + for (syncer::ModelTypeSet::Iterator it = filtered_types_to_add.First(); it.Good(); it.Inc()) { // Add a newly specified data type as syncer::GROUP_PASSIVE into the @@ -137,18 +137,18 @@ syncable::ModelTypeSet SyncBackendRegistrar::ConfigureDataTypes( newly_added_types.Put(it.Get()); } } - for (syncable::ModelTypeSet::Iterator it = types_to_remove.First(); + for (syncer::ModelTypeSet::Iterator it = types_to_remove.First(); it.Good(); it.Inc()) { routing_info_.erase(it.Get()); } // TODO(akalin): Use SVLOG/SLOG if we add any more logging. DVLOG(1) << name_ << ": Adding types " - << syncable::ModelTypeSetToString(types_to_add) + << syncer::ModelTypeSetToString(types_to_add) << " (with newly-added types " - << syncable::ModelTypeSetToString(newly_added_types) + << syncer::ModelTypeSetToString(newly_added_types) << ") and removing types " - << syncable::ModelTypeSetToString(types_to_remove) + << syncer::ModelTypeSetToString(types_to_remove) << " to get new routing info " <<syncer::ModelSafeRoutingInfoToString(routing_info_); @@ -168,14 +168,14 @@ void SyncBackendRegistrar::OnSyncerShutdownComplete() { } void SyncBackendRegistrar::ActivateDataType( - syncable::ModelType type, + syncer::ModelType type, syncer::ModelSafeGroup group, ChangeProcessor* change_processor, syncer::UserShare* user_share) { CHECK(IsOnThreadForGroup(group)); base::AutoLock lock(lock_); // Ensure that the given data type is in the PASSIVE group. - syncer::ModelSafeRoutingInfo::iterator i = routing_info_.find(type); + syncer::ModelSafeRoutingInfo::iterator i = routing_info_.find(type); DCHECK(i != routing_info_.end()); DCHECK_EQ(i->second, syncer::GROUP_PASSIVE); routing_info_[type] = group; @@ -191,7 +191,7 @@ void SyncBackendRegistrar::ActivateDataType( DCHECK(GetProcessorUnsafe(type)); } -void SyncBackendRegistrar::DeactivateDataType(syncable::ModelType type) { +void SyncBackendRegistrar::DeactivateDataType(syncer::ModelType type) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); base::AutoLock lock(lock_); ChangeProcessor* change_processor = GetProcessorUnsafe(type); @@ -204,12 +204,12 @@ void SyncBackendRegistrar::DeactivateDataType(syncable::ModelType type) { } bool SyncBackendRegistrar::IsTypeActivatedForTest( - syncable::ModelType type) const { + syncer::ModelType type) const { return GetProcessor(type) != NULL; } void SyncBackendRegistrar::OnChangesApplied( - syncable::ModelType model_type, + syncer::ModelType model_type, const syncer::BaseTransaction* trans, const syncer::ImmutableChangeRecordList& changes) { ChangeProcessor* processor = GetProcessor(model_type); @@ -219,8 +219,7 @@ void SyncBackendRegistrar::OnChangesApplied( processor->ApplyChangesFromSyncModel(trans, changes); } -void SyncBackendRegistrar::OnChangesComplete( - syncable::ModelType model_type) { +void SyncBackendRegistrar::OnChangesComplete(syncer::ModelType model_type) { ChangeProcessor* processor = GetProcessor(model_type); if (!processor) return; @@ -242,14 +241,14 @@ void SyncBackendRegistrar::GetWorkers( } void SyncBackendRegistrar::GetModelSafeRoutingInfo( - syncer::ModelSafeRoutingInfo* out) { + syncer::ModelSafeRoutingInfo* out) { base::AutoLock lock(lock_); - syncer::ModelSafeRoutingInfo copy(routing_info_); + syncer::ModelSafeRoutingInfo copy(routing_info_); out->swap(copy); } ChangeProcessor* SyncBackendRegistrar::GetProcessor( - syncable::ModelType type) const { + syncer::ModelType type) const { base::AutoLock lock(lock_); ChangeProcessor* processor = GetProcessorUnsafe(type); if (!processor) @@ -263,9 +262,9 @@ ChangeProcessor* SyncBackendRegistrar::GetProcessor( } ChangeProcessor* SyncBackendRegistrar::GetProcessorUnsafe( - syncable::ModelType type) const { + syncer::ModelType type) const { lock_.AssertAcquired(); - std::map<syncable::ModelType, ChangeProcessor*>::const_iterator it = + std::map<syncer::ModelType, ChangeProcessor*>::const_iterator it = processors_.find(type); // Until model association happens for a datatype, it will not @@ -281,7 +280,7 @@ ChangeProcessor* SyncBackendRegistrar::GetProcessorUnsafe( } bool SyncBackendRegistrar::IsCurrentThreadSafeForModel( - syncable::ModelType model_type) const { + syncer::ModelType model_type) const { lock_.AssertAcquired(); return IsOnThreadForGroup(GetGroupForModelType(model_type, routing_info_)); } diff --git a/chrome/browser/sync/glue/sync_backend_registrar.h b/chrome/browser/sync/glue/sync_backend_registrar.h index 6b966d9..3ffef33 100644 --- a/chrome/browser/sync/glue/sync_backend_registrar.h +++ b/chrome/browser/sync/glue/sync_backend_registrar.h @@ -38,7 +38,7 @@ class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate { // (initially put in the passive group). |name| is used for // debugging. Does not take ownership of |profile| or |sync_loop|. // Must be created on the UI thread. - SyncBackendRegistrar(syncable::ModelTypeSet initial_types, + SyncBackendRegistrar(syncer::ModelTypeSet initial_types, const std::string& name, Profile* profile, MessageLoop* sync_loop); @@ -65,9 +65,9 @@ class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate { // not already there (initially put in the passive group). // |types_to_remove| and |types_to_add| must be disjoint. Returns // the set of newly-added types. Must be called on the UI thread. - syncable::ModelTypeSet ConfigureDataTypes( - syncable::ModelTypeSet types_to_add, - syncable::ModelTypeSet types_to_remove); + syncer::ModelTypeSet ConfigureDataTypes( + syncer::ModelTypeSet types_to_add, + syncer::ModelTypeSet types_to_remove); // Must be called from the UI thread. (See destructor comment.) void StopOnUIThread(); @@ -78,7 +78,7 @@ class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate { // Activates the given data type (which should belong to the given // group) and starts the given change processor. Must be called // from |group|'s native thread. - void ActivateDataType(syncable::ModelType type, + void ActivateDataType(syncer::ModelType type, syncer::ModelSafeGroup group, ChangeProcessor* change_processor, syncer::UserShare* user_share); @@ -86,19 +86,19 @@ class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate { // Deactivates the given type if necessary. Must be called from the // UI thread and not |type|'s native thread. Yes, this is // surprising: see http://crbug.com/92804. - void DeactivateDataType(syncable::ModelType type); + void DeactivateDataType(syncer::ModelType type); // Returns true only between calls to ActivateDataType(type, ...) // and DeactivateDataType(type). Used only by tests. - bool IsTypeActivatedForTest(syncable::ModelType type) const; + bool IsTypeActivatedForTest(syncer::ModelType type) const; // SyncManager::ChangeDelegate implementation. May be called from // any thread. virtual void OnChangesApplied( - syncable::ModelType model_type, + syncer::ModelType model_type, const syncer::BaseTransaction* trans, const syncer::ImmutableChangeRecordList& changes) OVERRIDE; - virtual void OnChangesComplete(syncable::ModelType model_type) OVERRIDE; + virtual void OnChangesComplete(syncer::ModelType model_type) OVERRIDE; void GetWorkers(std::vector<syncer::ModelSafeWorker*>* out); void GetModelSafeRoutingInfo(syncer::ModelSafeRoutingInfo* out); @@ -109,17 +109,17 @@ class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate { // Returns the change processor for the given model, or NULL if none // exists. Must be called from |group|'s native thread. - ChangeProcessor* GetProcessor(syncable::ModelType type) const; + ChangeProcessor* GetProcessor(syncer::ModelType type) const; // Must be called with |lock_| held. Simply returns the change // processor for the given type, if it exists. May be called from // any thread. - ChangeProcessor* GetProcessorUnsafe(syncable::ModelType type) const; + ChangeProcessor* GetProcessorUnsafe(syncer::ModelType type) const; // Return true if |model_type| lives on the current thread. Must be // called with |lock_| held. May be called on any thread. bool IsCurrentThreadSafeForModel( - syncable::ModelType model_type) const; + syncer::ModelType model_type) const; // Name used for debugging. const std::string name_; @@ -146,10 +146,10 @@ class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate { // If a key is present, it means at least one ModelType that routes // to that model safe group is being synced. WorkerMap workers_; - syncer::ModelSafeRoutingInfo routing_info_; + syncer::ModelSafeRoutingInfo routing_info_; // The change processors that handle the different data types. - std::map<syncable::ModelType, ChangeProcessor*> processors_; + std::map<syncer::ModelType, ChangeProcessor*> processors_; DISALLOW_COPY_AND_ASSIGN(SyncBackendRegistrar); }; diff --git a/chrome/browser/sync/glue/sync_backend_registrar_unittest.cc b/chrome/browser/sync/glue/sync_backend_registrar_unittest.cc index cd96d24..1950ed9 100644 --- a/chrome/browser/sync/glue/sync_backend_registrar_unittest.cc +++ b/chrome/browser/sync/glue/sync_backend_registrar_unittest.cc @@ -22,17 +22,17 @@ using ::testing::InSequence; using ::testing::Return; using ::testing::StrictMock; using content::BrowserThread; -using syncable::FIRST_REAL_MODEL_TYPE; -using syncable::AUTOFILL; -using syncable::BOOKMARKS; -using syncable::PREFERENCES; -using syncable::THEMES; -using syncable::NIGORI; -using syncable::PASSWORDS; -using syncable::MODEL_TYPE_COUNT; -using syncable::ModelTypeSet; -using syncable::ModelType; -using syncable::ModelTypeFromInt; +using syncer::FIRST_REAL_MODEL_TYPE; +using syncer::AUTOFILL; +using syncer::BOOKMARKS; +using syncer::PREFERENCES; +using syncer::THEMES; +using syncer::NIGORI; +using syncer::PASSWORDS; +using syncer::MODEL_TYPE_COUNT; +using syncer::ModelTypeSet; +using syncer::ModelType; +using syncer::ModelTypeFromInt; class SyncBackendRegistrarTest : public testing::Test { protected: diff --git a/chrome/browser/sync/glue/theme_change_processor.cc b/chrome/browser/sync/glue/theme_change_processor.cc index d975af1..1de4a0f 100644 --- a/chrome/browser/sync/glue/theme_change_processor.cc +++ b/chrome/browser/sync/glue/theme_change_processor.cc @@ -43,7 +43,7 @@ void ThemeChangeProcessor::Observe( syncer::WriteTransaction trans(FROM_HERE, share_handle()); syncer::WriteNode node(&trans); - if (node.InitByClientTagLookup(syncable::THEMES, + if (node.InitByClientTagLookup(syncer::THEMES, kCurrentThemeClientTag) != syncer::BaseNode::INIT_OK) { std::string err = "Could not create node with client tag: "; @@ -105,7 +105,7 @@ void ThemeChangeProcessor::ApplyChangesFromSyncModel( "Theme node lookup failed."); return; } - DCHECK_EQ(node.GetModelType(), syncable::THEMES); + DCHECK_EQ(node.GetModelType(), syncer::THEMES); DCHECK(profile_); theme_specifics = node.GetThemeSpecifics(); } diff --git a/chrome/browser/sync/glue/theme_data_type_controller.cc b/chrome/browser/sync/glue/theme_data_type_controller.cc index 9c6ecc1..a89324c 100644 --- a/chrome/browser/sync/glue/theme_data_type_controller.cc +++ b/chrome/browser/sync/glue/theme_data_type_controller.cc @@ -20,8 +20,8 @@ ThemeDataTypeController::ThemeDataTypeController( sync_service) { } -syncable::ModelType ThemeDataTypeController::type() const { - return syncable::THEMES; +syncer::ModelType ThemeDataTypeController::type() const { + return syncer::THEMES; } ThemeDataTypeController::~ThemeDataTypeController() {} diff --git a/chrome/browser/sync/glue/theme_data_type_controller.h b/chrome/browser/sync/glue/theme_data_type_controller.h index 1a3d430..1f176b1 100644 --- a/chrome/browser/sync/glue/theme_data_type_controller.h +++ b/chrome/browser/sync/glue/theme_data_type_controller.h @@ -21,7 +21,7 @@ class ThemeDataTypeController : public FrontendDataTypeController { ProfileSyncService* sync_service); // DataTypeController implementation. - virtual syncable::ModelType type() const OVERRIDE; + virtual syncer::ModelType type() const OVERRIDE; private: virtual ~ThemeDataTypeController(); diff --git a/chrome/browser/sync/glue/theme_data_type_controller_unittest.cc b/chrome/browser/sync/glue/theme_data_type_controller_unittest.cc index 5fa09a9..ec5f4b6b 100644 --- a/chrome/browser/sync/glue/theme_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/theme_data_type_controller_unittest.cc @@ -133,7 +133,7 @@ TEST_F(SyncThemeDataTypeControllerTest, StartAssociationFailed) { SetAssociateExpectations(); EXPECT_CALL(*model_associator_, AssociateModels()). WillRepeatedly( - Return(syncer::SyncError(FROM_HERE, "Error", syncable::THEMES))); + Return(syncer::SyncError(FROM_HERE, "Error", syncer::THEMES))); EXPECT_CALL(start_callback_, Run(DataTypeController::ASSOCIATION_FAILED, _)); diff --git a/chrome/browser/sync/glue/theme_model_associator.cc b/chrome/browser/sync/glue/theme_model_associator.cc index e1210db..2c6dd3c 100644 --- a/chrome/browser/sync/glue/theme_model_associator.cc +++ b/chrome/browser/sync/glue/theme_model_associator.cc @@ -55,7 +55,7 @@ syncer::SyncError ThemeModelAssociator::AssociateModels() { // TODO(akalin): When we have timestamps, we may want to do // something more intelligent than preferring the sync data over our // local data. - if (node.InitByClientTagLookup(syncable::THEMES, kCurrentThemeClientTag) == + if (node.InitByClientTagLookup(syncer::THEMES, kCurrentThemeClientTag) == syncer::BaseNode::INIT_OK) { // Update the current theme from the sync data. // TODO(akalin): If the sync data does not have @@ -69,7 +69,7 @@ syncer::SyncError ThemeModelAssociator::AssociateModels() { // Set the sync data from the current theme. syncer::WriteNode node(&trans); syncer::WriteNode::InitUniqueByCreationResult result = - node.InitUniqueByCreation(syncable::THEMES, root, + node.InitUniqueByCreation(syncer::THEMES, root, kCurrentThemeClientTag); if (result != syncer::WriteNode::INIT_SUCCESS) { return error_handler_->CreateAndUploadError( @@ -109,9 +109,9 @@ bool ThemeModelAssociator::SyncModelHasUserCreatedNodes(bool* has_nodes) { bool ThemeModelAssociator::CryptoReadyIfNecessary() { // We only access the cryptographer while holding a transaction. syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); - const syncable::ModelTypeSet encrypted_types = + const syncer::ModelTypeSet encrypted_types = syncer::GetEncryptedTypes(&trans); - return !encrypted_types.Has(syncable::THEMES) || + return !encrypted_types.Has(syncer::THEMES) || sync_service_->IsCryptographerReady(&trans); } diff --git a/chrome/browser/sync/glue/theme_model_associator.h b/chrome/browser/sync/glue/theme_model_associator.h index 49868f4..0bb14bc 100644 --- a/chrome/browser/sync/glue/theme_model_associator.h +++ b/chrome/browser/sync/glue/theme_model_associator.h @@ -25,7 +25,7 @@ class ThemeModelAssociator : public AssociatorInterface { virtual ~ThemeModelAssociator(); // Used by profile_sync_test_util.h. - static syncable::ModelType model_type() { return syncable::THEMES; } + static syncer::ModelType model_type() { return syncer::THEMES; } // AssociatorInterface implementation. virtual syncer::SyncError AssociateModels() OVERRIDE; diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc index c96903f..1aa158b 100644 --- a/chrome/browser/sync/glue/typed_url_change_processor.cc +++ b/chrome/browser/sync/glue/typed_url_change_processor.cc @@ -127,18 +127,18 @@ bool TypedUrlChangeProcessor::CreateOrUpdateSyncNode( syncer::WriteNode update_node(trans); syncer::BaseNode::InitByLookupResult result = - update_node.InitByClientTagLookup(syncable::TYPED_URLS, tag); + update_node.InitByClientTagLookup(syncer::TYPED_URLS, tag); if (result == syncer::BaseNode::INIT_OK) { model_associator_->WriteToSyncNode(url, visit_vector, &update_node); } else if (result == syncer::BaseNode::INIT_FAILED_DECRYPT_IF_NECESSARY) { // TODO(tim): Investigating bug 121587. syncer::Cryptographer* crypto = trans->GetCryptographer(); - syncable::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes()); + syncer::ModelTypeSet encrypted_types(crypto->GetEncryptedTypes()); const sync_pb::EntitySpecifics& specifics = update_node.GetEntry()->Get(syncer::syncable::SPECIFICS); CHECK(specifics.has_encrypted()); const bool can_decrypt = crypto->CanDecrypt(specifics.encrypted()); - const bool agreement = encrypted_types.Has(syncable::TYPED_URLS); + const bool agreement = encrypted_types.Has(syncer::TYPED_URLS); if (!agreement && !can_decrypt) { error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE, "Could not InitByIdLookup in CreateOrUpdateSyncNode, " @@ -167,7 +167,7 @@ bool TypedUrlChangeProcessor::CreateOrUpdateSyncNode( } else { syncer::WriteNode create_node(trans); syncer::WriteNode::InitUniqueByCreationResult result = - create_node.InitUniqueByCreation(syncable::TYPED_URLS, + create_node.InitUniqueByCreation(syncer::TYPED_URLS, typed_url_root, tag); if (result != syncer::WriteNode::INIT_SUCCESS) { error_handler()->OnSingleDatatypeUnrecoverableError(FROM_HERE, @@ -205,7 +205,7 @@ void TypedUrlChangeProcessor::HandleURLsDeleted( syncer::WriteNode sync_node(&trans); // The deleted URL could have been non-typed, so it might not be found // in the sync DB. - if (sync_node.InitByClientTagLookup(syncable::TYPED_URLS, + if (sync_node.InitByClientTagLookup(syncer::TYPED_URLS, row->url().spec()) == syncer::BaseNode::INIT_OK) { sync_node.Remove(); @@ -281,7 +281,7 @@ void TypedUrlChangeProcessor::ApplyChangesFromSyncModel( // Check that the changed node is a child of the typed_urls folder. DCHECK(typed_url_root.GetId() == sync_node.GetParentId()); - DCHECK(syncable::TYPED_URLS == sync_node.GetModelType()); + DCHECK(syncer::TYPED_URLS == sync_node.GetModelType()); const sync_pb::TypedUrlSpecifics& typed_url( sync_node.GetTypedUrlSpecifics()); diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.cc b/chrome/browser/sync/glue/typed_url_data_type_controller.cc index dc46aba..91741fc 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.cc +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.cc @@ -72,8 +72,8 @@ TypedUrlDataTypeController::TypedUrlDataTypeController( pref_registrar_.Add(prefs::kSavingBrowserHistoryDisabled, this); } -syncable::ModelType TypedUrlDataTypeController::type() const { - return syncable::TYPED_URLS; +syncer::ModelType TypedUrlDataTypeController::type() const { + return syncer::TYPED_URLS; } syncer::ModelSafeGroup TypedUrlDataTypeController::model_safe_group() @@ -101,7 +101,7 @@ void TypedUrlDataTypeController::Observe( // generate an unrecoverable error. This can be fixed by restarting // Chrome (on restart, typed urls will not be a registered type). if (state() != NOT_RUNNING && state() != STOPPING) { - profile_sync_service()->DisableBrokenDatatype(syncable::TYPED_URLS, + profile_sync_service()->DisableBrokenDatatype(syncer::TYPED_URLS, FROM_HERE, "History saving is now disabled by policy."); } } diff --git a/chrome/browser/sync/glue/typed_url_data_type_controller.h b/chrome/browser/sync/glue/typed_url_data_type_controller.h index 01a1bdc..b18aa4e 100644 --- a/chrome/browser/sync/glue/typed_url_data_type_controller.h +++ b/chrome/browser/sync/glue/typed_url_data_type_controller.h @@ -37,7 +37,7 @@ class TypedUrlDataTypeController : public NonFrontendDataTypeController, ProfileSyncService* sync_service); // NonFrontendDataTypeController implementation - virtual syncable::ModelType type() const OVERRIDE; + virtual syncer::ModelType type() const OVERRIDE; virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE; // content::NotificationObserver implementation. diff --git a/chrome/browser/sync/glue/typed_url_model_associator.cc b/chrome/browser/sync/glue/typed_url_model_associator.cc index d05c8d6..a87a52b 100644 --- a/chrome/browser/sync/glue/typed_url_model_associator.cc +++ b/chrome/browser/sync/glue/typed_url_model_associator.cc @@ -216,7 +216,7 @@ syncer::SyncError TypedUrlModelAssociator::DoAssociateModels() { history::VisitVector& visits = visit_vectors[ix->id()]; syncer::ReadNode node(&trans); - if (node.InitByClientTagLookup(syncable::TYPED_URLS, tag) == + if (node.InitByClientTagLookup(syncer::TYPED_URLS, tag) == syncer::BaseNode::INIT_OK) { // Same URL exists in sync data and in history data - compare the // entries to see if there's any difference. @@ -236,7 +236,7 @@ syncer::SyncError TypedUrlModelAssociator::DoAssociateModels() { MergeUrls(typed_url, *ix, &visits, &new_url, &added_visits); if (difference & DIFF_UPDATE_NODE) { syncer::WriteNode write_node(&trans); - if (write_node.InitByClientTagLookup(syncable::TYPED_URLS, tag) != + if (write_node.InitByClientTagLookup(syncer::TYPED_URLS, tag) != syncer::BaseNode::INIT_OK) { return error_handler_->CreateAndUploadError( FROM_HERE, @@ -274,7 +274,7 @@ syncer::SyncError TypedUrlModelAssociator::DoAssociateModels() { // Sync has never seen this URL before. syncer::WriteNode node(&trans); syncer::WriteNode::InitUniqueByCreationResult result = - node.InitUniqueByCreation(syncable::TYPED_URLS, + node.InitUniqueByCreation(syncer::TYPED_URLS, typed_url_root, tag); if (result != syncer::WriteNode::INIT_SUCCESS) { return error_handler_->CreateAndUploadError( @@ -822,9 +822,9 @@ void TypedUrlModelAssociator::UpdateURLRowFromTypedUrlSpecifics( bool TypedUrlModelAssociator::CryptoReadyIfNecessary() { // We only access the cryptographer while holding a transaction. syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); - const syncable::ModelTypeSet encrypted_types = + const syncer::ModelTypeSet encrypted_types = syncer::GetEncryptedTypes(&trans); - return !encrypted_types.Has(syncable::TYPED_URLS) || + return !encrypted_types.Has(syncer::TYPED_URLS) || sync_service_->IsCryptographerReady(&trans); } diff --git a/chrome/browser/sync/glue/typed_url_model_associator.h b/chrome/browser/sync/glue/typed_url_model_associator.h index 66cfc84..e8b0725 100644 --- a/chrome/browser/sync/glue/typed_url_model_associator.h +++ b/chrome/browser/sync/glue/typed_url_model_associator.h @@ -49,7 +49,7 @@ class TypedUrlModelAssociator : public AssociatorInterface { typedef std::vector<std::pair<GURL, std::vector<history::VisitInfo> > > TypedUrlVisitVector; - static syncable::ModelType model_type() { return syncable::TYPED_URLS; } + static syncer::ModelType model_type() { return syncer::TYPED_URLS; } TypedUrlModelAssociator(ProfileSyncService* sync_service, history::HistoryBackend* history_backend, DataTypeErrorHandler* error_handler); diff --git a/chrome/browser/sync/glue/ui_data_type_controller.cc b/chrome/browser/sync/glue/ui_data_type_controller.cc index 6103f86..0b5f755 100644 --- a/chrome/browser/sync/glue/ui_data_type_controller.cc +++ b/chrome/browser/sync/glue/ui_data_type_controller.cc @@ -24,11 +24,11 @@ UIDataTypeController::UIDataTypeController() profile_(NULL), sync_service_(NULL), state_(NOT_RUNNING), - type_(syncable::UNSPECIFIED) { + type_(syncer::UNSPECIFIED) { } UIDataTypeController::UIDataTypeController( - syncable::ModelType type, + syncer::ModelType type, ProfileSyncComponentsFactory* profile_sync_factory, Profile* profile, ProfileSyncService* sync_service) @@ -41,7 +41,7 @@ UIDataTypeController::UIDataTypeController( DCHECK(profile_sync_factory); DCHECK(profile); DCHECK(sync_service); - DCHECK(syncable::IsRealDataType(type_)); + DCHECK(syncer::IsRealDataType(type_)); } UIDataTypeController::~UIDataTypeController() { @@ -52,7 +52,7 @@ void UIDataTypeController::LoadModels( const ModelLoadCallback& model_load_callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(!model_load_callback.is_null()); - DCHECK(syncable::IsRealDataType(type_)); + DCHECK(syncer::IsRealDataType(type_)); if (state_ != NOT_RUNNING) { model_load_callback.Run(type(), syncer::SyncError(FROM_HERE, "Model already loaded", @@ -224,7 +224,7 @@ void UIDataTypeController::StartDone(StartResult result) { void UIDataTypeController::Stop() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - DCHECK(syncable::IsRealDataType(type_)); + DCHECK(syncer::IsRealDataType(type_)); State prev_state = state_; state_ = STOPPING; @@ -255,8 +255,8 @@ void UIDataTypeController::Stop() { state_ = NOT_RUNNING; } -syncable::ModelType UIDataTypeController::type() const { - DCHECK(syncable::IsRealDataType(type_)); +syncer::ModelType UIDataTypeController::type() const { + DCHECK(syncer::IsRealDataType(type_)); return type_; } @@ -265,13 +265,13 @@ void UIDataTypeController::StopModels() { } syncer::ModelSafeGroup UIDataTypeController::model_safe_group() const { - DCHECK(syncable::IsRealDataType(type_)); + DCHECK(syncer::IsRealDataType(type_)); return syncer::GROUP_UI; } std::string UIDataTypeController::name() const { // For logging only. - return syncable::ModelTypeToString(type()); + return syncer::ModelTypeToString(type()); } DataTypeController::State UIDataTypeController::state() const { @@ -295,7 +295,7 @@ void UIDataTypeController::RecordAssociationTime(base::TimeDelta time) { void UIDataTypeController::RecordStartFailure(StartResult result) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeStartFailures", type(), - syncable::MODEL_TYPE_COUNT); + syncer::MODEL_TYPE_COUNT); #define PER_DATA_TYPE_MACRO(type_str) \ UMA_HISTOGRAM_ENUMERATION("Sync." type_str "StartFailure", result, \ MAX_START_RESULT); diff --git a/chrome/browser/sync/glue/ui_data_type_controller.h b/chrome/browser/sync/glue/ui_data_type_controller.h index 9bbc753..b237f54 100644 --- a/chrome/browser/sync/glue/ui_data_type_controller.h +++ b/chrome/browser/sync/glue/ui_data_type_controller.h @@ -37,7 +37,7 @@ namespace browser_sync { class UIDataTypeController : public DataTypeController { public: UIDataTypeController( - syncable::ModelType type, + syncer::ModelType type, ProfileSyncComponentsFactory* profile_sync_factory, Profile* profile, ProfileSyncService* sync_service); @@ -47,7 +47,7 @@ class UIDataTypeController : public DataTypeController { const ModelLoadCallback& model_load_callback) OVERRIDE; virtual void StartAssociating(const StartCallback& start_callback) OVERRIDE; virtual void Stop() OVERRIDE; - virtual syncable::ModelType type() const OVERRIDE; + virtual syncer::ModelType type() const OVERRIDE; virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE; virtual std::string name() const OVERRIDE; virtual State state() const OVERRIDE; @@ -97,7 +97,7 @@ class UIDataTypeController : public DataTypeController { ModelLoadCallback model_load_callback_; // The sync datatype being controlled. - syncable::ModelType type_; + syncer::ModelType type_; // Sync's interface to the datatype. All sync changes for |type_| are pushed // through it to the datatype as well as vice versa. diff --git a/chrome/browser/sync/glue/ui_data_type_controller_unittest.cc b/chrome/browser/sync/glue/ui_data_type_controller_unittest.cc index e62be2d..042c72f 100644 --- a/chrome/browser/sync/glue/ui_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/ui_data_type_controller_unittest.cc @@ -41,7 +41,7 @@ class SyncUIDataTypeControllerTest : public testing::Test { public: SyncUIDataTypeControllerTest() : ui_thread_(BrowserThread::UI, &message_loop_), - type_(syncable::PREFERENCES), + type_(syncer::PREFERENCES), change_processor_(new FakeGenericChangeProcessor()) {} virtual void SetUp() { @@ -100,7 +100,7 @@ class SyncUIDataTypeControllerTest : public testing::Test { ProfileMock profile_; scoped_ptr<ProfileSyncComponentsFactoryMock> profile_sync_factory_; ProfileSyncServiceMock profile_sync_service_; - const syncable::ModelType type_; + const syncer::ModelType type_; StartCallbackMock start_callback_; ModelLoadCallbackMock model_load_callback_; scoped_refptr<UIDataTypeController> preference_dtc_; diff --git a/chrome/browser/sync/invalidations/invalidator_storage.cc b/chrome/browser/sync/invalidations/invalidator_storage.cc index 4f9ca5b..3546d9c 100644 --- a/chrome/browser/sync/invalidations/invalidator_storage.cc +++ b/chrome/browser/sync/invalidations/invalidator_storage.cc @@ -186,19 +186,19 @@ void InvalidatorStorage::DeserializeMap( LOG(WARNING) << "Invalid model type key: " << *it; continue; } - if ((model_type_int < syncable::FIRST_REAL_MODEL_TYPE) || - (model_type_int >= syncable::MODEL_TYPE_COUNT)) { + if ((model_type_int < syncer::FIRST_REAL_MODEL_TYPE) || + (model_type_int >= syncer::MODEL_TYPE_COUNT)) { LOG(WARNING) << "Out-of-range model type key: " << model_type_int; continue; } - const syncable::ModelType model_type = - syncable::ModelTypeFromInt(model_type_int); + const syncer::ModelType model_type = + syncer::ModelTypeFromInt(model_type_int); std::string max_version_str; CHECK(max_versions_dict->GetString(*it, &max_version_str)); int64 max_version = 0; if (!base::StringToInt64(max_version_str, &max_version)) { LOG(WARNING) << "Invalid max invalidation version for " - << syncable::ModelTypeToString(model_type) << ": " + << syncer::ModelTypeToString(model_type) << ": " << max_version_str; continue; } diff --git a/chrome/browser/sync/invalidations/invalidator_storage_unittest.cc b/chrome/browser/sync/invalidations/invalidator_storage_unittest.cc index d71930b..0c8202f 100644 --- a/chrome/browser/sync/invalidations/invalidator_storage_unittest.cc +++ b/chrome/browser/sync/invalidations/invalidator_storage_unittest.cc @@ -237,9 +237,9 @@ TEST_F(InvalidatorStorageTest, DeserializeMapOutOfRange) { base::DictionaryValue dict_with_out_of_range_type; dict_with_out_of_range_type.SetString( - base::IntToString(syncable::TOP_LEVEL_FOLDER), "100"); + base::IntToString(syncer::TOP_LEVEL_FOLDER), "100"); dict_with_out_of_range_type.SetString( - base::IntToString(syncable::BOOKMARKS), "5"); + base::IntToString(syncer::BOOKMARKS), "5"); InvalidatorStorage::DeserializeMap(&dict_with_out_of_range_type, &map); @@ -254,9 +254,9 @@ TEST_F(InvalidatorStorageTest, DeserializeMapInvalidFormat) { dict_with_invalid_format.SetString("whoops", "5"); dict_with_invalid_format.SetString("ohnoes", "whoops"); dict_with_invalid_format.SetString( - base::IntToString(syncable::BOOKMARKS), "ohnoes"); + base::IntToString(syncer::BOOKMARKS), "ohnoes"); dict_with_invalid_format.SetString( - base::IntToString(syncable::AUTOFILL), "10"); + base::IntToString(syncer::AUTOFILL), "10"); InvalidatorStorage::DeserializeMap(&dict_with_invalid_format, &map); @@ -275,8 +275,8 @@ TEST_F(InvalidatorStorageTest, DeserializeMapBasic) { InvalidationVersionMap map; base::DictionaryValue dict; - dict.SetString(base::IntToString(syncable::AUTOFILL), "10"); - dict.SetString(base::IntToString(syncable::BOOKMARKS), "15"); + dict.SetString(base::IntToString(syncer::AUTOFILL), "10"); + dict.SetString(base::IntToString(syncer::BOOKMARKS), "15"); InvalidatorStorage::DeserializeMap(&dict, &map); EXPECT_EQ(2U, map.size()); @@ -288,9 +288,9 @@ TEST_F(InvalidatorStorageTest, DeserializeMapBasic) { // Migration should happen on construction of InvalidatorStorage. TEST_F(InvalidatorStorageTest, MigrateLegacyPreferences) { base::DictionaryValue* legacy_dict = new DictionaryValue; - legacy_dict->SetString(base::IntToString(syncable::AUTOFILL), "10"); - legacy_dict->SetString(base::IntToString(syncable::BOOKMARKS), "32"); - legacy_dict->SetString(base::IntToString(syncable::PREFERENCES), "54"); + legacy_dict->SetString(base::IntToString(syncer::AUTOFILL), "10"); + legacy_dict->SetString(base::IntToString(syncer::BOOKMARKS), "32"); + legacy_dict->SetString(base::IntToString(syncer::PREFERENCES), "54"); pref_service_.SetUserPref(prefs::kSyncMaxInvalidationVersions, legacy_dict); InvalidatorStorage storage(&pref_service_); diff --git a/chrome/browser/sync/profile_sync_components_factory.h b/chrome/browser/sync/profile_sync_components_factory.h index bba73b0..0eb8218 100644 --- a/chrome/browser/sync/profile_sync_components_factory.h +++ b/chrome/browser/sync/profile_sync_components_factory.h @@ -85,7 +85,7 @@ class ProfileSyncComponentsFactory { // Weak pointer may be unset if service is already destroyed. // Note: Should only be called on the same thread on which a datatype resides. virtual base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( - syncable::ModelType type) = 0; + syncer::ModelType type) = 0; // Legacy datatypes that need to be converted to the SyncableService API. virtual SyncComponents CreateBookmarkSyncComponents( diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc index 7f10696..6a080a2 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl.cc +++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc @@ -102,7 +102,7 @@ void ProfileSyncComponentsFactoryImpl::RegisterDataTypes( // disabled. if (!command_line_->HasSwitch(switches::kDisableSyncApps)) { pss->RegisterDataTypeController( - new ExtensionDataTypeController(syncable::APPS, this, profile_, pss)); + new ExtensionDataTypeController(syncer::APPS, this, profile_, pss)); } // Autofill sync is enabled by default. Register unless explicitly @@ -123,7 +123,7 @@ void ProfileSyncComponentsFactoryImpl::RegisterDataTypes( // disabled. if (!command_line_->HasSwitch(switches::kDisableSyncExtensions)) { pss->RegisterDataTypeController( - new ExtensionDataTypeController(syncable::EXTENSIONS, + new ExtensionDataTypeController(syncer::EXTENSIONS, this, profile_, pss)); } @@ -138,7 +138,7 @@ void ProfileSyncComponentsFactoryImpl::RegisterDataTypes( // disabled. if (!command_line_->HasSwitch(switches::kDisableSyncPreferences)) { pss->RegisterDataTypeController( - new UIDataTypeController(syncable::PREFERENCES, this, profile_, pss)); + new UIDataTypeController(syncer::PREFERENCES, this, profile_, pss)); } #if defined(ENABLE_THEMES) @@ -175,7 +175,7 @@ void ProfileSyncComponentsFactoryImpl::RegisterDataTypes( if (!command_line_->HasSwitch(switches::kDisableSyncExtensionSettings)) { pss->RegisterDataTypeController( new ExtensionSettingDataTypeController( - syncable::EXTENSION_SETTINGS, this, profile_, pss)); + syncer::EXTENSION_SETTINGS, this, profile_, pss)); } // App setting sync is enabled by default. Register unless explicitly @@ -183,7 +183,7 @@ void ProfileSyncComponentsFactoryImpl::RegisterDataTypes( if (!command_line_->HasSwitch(switches::kDisableSyncAppSettings)) { pss->RegisterDataTypeController( new ExtensionSettingDataTypeController( - syncable::APP_SETTINGS, this, profile_, pss)); + syncer::APP_SETTINGS, this, profile_, pss)); } if (!command_line_->HasSwitch(switches::kDisableSyncAutofillProfile)) { @@ -222,34 +222,34 @@ browser_sync::SharedChangeProcessor* ProfileSyncComponentsFactoryImpl:: } base::WeakPtr<syncer::SyncableService> ProfileSyncComponentsFactoryImpl:: - GetSyncableServiceForType(syncable::ModelType type) { + GetSyncableServiceForType(syncer::ModelType type) { if (!profile_) { // For tests. return base::WeakPtr<syncer::SyncableService>(); } switch (type) { - case syncable::PREFERENCES: + case syncer::PREFERENCES: return profile_->GetPrefs()->GetSyncableService()->AsWeakPtr(); - case syncable::AUTOFILL: - case syncable::AUTOFILL_PROFILE: { + case syncer::AUTOFILL: + case syncer::AUTOFILL_PROFILE: { if (!web_data_service_.get()) return base::WeakPtr<syncer::SyncableService>(); - if (type == syncable::AUTOFILL) { + if (type == syncer::AUTOFILL) { return web_data_service_->GetAutocompleteSyncableService()->AsWeakPtr(); } else { return web_data_service_-> GetAutofillProfileSyncableService()->AsWeakPtr(); } } - case syncable::APPS: - case syncable::EXTENSIONS: + case syncer::APPS: + case syncer::EXTENSIONS: return extension_system_->extension_service()->AsWeakPtr(); - case syncable::SEARCH_ENGINES: + case syncer::SEARCH_ENGINES: return TemplateURLServiceFactory::GetForProfile(profile_)->AsWeakPtr(); - case syncable::APP_SETTINGS: - case syncable::EXTENSION_SETTINGS: + case syncer::APP_SETTINGS: + case syncer::EXTENSION_SETTINGS: return extension_system_->extension_service()->settings_frontend()-> GetBackendForSync(type)->AsWeakPtr(); - case syncable::APP_NOTIFICATIONS: + case syncer::APP_NOTIFICATIONS: return extension_system_->extension_service()-> app_notification_manager()->AsWeakPtr(); default: diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.h b/chrome/browser/sync/profile_sync_components_factory_impl.h index 841ad17..8a78290 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl.h +++ b/chrome/browser/sync/profile_sync_components_factory_impl.h @@ -38,7 +38,7 @@ class ProfileSyncComponentsFactoryImpl : public ProfileSyncComponentsFactory { CreateSharedChangeProcessor() OVERRIDE; virtual base::WeakPtr<syncer::SyncableService> GetSyncableServiceForType( - syncable::ModelType type) OVERRIDE; + syncer::ModelType type) OVERRIDE; // Legacy datatypes that need to be converted to the SyncableService API. virtual SyncComponents CreateBookmarkSyncComponents( diff --git a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc index 5a0ca87..0447108 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc +++ b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc @@ -31,22 +31,22 @@ class ProfileSyncComponentsFactoryImplTest : public testing::Test { } // Returns the collection of default datatypes. - static std::vector<syncable::ModelType> DefaultDatatypes() { - std::vector<syncable::ModelType> datatypes; - datatypes.push_back(syncable::APPS); - datatypes.push_back(syncable::APP_NOTIFICATIONS); - datatypes.push_back(syncable::APP_SETTINGS); - datatypes.push_back(syncable::AUTOFILL); - datatypes.push_back(syncable::AUTOFILL_PROFILE); - datatypes.push_back(syncable::BOOKMARKS); - datatypes.push_back(syncable::EXTENSIONS); - datatypes.push_back(syncable::EXTENSION_SETTINGS); - datatypes.push_back(syncable::PASSWORDS); - datatypes.push_back(syncable::PREFERENCES); - datatypes.push_back(syncable::SEARCH_ENGINES); - datatypes.push_back(syncable::SESSIONS); - datatypes.push_back(syncable::THEMES); - datatypes.push_back(syncable::TYPED_URLS); + static std::vector<syncer::ModelType> DefaultDatatypes() { + std::vector<syncer::ModelType> datatypes; + datatypes.push_back(syncer::APPS); + datatypes.push_back(syncer::APP_NOTIFICATIONS); + datatypes.push_back(syncer::APP_SETTINGS); + datatypes.push_back(syncer::AUTOFILL); + datatypes.push_back(syncer::AUTOFILL_PROFILE); + datatypes.push_back(syncer::BOOKMARKS); + datatypes.push_back(syncer::EXTENSIONS); + datatypes.push_back(syncer::EXTENSION_SETTINGS); + datatypes.push_back(syncer::PASSWORDS); + datatypes.push_back(syncer::PREFERENCES); + datatypes.push_back(syncer::SEARCH_ENGINES); + datatypes.push_back(syncer::SESSIONS); + datatypes.push_back(syncer::THEMES); + datatypes.push_back(syncer::TYPED_URLS); return datatypes; } @@ -60,11 +60,11 @@ class ProfileSyncComponentsFactoryImplTest : public testing::Test { // not be in |map|. static void CheckDefaultDatatypesInMapExcept( DataTypeController::StateMap* map, - syncable::ModelType exception_type) { - std::vector<syncable::ModelType> defaults = DefaultDatatypes(); - std::vector<syncable::ModelType>::iterator iter; + syncer::ModelType exception_type) { + std::vector<syncer::ModelType> defaults = DefaultDatatypes(); + std::vector<syncer::ModelType>::iterator iter; for (iter = defaults.begin(); iter != defaults.end(); ++iter) { - if (exception_type != syncable::UNSPECIFIED && exception_type == *iter) + if (exception_type != syncer::UNSPECIFIED && exception_type == *iter) EXPECT_EQ(0U, map->count(*iter)) << *iter << " found in dataypes map, shouldn't be there."; else @@ -76,7 +76,7 @@ class ProfileSyncComponentsFactoryImplTest : public testing::Test { // Asserts that if you apply the command line switch |cmd_switch|, // all types are enabled except for |type|, which is disabled. void TestSwitchDisablesType(const char* cmd_switch, - syncable::ModelType type) { + syncer::ModelType type) { command_line_->AppendSwitch(cmd_switch); scoped_ptr<ProfileSyncService> pss( new ProfileSyncService( @@ -110,45 +110,45 @@ TEST_F(ProfileSyncComponentsFactoryImplTest, CreatePSSDefault) { DataTypeController::StateMap controller_states; pss->GetDataTypeControllerStates(&controller_states); EXPECT_EQ(DefaultDatatypesCount(), controller_states.size()); - CheckDefaultDatatypesInMapExcept(&controller_states, syncable::UNSPECIFIED); + CheckDefaultDatatypesInMapExcept(&controller_states, syncer::UNSPECIFIED); } TEST_F(ProfileSyncComponentsFactoryImplTest, CreatePSSDisableAutofill) { TestSwitchDisablesType(switches::kDisableSyncAutofill, - syncable::AUTOFILL); + syncer::AUTOFILL); } TEST_F(ProfileSyncComponentsFactoryImplTest, CreatePSSDisableBookmarks) { TestSwitchDisablesType(switches::kDisableSyncBookmarks, - syncable::BOOKMARKS); + syncer::BOOKMARKS); } TEST_F(ProfileSyncComponentsFactoryImplTest, CreatePSSDisablePreferences) { TestSwitchDisablesType(switches::kDisableSyncPreferences, - syncable::PREFERENCES); + syncer::PREFERENCES); } TEST_F(ProfileSyncComponentsFactoryImplTest, CreatePSSDisableThemes) { TestSwitchDisablesType(switches::kDisableSyncThemes, - syncable::THEMES); + syncer::THEMES); } TEST_F(ProfileSyncComponentsFactoryImplTest, CreatePSSDisableExtensions) { TestSwitchDisablesType(switches::kDisableSyncExtensions, - syncable::EXTENSIONS); + syncer::EXTENSIONS); } TEST_F(ProfileSyncComponentsFactoryImplTest, CreatePSSDisableApps) { TestSwitchDisablesType(switches::kDisableSyncApps, - syncable::APPS); + syncer::APPS); } TEST_F(ProfileSyncComponentsFactoryImplTest, CreatePSSDisableAutofillProfile) { TestSwitchDisablesType(switches::kDisableSyncAutofillProfile, - syncable::AUTOFILL_PROFILE); + syncer::AUTOFILL_PROFILE); } TEST_F(ProfileSyncComponentsFactoryImplTest, CreatePSSDisablePasswords) { TestSwitchDisablesType(switches::kDisableSyncPasswords, - syncable::PASSWORDS); + syncer::PASSWORDS); } diff --git a/chrome/browser/sync/profile_sync_components_factory_mock.h b/chrome/browser/sync/profile_sync_components_factory_mock.h index cbccdd8..ae230ca 100644 --- a/chrome/browser/sync/profile_sync_components_factory_mock.h +++ b/chrome/browser/sync/profile_sync_components_factory_mock.h @@ -9,8 +9,8 @@ #include "base/memory/scoped_ptr.h" #include "chrome/browser/sync/glue/data_type_controller.h" #include "chrome/browser/sync/glue/data_type_error_handler.h" -#include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_components_factory.h" +#include "chrome/browser/sync/profile_sync_service.h" #include "testing/gmock/include/gmock/gmock.h" namespace browser_sync { @@ -39,7 +39,7 @@ class ProfileSyncComponentsFactoryMock : public ProfileSyncComponentsFactory { MOCK_METHOD0(CreateSharedChangeProcessor, browser_sync::SharedChangeProcessor*()); MOCK_METHOD1(GetSyncableServiceForType, - base::WeakPtr<syncer::SyncableService>(syncable::ModelType)); + base::WeakPtr<syncer::SyncableService>(syncer::ModelType)); MOCK_METHOD2(CreateBookmarkSyncComponents, SyncComponents(ProfileSyncService* profile_sync_service, browser_sync::DataTypeErrorHandler* error_handler)); diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 0f70f0b..d58b7429 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -68,8 +68,8 @@ using browser_sync::ChangeProcessor; using browser_sync::DataTypeController; using browser_sync::DataTypeManager; using browser_sync::SyncBackendHost; -using syncable::ModelType; -using syncable::ModelTypeSet; +using syncer::ModelType; +using syncer::ModelTypeSet; using syncer::JsBackend; using syncer::JsController; using syncer::JsEventDetails; @@ -262,15 +262,15 @@ void ProfileSyncService::RegisterDataTypeController( browser_sync::SessionModelAssociator* ProfileSyncService::GetSessionModelAssociator() { - if (data_type_controllers_.find(syncable::SESSIONS) == + if (data_type_controllers_.find(syncer::SESSIONS) == data_type_controllers_.end() || - data_type_controllers_.find(syncable::SESSIONS)->second->state() != + data_type_controllers_.find(syncer::SESSIONS)->second->state() != DataTypeController::RUNNING) { return NULL; } return static_cast<browser_sync::SessionDataTypeController*>( data_type_controllers_.find( - syncable::SESSIONS)->second.get())->GetModelAssociator(); + syncer::SESSIONS)->second.get())->GetModelAssociator(); } void ProfileSyncService::GetDataTypeControllerStates( @@ -325,7 +325,7 @@ void ProfileSyncService::InitializeBackend(bool delete_stale_data) { return; } - syncable::ModelTypeSet initial_types; + syncer::ModelTypeSet initial_types; // If sync setup hasn't finished, we don't want to initialize routing info // for any data types so that we don't download updates for types that the // user chooses not to sync on the first DownloadUpdatesCommand. @@ -366,9 +366,9 @@ void ProfileSyncService::CreateBackend() { bool ProfileSyncService::IsEncryptedDatatypeEnabled() const { if (encryption_pending()) return true; - const syncable::ModelTypeSet preferred_types = GetPreferredDataTypes(); - const syncable::ModelTypeSet encrypted_types = GetEncryptedDataTypes(); - DCHECK(encrypted_types.Has(syncable::PASSWORDS)); + const syncer::ModelTypeSet preferred_types = GetPreferredDataTypes(); + const syncer::ModelTypeSet encrypted_types = GetEncryptedDataTypes(); + DCHECK(encrypted_types.Has(syncer::PASSWORDS)); return !Intersection(preferred_types, encrypted_types).Empty(); } @@ -564,9 +564,9 @@ void ProfileSyncService::ClearUnrecoverableError() { // static std::string ProfileSyncService::GetExperimentNameForDataType( - syncable::ModelType data_type) { + syncer::ModelType data_type) { switch (data_type) { - case syncable::SESSIONS: + case syncer::SESSIONS: return "sync-tabs"; default: break; @@ -575,7 +575,7 @@ std::string ProfileSyncService::GetExperimentNameForDataType( return ""; } -void ProfileSyncService::RegisterNewDataType(syncable::ModelType data_type) { +void ProfileSyncService::RegisterNewDataType(syncer::ModelType data_type) { if (data_type_controllers_.count(data_type) > 0) return; NOTREACHED(); @@ -617,7 +617,7 @@ void ProfileSyncService::OnUnrecoverableErrorImpl( } void ProfileSyncService::DisableBrokenDatatype( - syncable::ModelType type, + syncer::ModelType type, const tracked_objects::Location& from_here, std::string message) { // First deactivate the type so that no further server changes are @@ -724,15 +724,15 @@ void ProfileSyncService::OnExperimentsChanged( return; } - const syncable::ModelTypeSet registered_types = GetRegisteredDataTypes(); - syncable::ModelTypeSet to_add; - const syncable::ModelTypeSet to_register = + const syncer::ModelTypeSet registered_types = GetRegisteredDataTypes(); + syncer::ModelTypeSet to_add; + const syncer::ModelTypeSet to_register = Difference(to_add, registered_types); DVLOG(2) << "OnExperimentsChanged called with types: " - << syncable::ModelTypeSetToString(to_add); - DVLOG(2) << "Enabling types: " << syncable::ModelTypeSetToString(to_register); + << syncer::ModelTypeSetToString(to_add); + DVLOG(2) << "Enabling types: " << syncer::ModelTypeSetToString(to_register); - for (syncable::ModelTypeSet::Iterator it = to_register.First(); + for (syncer::ModelTypeSet::Iterator it = to_register.First(); it.Good(); it.Inc()) { // Received notice to enable experimental type. Check if the type is // registered, and if not register a new datatype controller. @@ -765,7 +765,7 @@ void ProfileSyncService::OnExperimentsChanged( // Otherwise, just leave the experimental types on by default. if (!to_register.Empty() && HasSyncSetupCompleted() && migrator_.get()) { DVLOG(1) << "Dynamically enabling new datatypes: " - << syncable::ModelTypeSetToString(to_register); + << syncer::ModelTypeSetToString(to_register); OnMigrationNeededForTypes(to_register); } } @@ -861,7 +861,7 @@ void ProfileSyncService::OnPassphraseAccepted() { // Make sure the data types that depend on the passphrase are started at // this time. - const syncable::ModelTypeSet types = GetPreferredDataTypes(); + const syncer::ModelTypeSet types = GetPreferredDataTypes(); if (data_type_manager_.get()) { // Unblock the data type manager if necessary. @@ -873,15 +873,15 @@ void ProfileSyncService::OnPassphraseAccepted() { } void ProfileSyncService::OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) { encrypted_types_ = encrypted_types; encrypt_everything_ = encrypt_everything; DVLOG(1) << "Encrypted types changed to " - << syncable::ModelTypeSetToString(encrypted_types_) + << syncer::ModelTypeSetToString(encrypted_types_) << " (encrypt everything is set to " << (encrypt_everything_ ? "true" : "false") << ")"; - DCHECK(encrypted_types_.Has(syncable::PASSWORDS)); + DCHECK(encrypted_types_.Has(syncer::PASSWORDS)); } void ProfileSyncService::OnEncryptionComplete() { @@ -895,7 +895,7 @@ void ProfileSyncService::OnEncryptionComplete() { } void ProfileSyncService::OnMigrationNeededForTypes( - syncable::ModelTypeSet types) { + syncer::ModelTypeSet types) { DCHECK(backend_initialized_); DCHECK(data_type_manager_.get()); @@ -1019,23 +1019,23 @@ string16 ProfileSyncService::GetLastSyncedTimeString() const { } void ProfileSyncService::UpdateSelectedTypesHistogram( - bool sync_everything, const syncable::ModelTypeSet chosen_types) const { + bool sync_everything, const syncer::ModelTypeSet chosen_types) const { if (!HasSyncSetupCompleted() || sync_everything != sync_prefs_.HasKeepEverythingSynced()) { UMA_HISTOGRAM_BOOLEAN("Sync.SyncEverything", sync_everything); } // Only log the data types that are shown in the sync settings ui. - const syncable::ModelType model_types[] = { - syncable::APPS, - syncable::AUTOFILL, - syncable::BOOKMARKS, - syncable::EXTENSIONS, - syncable::PASSWORDS, - syncable::PREFERENCES, - syncable::SESSIONS, - syncable::THEMES, - syncable::TYPED_URLS + const syncer::ModelType model_types[] = { + syncer::APPS, + syncer::AUTOFILL, + syncer::BOOKMARKS, + syncer::EXTENSIONS, + syncer::PASSWORDS, + syncer::PREFERENCES, + syncer::SESSIONS, + syncer::THEMES, + syncer::TYPED_URLS }; const browser_sync::user_selectable_type::UserSelectableSyncType @@ -1051,8 +1051,7 @@ void ProfileSyncService::UpdateSelectedTypesHistogram( browser_sync::user_selectable_type::TYPED_URLS }; - COMPILE_ASSERT(17 == syncable::MODEL_TYPE_COUNT, - UpdateCustomConfigHistogram); + COMPILE_ASSERT(17 == syncer::MODEL_TYPE_COUNT, UpdateCustomConfigHistogram); COMPILE_ASSERT(arraysize(model_types) == browser_sync::user_selectable_type::SELECTABLE_DATATYPE_COUNT, UpdateCustomConfigHistogram); @@ -1060,9 +1059,9 @@ void ProfileSyncService::UpdateSelectedTypesHistogram( UpdateCustomConfigHistogram); if (!sync_everything) { - const syncable::ModelTypeSet current_types = GetPreferredDataTypes(); + const syncer::ModelTypeSet current_types = GetPreferredDataTypes(); for (size_t i = 0; i < arraysize(model_types); ++i) { - const syncable::ModelType type = model_types[i]; + const syncer::ModelType type = model_types[i]; if (chosen_types.Has(type) && (!HasSyncSetupCompleted() || !current_types.Has(type))) { // Selected type has changed - log it. @@ -1093,7 +1092,7 @@ void ProfileSyncService::RefreshSpareBootstrapToken( #endif void ProfileSyncService::OnUserChoseDatatypes(bool sync_everything, - syncable::ModelTypeSet chosen_types) { + syncer::ModelTypeSet chosen_types) { if (!backend_.get() && !HasUnrecoverableError()) { NOTREACHED(); return; @@ -1109,11 +1108,11 @@ void ProfileSyncService::OnUserChoseDatatypes(bool sync_everything, } void ProfileSyncService::ChangePreferredDataTypes( - syncable::ModelTypeSet preferred_types) { + syncer::ModelTypeSet preferred_types) { DVLOG(1) << "ChangePreferredDataTypes invoked"; - const syncable::ModelTypeSet registered_types = GetRegisteredDataTypes(); - const syncable::ModelTypeSet registered_preferred_types = + const syncer::ModelTypeSet registered_types = GetRegisteredDataTypes(); + const syncer::ModelTypeSet registered_preferred_types = Intersection(registered_types, preferred_types); sync_prefs_.SetPreferredDataTypes(registered_types, registered_preferred_types); @@ -1122,17 +1121,17 @@ void ProfileSyncService::ChangePreferredDataTypes( ReconfigureDatatypeManager(); } -syncable::ModelTypeSet ProfileSyncService::GetPreferredDataTypes() const { - const syncable::ModelTypeSet registered_types = GetRegisteredDataTypes(); - const syncable::ModelTypeSet preferred_types = +syncer::ModelTypeSet ProfileSyncService::GetPreferredDataTypes() const { + const syncer::ModelTypeSet registered_types = GetRegisteredDataTypes(); + const syncer::ModelTypeSet preferred_types = sync_prefs_.GetPreferredDataTypes(registered_types); - const syncable::ModelTypeSet failed_types = + const syncer::ModelTypeSet failed_types = failed_datatypes_handler_.GetFailedTypes(); return Difference(preferred_types, failed_types); } -syncable::ModelTypeSet ProfileSyncService::GetRegisteredDataTypes() const { - syncable::ModelTypeSet registered_types; +syncer::ModelTypeSet ProfileSyncService::GetRegisteredDataTypes() const { + syncer::ModelTypeSet registered_types; // The data_type_controllers_ are determined by command-line flags; that's // effectively what controls the values returned here. for (DataTypeController::TypeMap::const_iterator it = @@ -1184,7 +1183,7 @@ void ProfileSyncService::ConfigureDataTypeManager() { base::Unretained(this)))); } - const syncable::ModelTypeSet types = GetPreferredDataTypes(); + const syncer::ModelTypeSet types = GetPreferredDataTypes(); if (IsPassphraseRequiredForDecryption()) { // We need a passphrase still. We don't bother to attempt to configure // until we receive an OnPassphraseAccepted (which triggers a configure). @@ -1315,7 +1314,7 @@ Value* ProfileSyncService::GetTypeStatusMap() const { } void ProfileSyncService::ActivateDataType( - syncable::ModelType type, syncer::ModelSafeGroup group, + syncer::ModelType type, syncer::ModelSafeGroup group, ChangeProcessor* change_processor) { if (!backend_.get()) { NOTREACHED(); @@ -1325,7 +1324,7 @@ void ProfileSyncService::ActivateDataType( backend_->ActivateDataType(type, group, change_processor); } -void ProfileSyncService::DeactivateDataType(syncable::ModelType type) { +void ProfileSyncService::DeactivateDataType(syncer::ModelType type) { if (!backend_.get()) return; backend_->DeactivateDataType(type); @@ -1419,8 +1418,8 @@ bool ProfileSyncService::EncryptEverythingEnabled() const { return encrypt_everything_ || encryption_pending_; } -syncable::ModelTypeSet ProfileSyncService::GetEncryptedDataTypes() const { - DCHECK(encrypted_types_.Has(syncable::PASSWORDS)); +syncer::ModelTypeSet ProfileSyncService::GetEncryptedDataTypes() const { + DCHECK(encrypted_types_.Has(syncer::PASSWORDS)); // We may be called during the setup process before we're // initialized. In this case, we default to the sensitive types. return encrypted_types_; @@ -1493,7 +1492,7 @@ void ProfileSyncService::Observe(int type, std::string message = "Sync configuration failed with status " + DataTypeManager::ConfigureStatusToString(configure_status_) + - " during " + syncable::ModelTypeToString(error.type()) + + " during " + syncer::ModelTypeToString(error.type()) + ": " + error.message(); LOG(ERROR) << "ProfileSyncService error: " << message; diff --git a/chrome/browser/sync/profile_sync_service.h b/chrome/browser/sync/profile_sync_service.h index db2477c..19795ce 100644 --- a/chrome/browser/sync/profile_sync_service.h +++ b/chrome/browser/sync/profile_sync_service.h @@ -266,11 +266,11 @@ class ProfileSyncService : public browser_sync::SyncFrontend, const sync_pb::EncryptedData& pending_keys) OVERRIDE; virtual void OnPassphraseAccepted() OVERRIDE; virtual void OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) OVERRIDE; virtual void OnEncryptionComplete() OVERRIDE; virtual void OnMigrationNeededForTypes( - syncable::ModelTypeSet types) OVERRIDE; + syncer::ModelTypeSet types) OVERRIDE; virtual void OnExperimentsChanged( const syncer::Experiments& experiments) OVERRIDE; virtual void OnActionableError( @@ -285,7 +285,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // and all data types will be synced. |sync_everything| means "sync all // current and future data types." virtual void OnUserChoseDatatypes(bool sync_everything, - syncable::ModelTypeSet chosen_types); + syncer::ModelTypeSet chosen_types); // Get various information for displaying in the user interface. std::string QuerySyncStatusSummary(); @@ -377,7 +377,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // Called when a datatype wishes to disable itself due to having hit an // unrecoverable error. virtual void DisableBrokenDatatype( - syncable::ModelType type, + syncer::ModelType type, const tracked_objects::Location& from_here, std::string message); @@ -424,9 +424,9 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // Overridden by tests. // TODO(zea): Remove these and have the dtc's call directly into the SBH. virtual void ActivateDataType( - syncable::ModelType type, syncer::ModelSafeGroup group, + syncer::ModelType type, syncer::ModelSafeGroup group, browser_sync::ChangeProcessor* change_processor); - virtual void DeactivateDataType(syncable::ModelType type); + virtual void DeactivateDataType(syncer::ModelType type); // SyncPrefObserver implementation. virtual void OnSyncManagedPrefChange(bool is_sync_managed) OVERRIDE; @@ -441,18 +441,18 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // the sync backend so that exactly these datatypes are actively synced. See // class comment for more on what it means for a datatype to be Preferred. virtual void ChangePreferredDataTypes( - syncable::ModelTypeSet preferred_types); + syncer::ModelTypeSet preferred_types); // Get the set of currently enabled data types (as chosen or configured by // the user). See class comment for more on what it means for a datatype // to be Preferred. - virtual syncable::ModelTypeSet GetPreferredDataTypes() const; + virtual syncer::ModelTypeSet GetPreferredDataTypes() const; // Gets the set of all data types that could be allowed (the set that // should be advertised to the user). These will typically only change // via a command-line option. See class comment for more on what it means // for a datatype to be Registered. - virtual syncable::ModelTypeSet GetRegisteredDataTypes() const; + virtual syncer::ModelTypeSet GetRegisteredDataTypes() const; // Checks whether the Cryptographer is ready to encrypt and decrypt updates // for sensitive data types. Caller must be holding a @@ -497,7 +497,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // Fills |encrypted_types| with the set of currently encrypted types. Does // not account for types pending encryption. - virtual syncable::ModelTypeSet GetEncryptedDataTypes() const; + virtual syncer::ModelTypeSet GetEncryptedDataTypes() const; // Returns true if the syncer is waiting for new datatypes to be encrypted. virtual bool encryption_pending() const; @@ -645,10 +645,10 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // About-flags experiment names for datatypes that aren't enabled by default // yet. static std::string GetExperimentNameForDataType( - syncable::ModelType data_type); + syncer::ModelType data_type); // Create and register a new datatype controller. - void RegisterNewDataType(syncable::ModelType data_type); + void RegisterNewDataType(syncer::ModelType data_type); // Helper method to process SyncConfigureDone after unwinding the stack that // originally posted this SyncConfigureDone. @@ -667,7 +667,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // stats. void UpdateSelectedTypesHistogram( bool sync_everything, - const syncable::ModelTypeSet chosen_types) const; + const syncer::ModelTypeSet chosen_types) const; #if defined(OS_CHROMEOS) // Refresh spare sync bootstrap token for re-enabling the sync service. @@ -753,7 +753,7 @@ class ProfileSyncService : public browser_sync::SyncFrontend, // The current set of encrypted types. Always a superset of // syncer::Cryptographer::SensitiveTypes(). - syncable::ModelTypeSet encrypted_types_; + syncer::ModelTypeSet encrypted_types_; // Whether we want to encrypt everything. bool encrypt_everything_; diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc index b4f6bc4..b8a142f 100644 --- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc @@ -68,7 +68,8 @@ using browser_sync::DataTypeController; using browser_sync::GenericChangeProcessor; using browser_sync::SharedChangeProcessor; using content::BrowserThread; -using syncer::syncable::AUTOFILL; +using syncer::AUTOFILL; +using syncer::BaseNode; using syncer::syncable::BASE_VERSION; using syncer::syncable::CREATE; using syncer::syncable::GET_BY_SERVER_TAG; @@ -78,7 +79,6 @@ using syncer::syncable::SPECIFICS; using syncer::syncable::UNITTEST; using syncer::syncable::WriterTag; using syncer::syncable::WriteTransaction; -using syncer::BaseNode; using testing::_; using testing::DoAll; using testing::ElementsAre; @@ -135,18 +135,18 @@ class WebDatabaseFake : public WebDatabase { class ProfileSyncServiceAutofillTest; template<class AutofillProfile> -syncable::ModelType GetModelType() { - return syncable::UNSPECIFIED; +syncer::ModelType GetModelType() { + return syncer::UNSPECIFIED; } template<> -syncable::ModelType GetModelType<AutofillEntry>() { - return syncable::AUTOFILL; +syncer::ModelType GetModelType<AutofillEntry>() { + return syncer::AUTOFILL; } template<> -syncable::ModelType GetModelType<AutofillProfile>() { - return syncable::AUTOFILL_PROFILE; +syncer::ModelType GetModelType<AutofillProfile>() { + return syncer::AUTOFILL_PROFILE; } class WebDataServiceFake : public WebDataService { @@ -301,7 +301,7 @@ class AutofillEntryFactory : public AbstractAutofillFactory { WillOnce(MakeGenericChangeProcessor()); EXPECT_CALL(*factory, CreateSharedChangeProcessor()). WillOnce(MakeSharedChangeProcessor()); - EXPECT_CALL(*factory, GetSyncableServiceForType(syncable::AUTOFILL)). + EXPECT_CALL(*factory, GetSyncableServiceForType(syncer::AUTOFILL)). WillOnce(MakeAutocompleteSyncComponents(wds)); } }; @@ -324,7 +324,7 @@ class AutofillProfileFactory : public AbstractAutofillFactory { EXPECT_CALL(*factory, CreateSharedChangeProcessor()). WillOnce(MakeSharedChangeProcessor()); EXPECT_CALL(*factory, - GetSyncableServiceForType(syncable::AUTOFILL_PROFILE)). + GetSyncableServiceForType(syncer::AUTOFILL_PROFILE)). WillOnce(MakeAutofillProfileSyncComponents(wds)); } }; @@ -352,10 +352,10 @@ class ProfileSyncServiceAutofillTest : public AbstractProfileSyncServiceTest { AutofillProfileFactory profile_factory_; AutofillEntryFactory entry_factory_; - AbstractAutofillFactory* GetFactory(syncable::ModelType type) { - if (type == syncable::AUTOFILL) { + AbstractAutofillFactory* GetFactory(syncer::ModelType type) { + if (type == syncer::AUTOFILL) { return &entry_factory_; - } else if (type == syncable::AUTOFILL_PROFILE) { + } else if (type == syncer::AUTOFILL_PROFILE) { return &profile_factory_; } else { NOTREACHED(); @@ -404,7 +404,7 @@ class ProfileSyncServiceAutofillTest : public AbstractProfileSyncServiceTest { void StartSyncService(const base::Closure& callback, bool will_fail_association, - syncable::ModelType type) { + syncer::ModelType type) { AbstractAutofillFactory* factory = GetFactory(type); SigninManager* signin = SigninManagerFactory::GetForProfile(profile_.get()); signin->SetAuthenticatedUsername("test_user"); @@ -445,7 +445,7 @@ class ProfileSyncServiceAutofillTest : public AbstractProfileSyncServiceTest { syncer::WriteTransaction trans(FROM_HERE, service_->GetUserShare()); syncer::ReadNode autofill_root(&trans); if (autofill_root.InitByTagLookup( - syncable::ModelTypeToRootTag(syncable::AUTOFILL)) != + syncer::ModelTypeToRootTag(syncer::AUTOFILL)) != BaseNode::INIT_OK) { return false; } @@ -454,7 +454,7 @@ class ProfileSyncServiceAutofillTest : public AbstractProfileSyncServiceTest { std::string tag = AutocompleteSyncableService::KeyToTag( UTF16ToUTF8(entry.key().name()), UTF16ToUTF8(entry.key().value())); syncer::WriteNode::InitUniqueByCreationResult result = - node.InitUniqueByCreation(syncable::AUTOFILL, autofill_root, tag); + node.InitUniqueByCreation(syncer::AUTOFILL, autofill_root, tag); if (result != syncer::WriteNode::INIT_SUCCESS) return false; @@ -476,7 +476,7 @@ class ProfileSyncServiceAutofillTest : public AbstractProfileSyncServiceTest { syncer::WriteNode node(&trans); std::string tag = profile.guid(); syncer::WriteNode::InitUniqueByCreationResult result = - node.InitUniqueByCreation(syncable::AUTOFILL_PROFILE, + node.InitUniqueByCreation(syncer::AUTOFILL_PROFILE, autofill_root, tag); if (result != syncer::WriteNode::INIT_SUCCESS) return false; @@ -494,7 +494,7 @@ class ProfileSyncServiceAutofillTest : public AbstractProfileSyncServiceTest { syncer::ReadTransaction trans(FROM_HERE, service_->GetUserShare()); syncer::ReadNode autofill_root(&trans); if (autofill_root.InitByTagLookup( - syncable::ModelTypeToRootTag(syncable::AUTOFILL)) != + syncer::ModelTypeToRootTag(syncer::AUTOFILL)) != BaseNode::INIT_OK) { return false; } @@ -638,7 +638,7 @@ class WriteTransactionTest: public WriteTransaction { wait_for_syncapi_(wait_for_syncapi) { } virtual void NotifyTransactionComplete( - syncable::ModelTypeSet types) OVERRIDE { + syncer::ModelTypeSet types) OVERRIDE { // This is where we differ. Force a thread change here, giving another // thread a chance to create a WriteTransaction (*wait_for_syncapi_)->Wait(); @@ -696,7 +696,7 @@ class FakeServerUpdater : public base::RefCountedThreadSafe<FakeServerUpdater> { // Create actual entry based on autofill protobuf information. // Simulates effects of UpdateLocalDataFromServerData MutableEntry parent(&trans, GET_BY_SERVER_TAG, - syncable::ModelTypeToRootTag(syncable::AUTOFILL)); + syncer::ModelTypeToRootTag(syncer::AUTOFILL)); MutableEntry item(&trans, CREATE, parent.Get(syncer::syncable::ID), tag); ASSERT_TRUE(item.good()); item.Put(SPECIFICS, entity_specifics); @@ -776,16 +776,16 @@ bool IncludesField(const AutofillProfile& profile1, // waiting for the PersonalDataManager. TEST_F(ProfileSyncServiceAutofillTest, FailModelAssociation) { // Don't create the root autofill node so startup fails. - StartSyncService(base::Closure(), true, syncable::AUTOFILL); + StartSyncService(base::Closure(), true, syncer::AUTOFILL); EXPECT_TRUE(service_->HasUnrecoverableError()); } TEST_F(ProfileSyncServiceAutofillTest, EmptyNativeEmptySync) { EXPECT_CALL(autofill_table_, GetAllAutofillEntries(_)).WillOnce(Return(true)); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::AUTOFILL); + CreateRootHelper create_root(this, syncer::AUTOFILL); EXPECT_CALL(*personal_data_manager_, Refresh()); - StartSyncService(create_root.callback(), false, syncable::AUTOFILL); + StartSyncService(create_root.callback(), false, syncer::AUTOFILL); EXPECT_TRUE(create_root.success()); std::vector<AutofillEntry> sync_entries; std::vector<AutofillProfile> sync_profiles; @@ -800,9 +800,9 @@ TEST_F(ProfileSyncServiceAutofillTest, HasNativeEntriesEmptySync) { EXPECT_CALL(autofill_table_, GetAllAutofillEntries(_)). WillOnce(DoAll(SetArgumentPointee<0>(entries), Return(true))); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::AUTOFILL); + CreateRootHelper create_root(this, syncer::AUTOFILL); EXPECT_CALL(*personal_data_manager_, Refresh()); - StartSyncService(create_root.callback(), false, syncable::AUTOFILL); + StartSyncService(create_root.callback(), false, syncer::AUTOFILL); ASSERT_TRUE(create_root.success()); std::vector<AutofillEntry> sync_entries; std::vector<AutofillProfile> sync_profiles; @@ -828,8 +828,8 @@ TEST_F(ProfileSyncServiceAutofillTest, HasProfileEmptySync) { WillOnce(DoAll(SetArgumentPointee<0>(profiles), Return(true))); EXPECT_CALL(*personal_data_manager_, Refresh()); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::AUTOFILL_PROFILE); - StartSyncService(create_root.callback(), false, syncable::AUTOFILL_PROFILE); + CreateRootHelper create_root(this, syncer::AUTOFILL_PROFILE); + StartSyncService(create_root.callback(), false, syncer::AUTOFILL_PROFILE); ASSERT_TRUE(create_root.success()); std::vector<AutofillProfile> sync_profiles; ASSERT_TRUE(GetAutofillProfilesFromSyncDBUnderProfileNode(&sync_profiles)); @@ -847,9 +847,9 @@ TEST_F(ProfileSyncServiceAutofillTest, HasNativeWithDuplicatesEmptySync) { EXPECT_CALL(autofill_table_, GetAllAutofillEntries(_)). WillOnce(DoAll(SetArgumentPointee<0>(entries), Return(true))); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::AUTOFILL); + CreateRootHelper create_root(this, syncer::AUTOFILL); EXPECT_CALL(*personal_data_manager_, Refresh()); - StartSyncService(create_root.callback(), false, syncable::AUTOFILL); + StartSyncService(create_root.callback(), false, syncer::AUTOFILL); ASSERT_TRUE(create_root.success()); std::vector<AutofillEntry> sync_entries; std::vector<AutofillProfile> sync_profiles; @@ -876,7 +876,7 @@ TEST_F(ProfileSyncServiceAutofillTest, HasNativeHasSyncNoMerge) { WillOnce(Return(true)); EXPECT_CALL(*personal_data_manager_, Refresh()); - StartSyncService(add_autofill.callback(), false, syncable::AUTOFILL); + StartSyncService(add_autofill.callback(), false, syncer::AUTOFILL); ASSERT_TRUE(add_autofill.success()); std::set<AutofillEntry> expected_entries; @@ -910,7 +910,7 @@ TEST_F(ProfileSyncServiceAutofillTest, HasNativeHasSyncMergeEntry) { EXPECT_CALL(autofill_table_, UpdateAutofillEntries(ElementsAre(merged_entry))).WillOnce(Return(true)); EXPECT_CALL(*personal_data_manager_, Refresh()); - StartSyncService(add_autofill.callback(), false, syncable::AUTOFILL); + StartSyncService(add_autofill.callback(), false, syncer::AUTOFILL); ASSERT_TRUE(add_autofill.success()); std::vector<AutofillEntry> new_sync_entries; @@ -948,7 +948,7 @@ TEST_F(ProfileSyncServiceAutofillTest, HasNativeHasSyncMergeProfile) { UpdateAutofillProfileMulti(MatchProfiles(sync_profile))). WillOnce(Return(true)); EXPECT_CALL(*personal_data_manager_, Refresh()); - StartSyncService(add_autofill.callback(), false, syncable::AUTOFILL_PROFILE); + StartSyncService(add_autofill.callback(), false, syncer::AUTOFILL_PROFILE); ASSERT_TRUE(add_autofill.success()); std::vector<AutofillProfile> new_sync_profiles; @@ -991,7 +991,7 @@ TEST_F(ProfileSyncServiceAutofillTest, HasNativeHasSyncMergeProfileCombine) { AddAutofillHelper<AutofillProfile> add_autofill(this, sync_profiles); EXPECT_CALL(*personal_data_manager_, Refresh()); - StartSyncService(add_autofill.callback(), false, syncable::AUTOFILL_PROFILE); + StartSyncService(add_autofill.callback(), false, syncer::AUTOFILL_PROFILE); ASSERT_TRUE(add_autofill.success()); std::vector<AutofillProfile> new_sync_profiles; @@ -1039,7 +1039,7 @@ TEST_F(ProfileSyncServiceAutofillTest, MergeProfileWithDifferentGuid) { EXPECT_CALL(autofill_table_, RemoveAutofillProfile(native_guid)). WillOnce(Return(true)); EXPECT_CALL(*personal_data_manager_, Refresh()); - StartSyncService(add_autofill.callback(), false, syncable::AUTOFILL_PROFILE); + StartSyncService(add_autofill.callback(), false, syncer::AUTOFILL_PROFILE); ASSERT_TRUE(add_autofill.success()); std::vector<AutofillProfile> new_sync_profiles; @@ -1054,8 +1054,8 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeAddEntry) { EXPECT_CALL(autofill_table_, GetAllAutofillEntries(_)).WillOnce(Return(true)); EXPECT_CALL(*personal_data_manager_, Refresh()); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::AUTOFILL); - StartSyncService(create_root.callback(), false, syncable::AUTOFILL); + CreateRootHelper create_root(this, syncer::AUTOFILL); + StartSyncService(create_root.callback(), false, syncer::AUTOFILL); ASSERT_TRUE(create_root.success()); AutofillEntry added_entry(MakeAutofillEntry("added", "entry", 1)); @@ -1084,8 +1084,8 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeAddProfile) { EXPECT_CALL(autofill_table_, GetAutofillProfiles(_)).WillOnce(Return(true)); EXPECT_CALL(*personal_data_manager_, Refresh()); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::AUTOFILL_PROFILE); - StartSyncService(create_root.callback(), false, syncable::AUTOFILL_PROFILE); + CreateRootHelper create_root(this, syncer::AUTOFILL_PROFILE); + StartSyncService(create_root.callback(), false, syncer::AUTOFILL_PROFILE); ASSERT_TRUE(create_root.success()); AutofillProfile added_profile; @@ -1117,8 +1117,8 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeUpdateEntry) { EXPECT_CALL(autofill_table_, GetAllAutofillEntries(_)). WillOnce(DoAll(SetArgumentPointee<0>(original_entries), Return(true))); EXPECT_CALL(*personal_data_manager_, Refresh()); - CreateRootHelper create_root(this, syncable::AUTOFILL); - StartSyncService(create_root.callback(), false, syncable::AUTOFILL); + CreateRootHelper create_root(this, syncer::AUTOFILL); + StartSyncService(create_root.callback(), false, syncer::AUTOFILL); ASSERT_TRUE(create_root.success()); AutofillEntry updated_entry(MakeAutofillEntry("my", "entry", 1, 2)); @@ -1153,8 +1153,8 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeRemoveEntry) { EXPECT_CALL(autofill_table_, GetAllAutofillEntries(_)). WillOnce(DoAll(SetArgumentPointee<0>(original_entries), Return(true))); EXPECT_CALL(*personal_data_manager_, Refresh()); - CreateRootHelper create_root(this, syncable::AUTOFILL); - StartSyncService(create_root.callback(), false, syncable::AUTOFILL); + CreateRootHelper create_root(this, syncer::AUTOFILL); + StartSyncService(create_root.callback(), false, syncer::AUTOFILL); ASSERT_TRUE(create_root.success()); AutofillChangeList changes; @@ -1194,7 +1194,7 @@ TEST_F(ProfileSyncServiceAutofillTest, ProcessUserChangeRemoveProfile) { sync_profiles.push_back(sync_profile); AddAutofillHelper<AutofillProfile> add_autofill(this, sync_profiles); EXPECT_CALL(*personal_data_manager_, Refresh()); - StartSyncService(add_autofill.callback(), false, syncable::AUTOFILL_PROFILE); + StartSyncService(add_autofill.callback(), false, syncer::AUTOFILL_PROFILE); ASSERT_TRUE(add_autofill.success()); AutofillProfileChange change(AutofillProfileChange::REMOVE, @@ -1223,8 +1223,8 @@ TEST_F(ProfileSyncServiceAutofillTest, DISABLED_ServerChangeRace) { EXPECT_CALL(autofill_table_, UpdateAutofillEntries(_)). WillRepeatedly(Return(true)); EXPECT_CALL(*personal_data_manager_, Refresh()).Times(3); - CreateRootHelper create_root(this, syncable::AUTOFILL); - StartSyncService(create_root.callback(), false, syncable::AUTOFILL); + CreateRootHelper create_root(this, syncer::AUTOFILL); + StartSyncService(create_root.callback(), false, syncer::AUTOFILL); ASSERT_TRUE(create_root.success()); // (true, false) means we have to reset after |Signal|, init to unsignaled. diff --git a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc index ea47a1c..97ab793 100644 --- a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc @@ -67,7 +67,7 @@ class TestBookmarkModelAssociator : public BookmarkModelAssociator { virtual bool GetSyncIdForTaggedNode(const std::string& tag, int64* sync_id) { std::string tag_str = std::string(tag.c_str(), tag.length()); bool root_exists = false; - syncable::ModelType type = model_type(); + syncer::ModelType type = model_type(); { syncer::WriteTransaction trans(FROM_HERE, user_share_); syncer::ReadNode uber_root(&trans); @@ -155,12 +155,12 @@ class FakeServerChange { EXPECT_EQ(BaseNode::INIT_OK, parent.InitByIdLookup(parent_id)); syncer::WriteNode node(trans_); if (predecessor_id == 0) { - EXPECT_TRUE(node.InitByCreation(syncable::BOOKMARKS, parent, NULL)); + EXPECT_TRUE(node.InitByCreation(syncer::BOOKMARKS, parent, NULL)); } else { syncer::ReadNode predecessor(trans_); EXPECT_EQ(BaseNode::INIT_OK, predecessor.InitByIdLookup(predecessor_id)); EXPECT_EQ(predecessor.GetParentId(), parent.GetId()); - EXPECT_TRUE(node.InitByCreation(syncable::BOOKMARKS, parent, + EXPECT_TRUE(node.InitByCreation(syncer::BOOKMARKS, parent, &predecessor)); } EXPECT_EQ(node.GetPredecessorId(), predecessor_id); diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc index 1457a62..1bfa704 100644 --- a/chrome/browser/sync/profile_sync_service_harness.cc +++ b/chrome/browser/sync/profile_sync_service_harness.cc @@ -101,7 +101,7 @@ ProfileSyncServiceHarness::ProfileSyncServiceHarness( Profile* profile, const std::string& username, const std::string& password) - : waiting_for_encryption_type_(syncable::UNSPECIFIED), + : waiting_for_encryption_type_(syncer::UNSPECIFIED), wait_state_(INITIAL_WAIT_STATE), profile_(profile), service_(NULL), @@ -144,7 +144,7 @@ bool ProfileSyncServiceHarness::IsSyncAlreadySetup() { } bool ProfileSyncServiceHarness::SetupSync() { - bool result = SetupSync(syncable::ModelTypeSet::All()); + bool result = SetupSync(syncer::ModelTypeSet::All()); if (result == false) { std::string status = GetServiceStatus(); LOG(ERROR) << profile_debug_name_ @@ -156,7 +156,7 @@ bool ProfileSyncServiceHarness::SetupSync() { } bool ProfileSyncServiceHarness::SetupSync( - syncable::ModelTypeSet synced_datatypes) { + syncer::ModelTypeSet synced_datatypes) { // Initialize the sync client's profile sync service object. service_ = ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_); @@ -192,7 +192,7 @@ bool ProfileSyncServiceHarness::SetupSync( // Choose the datatypes to be synced. If all datatypes are to be synced, // set sync_everything to true; otherwise, set it to false. bool sync_everything = - synced_datatypes.Equals(syncable::ModelTypeSet::All()); + synced_datatypes.Equals(syncer::ModelTypeSet::All()); service()->OnUserChoseDatatypes(sync_everything, synced_datatypes); // Subscribe sync client to notifications from the backend migrator @@ -449,14 +449,14 @@ void ProfileSyncServiceHarness::OnMigrationStateChange() { service()->GetBackendMigratorForTest()-> GetPendingMigrationTypesForTest()); DVLOG(1) << profile_debug_name_ << ": new pending migration types " - << syncable::ModelTypeSetToString(pending_migration_types_); + << syncer::ModelTypeSetToString(pending_migration_types_); } else { // Merge just-finished pending migration types into // |migration_types_|. migrated_types_.PutAll(pending_migration_types_); pending_migration_types_.Clear(); DVLOG(1) << profile_debug_name_ << ": new migrated types " - << syncable::ModelTypeSetToString(migrated_types_); + << syncer::ModelTypeSetToString(migrated_types_); } RunStateChangeMachine(); } @@ -607,16 +607,16 @@ bool ProfileSyncServiceHarness::AwaitActionableError() { } bool ProfileSyncServiceHarness::AwaitMigration( - syncable::ModelTypeSet expected_migrated_types) { + syncer::ModelTypeSet expected_migrated_types) { DVLOG(1) << GetClientInfoString("AwaitMigration"); DVLOG(1) << profile_debug_name_ << ": waiting until migration is done for " - << syncable::ModelTypeSetToString(expected_migrated_types); + << syncer::ModelTypeSetToString(expected_migrated_types); while (true) { bool migration_finished = migrated_types_.HasAll(expected_migrated_types); DVLOG(1) << "Migrated types " - << syncable::ModelTypeSetToString(migrated_types_) + << syncer::ModelTypeSetToString(migrated_types_) << (migration_finished ? " contains " : " does not contain ") - << syncable::ModelTypeSetToString(expected_migrated_types); + << syncer::ModelTypeSetToString(expected_migrated_types); if (migration_finished) { return true; } @@ -825,13 +825,13 @@ bool ProfileSyncServiceHarness::MatchesOtherClient( // Only look for a match if we have at least one enabled datatype in // common with the partner client. - const syncable::ModelTypeSet common_types = + const syncer::ModelTypeSet common_types = Intersection(service()->GetPreferredDataTypes(), partner->service()->GetPreferredDataTypes()); DVLOG(2) << profile_debug_name_ << ", " << partner->profile_debug_name_ << ": common types are " - << syncable::ModelTypeSetToString(common_types); + << syncer::ModelTypeSetToString(common_types); if (!common_types.Empty() && !partner->IsFullySynced()) { DVLOG(2) << "non-empty common types and " @@ -839,7 +839,7 @@ bool ProfileSyncServiceHarness::MatchesOtherClient( return false; } - for (syncable::ModelTypeSet::Iterator i = common_types.First(); + for (syncer::ModelTypeSet::Iterator i = common_types.First(); i.Good(); i.Inc()) { const std::string timestamp = GetUpdatedTimestamp(i.Get()); const std::string partner_timestamp = partner->GetUpdatedTimestamp(i.Get()); @@ -853,7 +853,7 @@ bool ProfileSyncServiceHarness::MatchesOtherClient( partner_timestamp, &partner_timestamp_base64)) { NOTREACHED(); } - DVLOG(2) << syncable::ModelTypeToString(i.Get()) << ": " + DVLOG(2) << syncer::ModelTypeToString(i.Get()) << ": " << profile_debug_name_ << " timestamp = " << timestamp_base64 << ", " << partner->profile_debug_name_ @@ -875,13 +875,13 @@ SyncSessionSnapshot ProfileSyncServiceHarness::GetLastSessionSnapshot() const { } bool ProfileSyncServiceHarness::EnableSyncForDatatype( - syncable::ModelType datatype) { + syncer::ModelType datatype) { DVLOG(1) << GetClientInfoString( "EnableSyncForDatatype(" - + std::string(syncable::ModelTypeToString(datatype)) + ")"); + + std::string(syncer::ModelTypeToString(datatype)) + ")"); if (wait_state_ == SYNC_DISABLED) { - return SetupSync(syncable::ModelTypeSet(datatype)); + return SetupSync(syncer::ModelTypeSet(datatype)); } if (service() == NULL) { @@ -889,20 +889,19 @@ bool ProfileSyncServiceHarness::EnableSyncForDatatype( return false; } - syncable::ModelTypeSet synced_datatypes = - service()->GetPreferredDataTypes(); + syncer::ModelTypeSet synced_datatypes = service()->GetPreferredDataTypes(); if (synced_datatypes.Has(datatype)) { DVLOG(1) << "EnableSyncForDatatype(): Sync already enabled for datatype " - << syncable::ModelTypeToString(datatype) + << syncer::ModelTypeToString(datatype) << " on " << profile_debug_name_ << "."; return true; } - synced_datatypes.Put(syncable::ModelTypeFromInt(datatype)); + synced_datatypes.Put(syncer::ModelTypeFromInt(datatype)); service()->OnUserChoseDatatypes(false, synced_datatypes); if (AwaitDataSyncCompletion("Datatype configuration.")) { DVLOG(1) << "EnableSyncForDatatype(): Enabled sync for datatype " - << syncable::ModelTypeToString(datatype) + << syncer::ModelTypeToString(datatype) << " on " << profile_debug_name_ << "."; return true; } @@ -912,21 +911,20 @@ bool ProfileSyncServiceHarness::EnableSyncForDatatype( } bool ProfileSyncServiceHarness::DisableSyncForDatatype( - syncable::ModelType datatype) { + syncer::ModelType datatype) { DVLOG(1) << GetClientInfoString( "DisableSyncForDatatype(" - + std::string(syncable::ModelTypeToString(datatype)) + ")"); + + std::string(syncer::ModelTypeToString(datatype)) + ")"); if (service() == NULL) { LOG(ERROR) << "DisableSyncForDatatype(): service() is null."; return false; } - syncable::ModelTypeSet synced_datatypes = - service()->GetPreferredDataTypes(); + syncer::ModelTypeSet synced_datatypes = service()->GetPreferredDataTypes(); if (!synced_datatypes.Has(datatype)) { DVLOG(1) << "DisableSyncForDatatype(): Sync already disabled for datatype " - << syncable::ModelTypeToString(datatype) + << syncer::ModelTypeToString(datatype) << " on " << profile_debug_name_ << "."; return true; } @@ -935,7 +933,7 @@ bool ProfileSyncServiceHarness::DisableSyncForDatatype( service()->OnUserChoseDatatypes(false, synced_datatypes); if (AwaitFullSyncCompletion("Datatype reconfiguration.")) { DVLOG(1) << "DisableSyncForDatatype(): Disabled sync for datatype " - << syncable::ModelTypeToString(datatype) + << syncer::ModelTypeToString(datatype) << " on " << profile_debug_name_ << "."; return true; } @@ -956,7 +954,7 @@ bool ProfileSyncServiceHarness::EnableSyncForAllDatatypes() { return false; } - service()->OnUserChoseDatatypes(true, syncable::ModelTypeSet::All()); + service()->OnUserChoseDatatypes(true, syncer::ModelTypeSet::All()); if (AwaitFullSyncCompletion("Datatype reconfiguration.")) { DVLOG(1) << "EnableSyncForAllDatatypes(): Enabled sync for all datatypes " << "on " << profile_debug_name_ << "."; @@ -983,7 +981,7 @@ bool ProfileSyncServiceHarness::DisableSyncForAllDatatypes() { } std::string ProfileSyncServiceHarness::GetUpdatedTimestamp( - syncable::ModelType model_type) { + syncer::ModelType model_type) { const SyncSessionSnapshot& snap = GetLastSessionSnapshot(); return snap.download_progress_markers()[model_type]; } @@ -1031,8 +1029,8 @@ std::string ProfileSyncServiceHarness::GetClientInfoString( // TODO(zea): Rename this EnableEncryption, since we no longer turn on // encryption for individual types but for all. bool ProfileSyncServiceHarness::EnableEncryptionForType( - syncable::ModelType type) { - const syncable::ModelTypeSet encrypted_types = + syncer::ModelType type) { + const syncer::ModelTypeSet encrypted_types = service_->GetEncryptedDataTypes(); if (encrypted_types.Has(type)) return true; @@ -1040,18 +1038,17 @@ bool ProfileSyncServiceHarness::EnableEncryptionForType( // In order to kick off the encryption we have to reconfigure. Just grab the // currently synced types and use them. - const syncable::ModelTypeSet synced_datatypes = + const syncer::ModelTypeSet synced_datatypes = service_->GetPreferredDataTypes(); bool sync_everything = - synced_datatypes.Equals(syncable::ModelTypeSet::All()); + synced_datatypes.Equals(syncer::ModelTypeSet::All()); service_->OnUserChoseDatatypes(sync_everything, synced_datatypes); // Wait some time to let the enryption finish. return WaitForTypeEncryption(type); } -bool ProfileSyncServiceHarness::WaitForTypeEncryption( - syncable::ModelType type) { +bool ProfileSyncServiceHarness::WaitForTypeEncryption(syncer::ModelType type) { // The correctness of this if condition depends on the ordering of its // sub-expressions. See crbug.com/95619. // TODO(rlarocque): Figure out a less brittle way of detecting this. @@ -1074,25 +1071,25 @@ bool ProfileSyncServiceHarness::WaitForTypeEncryption( return IsTypeEncrypted(type); } -bool ProfileSyncServiceHarness::IsTypeEncrypted(syncable::ModelType type) { - const syncable::ModelTypeSet encrypted_types = +bool ProfileSyncServiceHarness::IsTypeEncrypted(syncer::ModelType type) { + const syncer::ModelTypeSet encrypted_types = service_->GetEncryptedDataTypes(); bool is_type_encrypted = service_->GetEncryptedDataTypes().Has(type); - DVLOG(2) << syncable::ModelTypeToString(type) << " is " + DVLOG(2) << syncer::ModelTypeToString(type) << " is " << (is_type_encrypted ? "" : "not ") << "encrypted; " << "encrypted types = " - << syncable::ModelTypeSetToString(encrypted_types); + << syncer::ModelTypeSetToString(encrypted_types); return is_type_encrypted; } -bool ProfileSyncServiceHarness::IsTypeRunning(syncable::ModelType type) { +bool ProfileSyncServiceHarness::IsTypeRunning(syncer::ModelType type) { browser_sync::DataTypeController::StateMap state_map; service_->GetDataTypeControllerStates(&state_map); return (state_map.count(type) != 0 && state_map[type] == browser_sync::DataTypeController::RUNNING); } -bool ProfileSyncServiceHarness::IsTypePreferred(syncable::ModelType type) { +bool ProfileSyncServiceHarness::IsTypePreferred(syncer::ModelType type) { return service_->GetPreferredDataTypes().Has(type); } diff --git a/chrome/browser/sync/profile_sync_service_harness.h b/chrome/browser/sync/profile_sync_service_harness.h index 4b17ca0..9eac2c1 100644 --- a/chrome/browser/sync/profile_sync_service_harness.h +++ b/chrome/browser/sync/profile_sync_service_harness.h @@ -59,7 +59,7 @@ class ProfileSyncServiceHarness // Same as the above method, but enables sync only for the datatypes contained // in |synced_datatypes|. - bool SetupSync(syncable::ModelTypeSet synced_datatypes); + bool SetupSync(syncer::ModelTypeSet synced_datatypes); // ProfileSyncServiceObserver implementation. virtual void OnStateChanged() OVERRIDE; @@ -102,7 +102,7 @@ class ProfileSyncServiceHarness bool AwaitActionableError(); // Blocks until the given set of data types are migrated. - bool AwaitMigration(syncable::ModelTypeSet expected_migrated_types); + bool AwaitMigration(syncer::ModelTypeSet expected_migrated_types); // Blocks the caller until this harness has observed that the sync engine // has downloaded all the changes seen by the |partner| harness's client. @@ -149,10 +149,10 @@ class ProfileSyncServiceHarness bool ServiceIsPushingChanges() { return service_->ShouldPushChanges(); } // Enables sync for a particular sync datatype. Returns true on success. - bool EnableSyncForDatatype(syncable::ModelType datatype); + bool EnableSyncForDatatype(syncer::ModelType datatype); // Disables sync for a particular sync datatype. Returns true on success. - bool DisableSyncForDatatype(syncable::ModelType datatype); + bool DisableSyncForDatatype(syncer::ModelType datatype); // Enables sync for all sync datatypes. Returns true on success. bool EnableSyncForAllDatatypes(); @@ -168,22 +168,22 @@ class ProfileSyncServiceHarness // PostCondition: // returns: True if |type| was encrypted and we are fully synced. // False if we timed out. - bool EnableEncryptionForType(syncable::ModelType type); + bool EnableEncryptionForType(syncer::ModelType type); // Wait until |type| is encrypted or we time out. // PostCondition: // returns: True if |type| is currently encrypted and we are fully synced. // False if we timed out. - bool WaitForTypeEncryption(syncable::ModelType type); + bool WaitForTypeEncryption(syncer::ModelType type); // Check if |type| is encrypted. - bool IsTypeEncrypted(syncable::ModelType type); + bool IsTypeEncrypted(syncer::ModelType type); // Check if |type| is registered and the controller is running. - bool IsTypeRunning(syncable::ModelType type); + bool IsTypeRunning(syncer::ModelType type); // Check if |type| is being synced. - bool IsTypePreferred(syncable::ModelType type); + bool IsTypePreferred(syncer::ModelType type); // Get the number of sync entries this client has. This includes all top // level or permanent items, and can include recently deleted entries. @@ -317,14 +317,14 @@ class ProfileSyncServiceHarness // Gets the current progress indicator of the current sync session // for a particular datatype. - std::string GetUpdatedTimestamp(syncable::ModelType model_type); + std::string GetUpdatedTimestamp(syncer::ModelType model_type); // Gets detailed status from |service_| in pretty-printable form. std::string GetServiceStatus(); // When in WAITING_FOR_ENCRYPTION state, we check to see if this type is now // encrypted to determine if we're done. - syncable::ModelType waiting_for_encryption_type_; + syncer::ModelType waiting_for_encryption_type_; // The WaitState in which the sync client currently is. Helps determine what // action to take when RunStateChangeMachine() is called. @@ -346,11 +346,11 @@ class ProfileSyncServiceHarness // The current set of data types pending migration. Used by // AwaitMigration(). - syncable::ModelTypeSet pending_migration_types_; + syncer::ModelTypeSet pending_migration_types_; // The set of data types that have undergone migration. Used by // AwaitMigration(). - syncable::ModelTypeSet migrated_types_; + syncer::ModelTypeSet migrated_types_; // Used for logging. const std::string profile_debug_name_; diff --git a/chrome/browser/sync/profile_sync_service_mock.h b/chrome/browser/sync/profile_sync_service_mock.h index 1a0578f..fd6f454 100644 --- a/chrome/browser/sync/profile_sync_service_mock.h +++ b/chrome/browser/sync/profile_sync_service_mock.h @@ -49,19 +49,19 @@ class ProfileSyncServiceMock : public ProfileSyncService { MOCK_CONST_METHOD0(GetAuthenticatedUsername, string16()); MOCK_METHOD2(OnUserChoseDatatypes, void(bool sync_everything, - syncable::ModelTypeSet chosen_types)); + syncer::ModelTypeSet chosen_types)); MOCK_METHOD2(OnUnrecoverableError, void(const tracked_objects::Location& location, const std::string& message)); - MOCK_METHOD3(DisableBrokenDatatype, void(syncable::ModelType, + MOCK_METHOD3(DisableBrokenDatatype, void(syncer::ModelType, const tracked_objects::Location&, std::string message)); MOCK_CONST_METHOD0(GetUserShare, syncer::UserShare*()); MOCK_METHOD3(ActivateDataType, - void(syncable::ModelType, syncer::ModelSafeGroup, + void(syncer::ModelType, syncer::ModelSafeGroup, browser_sync::ChangeProcessor*)); - MOCK_METHOD1(DeactivateDataType, void(syncable::ModelType)); + MOCK_METHOD1(DeactivateDataType, void(syncer::ModelType)); MOCK_METHOD0(InitializeBackend, void()); MOCK_METHOD1(AddObserver, void(Observer*)); @@ -73,9 +73,9 @@ class ProfileSyncServiceMock : public ProfileSyncService { MOCK_METHOD0(EnableEncryptEverything, void()); MOCK_METHOD1(ChangePreferredDataTypes, - void(syncable::ModelTypeSet preferred_types)); - MOCK_CONST_METHOD0(GetPreferredDataTypes, syncable::ModelTypeSet()); - MOCK_CONST_METHOD0(GetRegisteredDataTypes, syncable::ModelTypeSet()); + void(syncer::ModelTypeSet preferred_types)); + MOCK_CONST_METHOD0(GetPreferredDataTypes, syncer::ModelTypeSet()); + MOCK_CONST_METHOD0(GetRegisteredDataTypes, syncer::ModelTypeSet()); MOCK_CONST_METHOD0(GetLastSessionSnapshot, syncer::sessions::SyncSessionSnapshot()); diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc index f02bb22..81d2f1c 100644 --- a/chrome/browser/sync/profile_sync_service_password_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc @@ -125,7 +125,7 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest { syncer::WriteNode node(&trans); std::string tag = PasswordModelAssociator::MakeTag(entry); syncer::WriteNode::InitUniqueByCreationResult result = - node.InitUniqueByCreation(syncable::PASSWORDS, password_root, tag); + node.InitUniqueByCreation(syncer::PASSWORDS, password_root, tag); ASSERT_EQ(syncer::WriteNode::INIT_SUCCESS, result); PasswordModelAssociator::WriteToSyncNode(entry, &node); } @@ -181,9 +181,8 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest { service_.reset(new PasswordTestProfileSyncService( factory, &profile_, signin, false, root_callback, node_callback)); - syncable::ModelTypeSet preferred_types = - service_->GetPreferredDataTypes(); - preferred_types.Put(syncable::PASSWORDS); + syncer::ModelTypeSet preferred_types = service_->GetPreferredDataTypes(); + preferred_types.Put(syncer::PASSWORDS); service_->ChangePreferredDataTypes(preferred_types); PasswordDataTypeController* data_type_controller = new PasswordDataTypeController(factory, @@ -289,7 +288,7 @@ TEST_F(ProfileSyncServicePasswordTest, EmptyNativeEmptySync) { EXPECT_CALL(*password_store_, FillBlacklistLogins(_)) .WillOnce(Return(true)); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::PASSWORDS); + CreateRootHelper create_root(this, syncer::PASSWORDS); StartSyncService(create_root.callback(), base::Closure()); std::vector<PasswordForm> sync_entries; GetPasswordEntriesFromSyncDB(&sync_entries); @@ -319,7 +318,7 @@ TEST_F(ProfileSyncServicePasswordTest, HasNativeEntriesEmptySync) { EXPECT_CALL(*password_store_, FillBlacklistLogins(_)) .WillOnce(Return(true)); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::PASSWORDS); + CreateRootHelper create_root(this, syncer::PASSWORDS); StartSyncService(create_root.callback(), base::Closure()); std::vector<PasswordForm> sync_forms; GetPasswordEntriesFromSyncDB(&sync_forms); @@ -371,7 +370,7 @@ TEST_F(ProfileSyncServicePasswordTest, HasNativeEntriesEmptySyncSameUsername) { EXPECT_CALL(*password_store_, FillBlacklistLogins(_)) .WillOnce(Return(true)); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::PASSWORDS); + CreateRootHelper create_root(this, syncer::PASSWORDS); StartSyncService(create_root.callback(), base::Closure()); std::vector<PasswordForm> sync_forms; GetPasswordEntriesFromSyncDB(&sync_forms); @@ -426,7 +425,7 @@ TEST_F(ProfileSyncServicePasswordTest, HasNativeHasSyncNoMerge) { EXPECT_CALL(*password_store_, FillBlacklistLogins(_)).WillOnce(Return(true)); EXPECT_CALL(*password_store_, AddLoginImpl(_)).Times(1); - CreateRootHelper create_root(this, syncable::PASSWORDS); + CreateRootHelper create_root(this, syncer::PASSWORDS); StartSyncService(create_root.callback(), base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); @@ -491,7 +490,7 @@ TEST_F(ProfileSyncServicePasswordTest, EnsureNoTransactions) { EXPECT_CALL(*password_store_, AddLoginImpl(_)) .WillOnce(AcquireSyncTransaction(this)); - CreateRootHelper create_root(this, syncable::PASSWORDS); + CreateRootHelper create_root(this, syncer::PASSWORDS); StartSyncService(create_root.callback(), base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); @@ -564,7 +563,7 @@ TEST_F(ProfileSyncServicePasswordTest, HasNativeHasSyncMergeEntry) { EXPECT_CALL(*password_store_, FillBlacklistLogins(_)).WillOnce(Return(true)); EXPECT_CALL(*password_store_, UpdateLoginImpl(_)).Times(1); - CreateRootHelper create_root(this, syncable::PASSWORDS); + CreateRootHelper create_root(this, syncer::PASSWORDS); StartSyncService(create_root.callback(), base::Bind(&AddPasswordEntriesCallback, this, sync_forms)); diff --git a/chrome/browser/sync/profile_sync_service_preference_unittest.cc b/chrome/browser/sync/profile_sync_service_preference_unittest.cc index ddc13ff..1de3d45 100644 --- a/chrome/browser/sync/profile_sync_service_preference_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_preference_unittest.cc @@ -63,21 +63,21 @@ class ProfileSyncServicePreferenceTest int64 SetSyncedValue(const std::string& name, const Value& value) { syncer::WriteTransaction trans(FROM_HERE, service_->GetUserShare()); syncer::ReadNode root(&trans); - if (root.InitByTagLookup(syncable::ModelTypeToRootTag( - syncable::PREFERENCES)) != syncer::BaseNode::INIT_OK) { + if (root.InitByTagLookup(syncer::ModelTypeToRootTag( + syncer::PREFERENCES)) != syncer::BaseNode::INIT_OK) { return syncer::kInvalidId; } syncer::WriteNode tag_node(&trans); syncer::WriteNode node(&trans); - if (tag_node.InitByClientTagLookup(syncable::PREFERENCES, name) == + if (tag_node.InitByClientTagLookup(syncer::PREFERENCES, name) == syncer::BaseNode::INIT_OK) { return WriteSyncedValue(name, value, &tag_node); } syncer::WriteNode::InitUniqueByCreationResult result = - node.InitUniqueByCreation(syncable::PREFERENCES, root, name); + node.InitUniqueByCreation(syncer::PREFERENCES, root, name); if (result == syncer::WriteNode::INIT_SUCCESS) return WriteSyncedValue(name, value, &node); @@ -130,12 +130,12 @@ class ProfileSyncServicePreferenceTest prefs_->GetSyncableService()); if (!pref_sync_service_) return false; - EXPECT_CALL(*factory, GetSyncableServiceForType(syncable::PREFERENCES)). + EXPECT_CALL(*factory, GetSyncableServiceForType(syncer::PREFERENCES)). WillOnce(Return(pref_sync_service_->AsWeakPtr())); EXPECT_CALL(*factory, CreateDataTypeManager(_, _)). WillOnce(ReturnNewDataTypeManager()); - dtc_ = new UIDataTypeController(syncable::PREFERENCES, + dtc_ = new UIDataTypeController(syncer::PREFERENCES, factory, profile_.get(), service_.get()); @@ -163,7 +163,7 @@ class ProfileSyncServicePreferenceTest syncer::ReadTransaction trans(FROM_HERE, service_->GetUserShare()); syncer::ReadNode node(&trans); - if (node.InitByClientTagLookup(syncable::PREFERENCES, name) != + if (node.InitByClientTagLookup(syncer::PREFERENCES, name) != syncer::BaseNode::INIT_OK) { return NULL; } @@ -230,7 +230,7 @@ class AddPreferenceEntriesHelper { private: void AddPreferenceEntriesCallback(ProfileSyncServicePreferenceTest* test, const PreferenceValues& entries) { - if (!test->CreateRoot(syncable::PREFERENCES)) + if (!test->CreateRoot(syncer::PREFERENCES)) return; for (PreferenceValues::const_iterator i = entries.begin(); @@ -247,7 +247,7 @@ class AddPreferenceEntriesHelper { TEST_F(ProfileSyncServicePreferenceTest, CreatePrefSyncData) { prefs_->SetString(prefs::kHomePage, example_url0_); - CreateRootHelper create_root(this, syncable::PREFERENCES); + CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); @@ -269,7 +269,7 @@ TEST_F(ProfileSyncServicePreferenceTest, ModelAssociationDoNotSyncDefaults) { const PrefService::Preference* pref = prefs_->FindPreference(prefs::kHomePage); EXPECT_TRUE(pref->IsDefaultValue()); - CreateRootHelper create_root(this, syncable::PREFERENCES); + CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); EXPECT_TRUE(IsSynced(prefs::kHomePage)); @@ -286,7 +286,7 @@ TEST_F(ProfileSyncServicePreferenceTest, ModelAssociationEmptyCloud) { url_list->Append(Value::CreateStringValue(example_url0_)); url_list->Append(Value::CreateStringValue(example_url1_)); } - CreateRootHelper create_root(this, syncable::PREFERENCES); + CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); @@ -359,7 +359,7 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedPreferenceWithDefaultValue) { prefs_->FindPreference(prefs::kHomePage); EXPECT_TRUE(pref->IsDefaultValue()); - CreateRootHelper create_root(this, syncable::PREFERENCES); + CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); @@ -373,7 +373,7 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedPreferenceWithDefaultValue) { TEST_F(ProfileSyncServicePreferenceTest, UpdatedPreferenceWithValue) { profile_->GetPrefs()->SetString(prefs::kHomePage, example_url0_); - CreateRootHelper create_root(this, syncable::PREFERENCES); + CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); @@ -387,7 +387,7 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedPreferenceWithValue) { TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeActionUpdate) { profile_->GetPrefs()->SetString(prefs::kHomePage, example_url0_); - CreateRootHelper create_root(this, syncable::PREFERENCES); + CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); @@ -408,7 +408,7 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeActionUpdate) { } TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeActionAdd) { - CreateRootHelper create_root(this, syncable::PREFERENCES); + CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); @@ -431,7 +431,7 @@ TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeActionAdd) { } TEST_F(ProfileSyncServicePreferenceTest, UpdatedSyncNodeUnknownPreference) { - CreateRootHelper create_root(this, syncable::PREFERENCES); + CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); @@ -457,7 +457,7 @@ TEST_F(ProfileSyncServicePreferenceTest, ManagedPreferences) { Value::CreateStringValue("http://example.com")); prefs_->SetManagedPref(prefs::kHomePage, managed_value->DeepCopy()); - CreateRootHelper create_root(this, syncable::PREFERENCES); + CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); @@ -487,7 +487,7 @@ TEST_F(ProfileSyncServicePreferenceTest, ManagedPreferences) { } TEST_F(ProfileSyncServicePreferenceTest, DynamicManagedPreferences) { - CreateRootHelper create_root(this, syncable::PREFERENCES); + CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); @@ -515,7 +515,7 @@ TEST_F(ProfileSyncServicePreferenceTest, DynamicManagedPreferences) { TEST_F(ProfileSyncServicePreferenceTest, DynamicManagedPreferencesWithSyncChange) { - CreateRootHelper create_root(this, syncable::PREFERENCES); + CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); @@ -559,7 +559,7 @@ TEST_F(ProfileSyncServicePreferenceTest, DynamicManagedDefaultPreferences) { const PrefService::Preference* pref = prefs_->FindPreference(prefs::kHomePage); EXPECT_TRUE(pref->IsDefaultValue()); - CreateRootHelper create_root(this, syncable::PREFERENCES); + CreateRootHelper create_root(this, syncer::PREFERENCES); ASSERT_TRUE(StartSyncService(create_root.callback(), false)); ASSERT_TRUE(create_root.success()); EXPECT_TRUE(IsSynced(prefs::kHomePage)); diff --git a/chrome/browser/sync/profile_sync_service_session_unittest.cc b/chrome/browser/sync/profile_sync_service_session_unittest.cc index 4faed6a..b7508e3 100644 --- a/chrome/browser/sync/profile_sync_service_session_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_session_unittest.cc @@ -288,7 +288,7 @@ class CreateRootHelper { private: void CreateRootCallback(ProfileSyncServiceSessionTest* test) { success_ = ProfileSyncServiceTestHelper::CreateRoot( - syncable::SESSIONS, test->sync_service()->GetUserShare(), test->ids()); + syncer::SESSIONS, test->sync_service()->GetUserShare(), test->ids()); } base::Closure callback_; @@ -313,7 +313,7 @@ TEST_F(ProfileSyncServiceSessionTest, WriteSessionToNode) { syncer::ReadTransaction trans(FROM_HERE, sync_service_->GetUserShare()); syncer::ReadNode node(&trans); ASSERT_EQ(syncer::BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::SESSIONS, machine_tag)); + node.InitByClientTagLookup(syncer::SESSIONS, machine_tag)); const sync_pb::SessionSpecifics& specifics(node.GetSessionSpecifics()); ASSERT_EQ(machine_tag, specifics.session_tag()); ASSERT_TRUE(specifics.has_header()); @@ -1022,10 +1022,10 @@ TEST_F(ProfileSyncServiceSessionTest, DISABLED_MissingHeaderAndTab) { // Create a sync node with the local tag but neither header nor tab field. syncer::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare()); syncer::ReadNode root(&trans); - root.InitByTagLookup(syncable::ModelTypeToRootTag(syncable::SESSIONS)); + root.InitByTagLookup(syncer::ModelTypeToRootTag(syncer::SESSIONS)); syncer::WriteNode extra_header(&trans); syncer::WriteNode::InitUniqueByCreationResult result = - extra_header.InitUniqueByCreation(syncable::SESSIONS, root, "new_tag"); + extra_header.InitUniqueByCreation(syncer::SESSIONS, root, "new_tag"); ASSERT_EQ(syncer::WriteNode::INIT_SUCCESS, result); sync_pb::SessionSpecifics specifics; specifics.set_session_tag(local_tag); @@ -1053,10 +1053,10 @@ TEST_F(ProfileSyncServiceSessionTest, DISABLED_MultipleHeaders) { // Create another sync node with a header field and the local tag. syncer::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare()); syncer::ReadNode root(&trans); - root.InitByTagLookup(syncable::ModelTypeToRootTag(syncable::SESSIONS)); + root.InitByTagLookup(syncer::ModelTypeToRootTag(syncer::SESSIONS)); syncer::WriteNode extra_header(&trans); syncer::WriteNode::InitUniqueByCreationResult result = - extra_header.InitUniqueByCreation(syncable::SESSIONS, + extra_header.InitUniqueByCreation(syncer::SESSIONS, root, local_tag + "_"); ASSERT_EQ(syncer::WriteNode::INIT_SUCCESS, result); sync_pb::SessionSpecifics specifics; @@ -1086,10 +1086,10 @@ TEST_F(ProfileSyncServiceSessionTest, DISABLED_CorruptedForeign) { std::string foreign_tag = "foreign_tag"; syncer::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare()); syncer::ReadNode root(&trans); - root.InitByTagLookup(syncable::ModelTypeToRootTag(syncable::SESSIONS)); + root.InitByTagLookup(syncer::ModelTypeToRootTag(syncer::SESSIONS)); syncer::WriteNode extra_header(&trans); syncer::WriteNode::InitUniqueByCreationResult result = - extra_header.InitUniqueByCreation(syncable::SESSIONS, + extra_header.InitUniqueByCreation(syncer::SESSIONS, root, foreign_tag); ASSERT_EQ(syncer::WriteNode::INIT_SUCCESS, result); sync_pb::SessionSpecifics specifics; @@ -1119,9 +1119,9 @@ TEST_F(ProfileSyncServiceSessionTest, DISABLED_MissingLocalTabNode) { syncer::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare()); syncer::ReadNode root(&trans); - root.InitByTagLookup(syncable::ModelTypeToRootTag(syncable::SESSIONS)); + root.InitByTagLookup(syncer::ModelTypeToRootTag(syncer::SESSIONS)); syncer::WriteNode tab_node(&trans); - ASSERT_TRUE(tab_node.InitByClientTagLookup(syncable::SESSIONS, tab_tag)); + ASSERT_TRUE(tab_node.InitByClientTagLookup(syncer::SESSIONS, tab_tag)); tab_node.Remove(); } error = model_associator_->AssociateModels(); @@ -1191,7 +1191,7 @@ TEST_F(ProfileSyncServiceSessionTest, DISABLED_CorruptedLocalHeader) { syncer::WriteTransaction trans(FROM_HERE, sync_service_->GetUserShare()); syncer::WriteNode header(&trans); ASSERT_EQ(syncer::BaseNode::INIT_OK, - header.InitByClientTagLookup(syncable::SESSIONS, local_tag)); + header.InitByClientTagLookup(syncer::SESSIONS, local_tag)); sync_pb::SessionSpecifics specifics; header.SetSessionSpecifics(specifics); } diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc index 9126b2b..64956d8 100644 --- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc @@ -299,14 +299,14 @@ TEST_F(ProfileSyncServiceStartupTest, StartFailure) { DataTypeManagerMock* data_type_manager = SetUpDataTypeManager(); DataTypeManager::ConfigureStatus status = DataTypeManager::ABORTED; syncer::SyncError error( - FROM_HERE, "Association failed.", syncable::BOOKMARKS); + FROM_HERE, "Association failed.", syncer::BOOKMARKS); std::list<syncer::SyncError> errors; errors.push_back(error); browser_sync::DataTypeManager::ConfigureResult result( status, - syncable::ModelTypeSet(), + syncer::ModelTypeSet(), errors, - syncable::ModelTypeSet()); + syncer::ModelTypeSet()); EXPECT_CALL(*data_type_manager, Configure(_, _)). WillRepeatedly( DoAll( diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc index 06d480a..14cda1d 100644 --- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc @@ -152,7 +152,7 @@ class ProfileSyncServiceTypedUrlTest : public AbstractProfileSyncServiceTest { syncer::WriteNode node(&trans); std::string tag = url.url().spec(); syncer::WriteNode::InitUniqueByCreationResult result = - node.InitUniqueByCreation(syncable::TYPED_URLS, typed_url_root, tag); + node.InitUniqueByCreation(syncer::TYPED_URLS, typed_url_root, tag); ASSERT_EQ(syncer::WriteNode::INIT_SUCCESS, result); TypedUrlModelAssociator::WriteToSyncNode(url, visits, &node); } @@ -310,7 +310,7 @@ class ProfileSyncServiceTypedUrlTest : public AbstractProfileSyncServiceTest { void AddTypedUrlEntries(ProfileSyncServiceTypedUrlTest* test, const history::URLRows& entries) { - test->CreateRoot(syncable::TYPED_URLS); + test->CreateRoot(syncer::TYPED_URLS); for (size_t i = 0; i < entries.size(); ++i) { history::VisitVector visits; visits.push_back(history::VisitRow( @@ -326,7 +326,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, EmptyNativeEmptySync) { EXPECT_CALL((*history_backend_.get()), GetAllTypedURLs(_)). WillOnce(Return(true)); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); TypedUrlModelAssociator* associator = StartSyncService(create_root.callback()); history::URLRows sync_entries; @@ -346,7 +346,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, HasNativeEmptySync) { EXPECT_CALL((*history_backend_.get()), GetMostRecentVisitsForURL(_, _, _)). WillRepeatedly(DoAll(SetArgumentPointee<2>(visits), Return(true))); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); TypedUrlModelAssociator* associator = StartSyncService(create_root.callback()); history::URLRows sync_entries; @@ -375,7 +375,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, HasNativeErrorReadingVisits) { GetMostRecentVisitsForURL(native_entry2.id(), _, _)). WillRepeatedly(Return(false)); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); StartSyncService(create_root.callback()); history::URLRows sync_entries; GetTypedUrlsFromSyncDB(&sync_entries); @@ -396,7 +396,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, HasNativeWithBlankEmptySync) { EXPECT_CALL((*history_backend_.get()), GetMostRecentVisitsForURL(_, _, _)). WillRepeatedly(DoAll(SetArgumentPointee<2>(visits), Return(true))); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); StartSyncService(create_root.callback()); std::vector<history::URLRow> sync_entries; GetTypedUrlsFromSyncDB(&sync_entries); @@ -545,7 +545,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeAdd) { WillOnce(DoAll(SetArgumentPointee<2>(added_visits), Return(true))); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); StartSyncService(create_root.callback()); history::URLsModifiedDetails details; @@ -574,7 +574,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeAddWithBlank) { WillRepeatedly(DoAll(SetArgumentPointee<2>(added_visits), Return(true))); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); StartSyncService(create_root.callback()); history::URLsModifiedDetails details; @@ -604,7 +604,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeUpdate) { EXPECT_CALL((*history_backend_.get()), GetMostRecentVisitsForURL(_, _, _)). WillOnce(DoAll(SetArgumentPointee<2>(original_visits), Return(true))); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); StartSyncService(create_root.callback()); history::VisitVector updated_visits; @@ -639,7 +639,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeAddFromVisit) { WillOnce(DoAll(SetArgumentPointee<2>(added_visits), Return(true))); SetIdleChangeProcessorExpectations(); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); StartSyncService(create_root.callback()); history::URLVisitedDetails details; @@ -669,7 +669,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeUpdateFromVisit) { EXPECT_CALL((*history_backend_.get()), GetMostRecentVisitsForURL(_, _, _)). WillOnce(DoAll(SetArgumentPointee<2>(original_visits), Return(true))); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); StartSyncService(create_root.callback()); history::VisitVector updated_visits; @@ -707,7 +707,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserIgnoreChangeUpdateFromVisit) { EXPECT_CALL((*history_backend_.get()), GetMostRecentVisitsForURL(_, _, _)). WillRepeatedly(DoAll(SetArgumentPointee<2>(original_visits), Return(true))); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); StartSyncService(create_root.callback()); history::URLRows new_sync_entries; GetTypedUrlsFromSyncDB(&new_sync_entries); @@ -783,7 +783,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeRemove) { EXPECT_CALL((*history_backend_.get()), GetMostRecentVisitsForURL(_, _, _)). WillRepeatedly(DoAll(SetArgumentPointee<2>(original_visits1), Return(true))); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); StartSyncService(create_root.callback()); history::URLsDeletedDetails changes; @@ -819,7 +819,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeRemoveArchive) { EXPECT_CALL((*history_backend_.get()), GetMostRecentVisitsForURL(_, _, _)). WillRepeatedly(DoAll(SetArgumentPointee<2>(original_visits1), Return(true))); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); StartSyncService(create_root.callback()); history::URLsDeletedDetails changes; @@ -857,7 +857,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, ProcessUserChangeRemoveAll) { EXPECT_CALL((*history_backend_.get()), GetMostRecentVisitsForURL(_, _, _)). WillRepeatedly(DoAll(SetArgumentPointee<2>(original_visits1), Return(true))); - CreateRootHelper create_root(this, syncable::TYPED_URLS); + CreateRootHelper create_root(this, syncer::TYPED_URLS); StartSyncService(create_root.callback()); history::URLRows new_sync_entries; @@ -905,7 +905,7 @@ TEST_F(ProfileSyncServiceTypedUrlTest, FailWriteToHistoryBackend) { // unrecoverable error. ASSERT_FALSE( service_->failed_datatypes_handler().GetFailedTypes().Has( - syncable::TYPED_URLS)); + syncer::TYPED_URLS)); // Some calls should have succeeded, so the error percentage should be // somewhere > 0 and < 100. ASSERT_NE(0, associator->GetErrorPercentage()); @@ -931,13 +931,13 @@ TEST_F(ProfileSyncServiceTypedUrlTest, FailToGetTypedURLs) { EXPECT_CALL(error_handler_, CreateAndUploadError(_, _, _)). WillOnce(Return(syncer::SyncError(FROM_HERE, "Unit test", - syncable::TYPED_URLS))); + syncer::TYPED_URLS))); StartSyncService(base::Bind(&AddTypedUrlEntries, this, sync_entries)); // Errors getting typed URLs will cause an unrecoverable error (since we can // do *nothing* in that case). ASSERT_TRUE( service_->failed_datatypes_handler().GetFailedTypes().Has( - syncable::TYPED_URLS)); + syncer::TYPED_URLS)); ASSERT_EQ( 1u, service_->failed_datatypes_handler().GetFailedTypes().Size()); // Can't check GetErrorPercentage(), because generating an unrecoverable diff --git a/chrome/browser/sync/sync_prefs.cc b/chrome/browser/sync/sync_prefs.cc index 5966ea0..519cb0e 100644 --- a/chrome/browser/sync/sync_prefs.cc +++ b/chrome/browser/sync/sync_prefs.cc @@ -119,26 +119,26 @@ void SyncPrefs::SetKeepEverythingSynced(bool keep_everything_synced) { keep_everything_synced); } -syncable::ModelTypeSet SyncPrefs::GetPreferredDataTypes( - syncable::ModelTypeSet registered_types) const { +syncer::ModelTypeSet SyncPrefs::GetPreferredDataTypes( + syncer::ModelTypeSet registered_types) const { DCHECK(CalledOnValidThread()); if (!pref_service_) { - return syncable::ModelTypeSet(); + return syncer::ModelTypeSet(); } // First remove any datatypes that are inconsistent with the current policies // on the client (so that "keep everything synced" doesn't include them). if (pref_service_->HasPrefPath(prefs::kSavingBrowserHistoryDisabled) && pref_service_->GetBoolean(prefs::kSavingBrowserHistoryDisabled)) { - registered_types.Remove(syncable::TYPED_URLS); + registered_types.Remove(syncer::TYPED_URLS); } if (pref_service_->GetBoolean(prefs::kSyncKeepEverythingSynced)) { return registered_types; } - syncable::ModelTypeSet preferred_types; - for (syncable::ModelTypeSet::Iterator it = registered_types.First(); + syncer::ModelTypeSet preferred_types; + for (syncer::ModelTypeSet::Iterator it = registered_types.First(); it.Good(); it.Inc()) { if (GetDataTypePreferred(it.Get())) { preferred_types.Put(it.Get()); @@ -148,13 +148,13 @@ syncable::ModelTypeSet SyncPrefs::GetPreferredDataTypes( } void SyncPrefs::SetPreferredDataTypes( - syncable::ModelTypeSet registered_types, - syncable::ModelTypeSet preferred_types) { + syncer::ModelTypeSet registered_types, + syncer::ModelTypeSet preferred_types) { DCHECK(CalledOnValidThread()); CHECK(pref_service_); DCHECK(registered_types.HasAll(preferred_types)); preferred_types = ResolvePrefGroups(registered_types, preferred_types); - for (syncable::ModelTypeSet::Iterator i = registered_types.First(); + for (syncer::ModelTypeSet::Iterator i = registered_types.First(); i.Good(); i.Inc()) { SetDataTypePreferred(i.Get(), preferred_types.Has(i.Get())); } @@ -190,19 +190,18 @@ void SyncPrefs::SetSpareBootstrapToken(const std::string& token) { } #endif -void SyncPrefs::AcknowledgeSyncedTypes( - syncable::ModelTypeSet types) { +void SyncPrefs::AcknowledgeSyncedTypes(syncer::ModelTypeSet types) { DCHECK(CalledOnValidThread()); CHECK(pref_service_); // Add the types to the current set of acknowledged // types, and then store the resulting set in prefs. - const syncable::ModelTypeSet acknowledged_types = + const syncer::ModelTypeSet acknowledged_types = Union(types, - syncable::ModelTypeSetFromValue( + syncer::ModelTypeSetFromValue( *pref_service_->GetList(prefs::kSyncAcknowledgedSyncTypes))); scoped_ptr<ListValue> value( - syncable::ModelTypeSetToValue(acknowledged_types)); + syncer::ModelTypeSetToValue(acknowledged_types)); pref_service_->Set(prefs::kSyncAcknowledgedSyncTypes, *value); } @@ -233,46 +232,46 @@ void SyncPrefs::SetManagedForTest(bool is_managed) { pref_service_->SetBoolean(prefs::kSyncManaged, is_managed); } -syncable::ModelTypeSet SyncPrefs::GetAcknowledgeSyncedTypesForTest() const { +syncer::ModelTypeSet SyncPrefs::GetAcknowledgeSyncedTypesForTest() const { DCHECK(CalledOnValidThread()); if (!pref_service_) { - return syncable::ModelTypeSet(); + return syncer::ModelTypeSet(); } - return syncable::ModelTypeSetFromValue( + return syncer::ModelTypeSetFromValue( *pref_service_->GetList(prefs::kSyncAcknowledgedSyncTypes)); } namespace { -const char* GetPrefNameForDataType(syncable::ModelType data_type) { +const char* GetPrefNameForDataType(syncer::ModelType data_type) { switch (data_type) { - case syncable::BOOKMARKS: + case syncer::BOOKMARKS: return prefs::kSyncBookmarks; - case syncable::PASSWORDS: + case syncer::PASSWORDS: return prefs::kSyncPasswords; - case syncable::PREFERENCES: + case syncer::PREFERENCES: return prefs::kSyncPreferences; - case syncable::AUTOFILL: + case syncer::AUTOFILL: return prefs::kSyncAutofill; - case syncable::AUTOFILL_PROFILE: + case syncer::AUTOFILL_PROFILE: return prefs::kSyncAutofillProfile; - case syncable::THEMES: + case syncer::THEMES: return prefs::kSyncThemes; - case syncable::TYPED_URLS: + case syncer::TYPED_URLS: return prefs::kSyncTypedUrls; - case syncable::EXTENSION_SETTINGS: + case syncer::EXTENSION_SETTINGS: return prefs::kSyncExtensionSettings; - case syncable::EXTENSIONS: + case syncer::EXTENSIONS: return prefs::kSyncExtensions; - case syncable::APP_SETTINGS: + case syncer::APP_SETTINGS: return prefs::kSyncAppSettings; - case syncable::APPS: + case syncer::APPS: return prefs::kSyncApps; - case syncable::SEARCH_ENGINES: + case syncer::SEARCH_ENGINES: return prefs::kSyncSearchEngines; - case syncable::SESSIONS: + case syncer::SESSIONS: return prefs::kSyncSessions; - case syncable::APP_NOTIFICATIONS: + case syncer::APP_NOTIFICATIONS: return prefs::kSyncAppNotifications; default: break; @@ -284,14 +283,14 @@ const char* GetPrefNameForDataType(syncable::ModelType data_type) { } // namespace void SyncPrefs::RegisterPrefGroups() { - pref_groups_[syncable::APPS].Put(syncable::APP_NOTIFICATIONS); - pref_groups_[syncable::APPS].Put(syncable::APP_SETTINGS); + pref_groups_[syncer::APPS].Put(syncer::APP_NOTIFICATIONS); + pref_groups_[syncer::APPS].Put(syncer::APP_SETTINGS); - pref_groups_[syncable::AUTOFILL].Put(syncable::AUTOFILL_PROFILE); + pref_groups_[syncer::AUTOFILL].Put(syncer::AUTOFILL_PROFILE); - pref_groups_[syncable::EXTENSIONS].Put(syncable::EXTENSION_SETTINGS); + pref_groups_[syncer::EXTENSIONS].Put(syncer::EXTENSION_SETTINGS); - pref_groups_[syncable::PREFERENCES].Put(syncable::SEARCH_ENGINES); + pref_groups_[syncer::PREFERENCES].Put(syncer::SEARCH_ENGINES); } void SyncPrefs::RegisterPreferences() { @@ -327,11 +326,11 @@ void SyncPrefs::RegisterPreferences() { PrefService::UNSYNCABLE_PREF); // Treat bookmarks specially. - RegisterDataTypePreferredPref(syncable::BOOKMARKS, true); - for (int i = syncable::PREFERENCES; i < syncable::MODEL_TYPE_COUNT; ++i) { - const syncable::ModelType type = syncable::ModelTypeFromInt(i); + RegisterDataTypePreferredPref(syncer::BOOKMARKS, true); + for (int i = syncer::PREFERENCES; i < syncer::MODEL_TYPE_COUNT; ++i) { + const syncer::ModelType type = syncer::ModelTypeFromInt(i); // Also treat nigori specially. - if (type == syncable::NIGORI) { + if (type == syncer::NIGORI) { continue; } RegisterDataTypePreferredPref(type, enable_by_default); @@ -352,25 +351,25 @@ void SyncPrefs::RegisterPreferences() { // We will start prompting people about new data types after the launch of // SESSIONS - all previously launched data types are treated as if they are // already acknowledged. - syncable::ModelTypeSet model_set; - model_set.Put(syncable::BOOKMARKS); - model_set.Put(syncable::PREFERENCES); - model_set.Put(syncable::PASSWORDS); - model_set.Put(syncable::AUTOFILL_PROFILE); - model_set.Put(syncable::AUTOFILL); - model_set.Put(syncable::THEMES); - model_set.Put(syncable::EXTENSIONS); - model_set.Put(syncable::NIGORI); - model_set.Put(syncable::SEARCH_ENGINES); - model_set.Put(syncable::APPS); - model_set.Put(syncable::TYPED_URLS); - model_set.Put(syncable::SESSIONS); + syncer::ModelTypeSet model_set; + model_set.Put(syncer::BOOKMARKS); + model_set.Put(syncer::PREFERENCES); + model_set.Put(syncer::PASSWORDS); + model_set.Put(syncer::AUTOFILL_PROFILE); + model_set.Put(syncer::AUTOFILL); + model_set.Put(syncer::THEMES); + model_set.Put(syncer::EXTENSIONS); + model_set.Put(syncer::NIGORI); + model_set.Put(syncer::SEARCH_ENGINES); + model_set.Put(syncer::APPS); + model_set.Put(syncer::TYPED_URLS); + model_set.Put(syncer::SESSIONS); pref_service_->RegisterListPref(prefs::kSyncAcknowledgedSyncTypes, - syncable::ModelTypeSetToValue(model_set), + syncer::ModelTypeSetToValue(model_set), PrefService::UNSYNCABLE_PREF); } -void SyncPrefs::RegisterDataTypePreferredPref(syncable::ModelType type, +void SyncPrefs::RegisterDataTypePreferredPref(syncer::ModelType type, bool is_preferred) { DCHECK(CalledOnValidThread()); CHECK(pref_service_); @@ -383,7 +382,7 @@ void SyncPrefs::RegisterDataTypePreferredPref(syncable::ModelType type, PrefService::UNSYNCABLE_PREF); } -bool SyncPrefs::GetDataTypePreferred(syncable::ModelType type) const { +bool SyncPrefs::GetDataTypePreferred(syncer::ModelType type) const { DCHECK(CalledOnValidThread()); if (!pref_service_) { return false; @@ -398,7 +397,7 @@ bool SyncPrefs::GetDataTypePreferred(syncable::ModelType type) const { } void SyncPrefs::SetDataTypePreferred( - syncable::ModelType type, bool is_preferred) { + syncer::ModelType type, bool is_preferred) { DCHECK(CalledOnValidThread()); CHECK(pref_service_); const char* pref_name = GetPrefNameForDataType(type); @@ -409,11 +408,11 @@ void SyncPrefs::SetDataTypePreferred( pref_service_->SetBoolean(pref_name, is_preferred); } -syncable::ModelTypeSet SyncPrefs::ResolvePrefGroups( - syncable::ModelTypeSet registered_types, - syncable::ModelTypeSet types) const { +syncer::ModelTypeSet SyncPrefs::ResolvePrefGroups( + syncer::ModelTypeSet registered_types, + syncer::ModelTypeSet types) const { DCHECK(registered_types.HasAll(types)); - syncable::ModelTypeSet types_with_groups = types; + syncer::ModelTypeSet types_with_groups = types; for (PrefGroupsMap::const_iterator i = pref_groups_.begin(); i != pref_groups_.end(); ++i) { if (types.Has(i->first)) diff --git a/chrome/browser/sync/sync_prefs.h b/chrome/browser/sync/sync_prefs.h index 7844076..ea8e864 100644 --- a/chrome/browser/sync/sync_prefs.h +++ b/chrome/browser/sync/sync_prefs.h @@ -80,8 +80,8 @@ class SyncPrefs : NON_EXPORTED_BASE(public base::NonThreadSafe), // The returned set is guaranteed to be a subset of // |registered_types|. Returns |registered_types| directly if // HasKeepEverythingSynced() is true. - syncable::ModelTypeSet GetPreferredDataTypes( - syncable::ModelTypeSet registered_types) const; + syncer::ModelTypeSet GetPreferredDataTypes( + syncer::ModelTypeSet registered_types) const; // |preferred_types| should be a subset of |registered_types|. All // types in |preferred_types| are marked preferred, and all types in // |registered_types| \ |preferred_types| are marked not preferred. @@ -89,8 +89,8 @@ class SyncPrefs : NON_EXPORTED_BASE(public base::NonThreadSafe), // HasKeepEverythingSynced() is true, but won't be visible until // SetKeepEverythingSynced(false) is called. void SetPreferredDataTypes( - syncable::ModelTypeSet registered_types, - syncable::ModelTypeSet preferred_types); + syncer::ModelTypeSet registered_types, + syncer::ModelTypeSet preferred_types); // This pref is set outside of sync. bool IsManaged() const; @@ -107,7 +107,7 @@ class SyncPrefs : NON_EXPORTED_BASE(public base::NonThreadSafe), #endif // Merges the given set of types with the set of acknowledged types. - void AcknowledgeSyncedTypes(syncable::ModelTypeSet types); + void AcknowledgeSyncedTypes(syncer::ModelTypeSet types); // content::NotificationObserver implementation. virtual void Observe(int type, @@ -117,22 +117,22 @@ class SyncPrefs : NON_EXPORTED_BASE(public base::NonThreadSafe), // For testing. void SetManagedForTest(bool is_managed); - syncable::ModelTypeSet GetAcknowledgeSyncedTypesForTest() const; + syncer::ModelTypeSet GetAcknowledgeSyncedTypesForTest() const; private: void RegisterPrefGroups(); void RegisterPreferences(); void RegisterDataTypePreferredPref( - syncable::ModelType type, bool is_preferred); - bool GetDataTypePreferred(syncable::ModelType type) const; - void SetDataTypePreferred(syncable::ModelType type, bool is_preferred); + syncer::ModelType type, bool is_preferred); + bool GetDataTypePreferred(syncer::ModelType type) const; + void SetDataTypePreferred(syncer::ModelType type, bool is_preferred); // Returns a ModelTypeSet based on |types| expanded to include pref groups // (see |pref_groups_|), but as a subset of |registered_types|. - syncable::ModelTypeSet ResolvePrefGroups( - syncable::ModelTypeSet registered_types, - syncable::ModelTypeSet types) const; + syncer::ModelTypeSet ResolvePrefGroups( + syncer::ModelTypeSet registered_types, + syncer::ModelTypeSet types) const; // May be NULL. PrefService* const pref_service_; @@ -146,11 +146,11 @@ class SyncPrefs : NON_EXPORTED_BASE(public base::NonThreadSafe), // Groups of prefs that always have the same value as a "master" pref. // For example, the APPS group has {APP_NOTIFICATIONS, APP_SETTINGS} // (as well as APPS, but that is implied), so - // pref_groups_[syncable::APPS] = { syncable::APP_NOTIFICATIONS, - // syncable::APP_SETTINGS } - // pref_groups_[syncable::EXTENSIONS] = { syncable::EXTENSION_SETTINGS } + // pref_groups_[syncer::APPS] = { syncer::APP_NOTIFICATIONS, + // syncer::APP_SETTINGS } + // pref_groups_[syncer::EXTENSIONS] = { syncer::EXTENSION_SETTINGS } // etc. - typedef std::map<syncable::ModelType, syncable::ModelTypeSet> PrefGroupsMap; + typedef std::map<syncer::ModelType, syncer::ModelTypeSet> PrefGroupsMap; PrefGroupsMap pref_groups_; DISALLOW_COPY_AND_ASSIGN(SyncPrefs); diff --git a/chrome/browser/sync/sync_prefs_unittest.cc b/chrome/browser/sync/sync_prefs_unittest.cc index dd2c268..dd477bc 100644 --- a/chrome/browser/sync/sync_prefs_unittest.cc +++ b/chrome/browser/sync/sync_prefs_unittest.cc @@ -27,20 +27,20 @@ class SyncPrefsTest : public testing::Test { }; // Get all types with a user-facing component. -syncable::ModelTypeSet GetNonPassiveTypes() { - syncable::ModelTypeSet non_passive_types = syncable::ModelTypeSet::All(); - non_passive_types.Remove(syncable::NIGORI); +syncer::ModelTypeSet GetNonPassiveTypes() { + syncer::ModelTypeSet non_passive_types = syncer::ModelTypeSet::All(); + non_passive_types.Remove(syncer::NIGORI); return non_passive_types; } // Returns all types visible from the setup UI. -syncable::ModelTypeSet GetUserVisibleTypes() { - syncable::ModelTypeSet user_visible_types(GetNonPassiveTypes()); - user_visible_types.Remove(syncable::APP_NOTIFICATIONS); - user_visible_types.Remove(syncable::APP_SETTINGS); - user_visible_types.Remove(syncable::AUTOFILL_PROFILE); - user_visible_types.Remove(syncable::EXTENSION_SETTINGS); - user_visible_types.Remove(syncable::SEARCH_ENGINES); +syncer::ModelTypeSet GetUserVisibleTypes() { + syncer::ModelTypeSet user_visible_types(GetNonPassiveTypes()); + user_visible_types.Remove(syncer::APP_NOTIFICATIONS); + user_visible_types.Remove(syncer::APP_SETTINGS); + user_visible_types.Remove(syncer::AUTOFILL_PROFILE); + user_visible_types.Remove(syncer::EXTENSION_SETTINGS); + user_visible_types.Remove(syncer::SEARCH_ENGINES); return user_visible_types; } @@ -78,13 +78,13 @@ TEST_F(SyncPrefsTest, PreferredTypesKeepEverythingSynced) { EXPECT_TRUE(sync_prefs.HasKeepEverythingSynced()); - const syncable::ModelTypeSet non_passive_types = GetNonPassiveTypes(); + const syncer::ModelTypeSet non_passive_types = GetNonPassiveTypes(); EXPECT_TRUE(non_passive_types.Equals( sync_prefs.GetPreferredDataTypes(non_passive_types))); - const syncable::ModelTypeSet user_visible_types = GetUserVisibleTypes(); - for (syncable::ModelTypeSet::Iterator it = user_visible_types.First(); + const syncer::ModelTypeSet user_visible_types = GetUserVisibleTypes(); + for (syncer::ModelTypeSet::Iterator it = user_visible_types.First(); it.Good(); it.Inc()) { - syncable::ModelTypeSet preferred_types; + syncer::ModelTypeSet preferred_types; preferred_types.Put(it.Get()); sync_prefs.SetPreferredDataTypes(non_passive_types, preferred_types); EXPECT_TRUE(non_passive_types.Equals( @@ -97,27 +97,27 @@ TEST_F(SyncPrefsTest, PreferredTypesNotKeepEverythingSynced) { sync_prefs.SetKeepEverythingSynced(false); - const syncable::ModelTypeSet non_passive_types = GetNonPassiveTypes(); + const syncer::ModelTypeSet non_passive_types = GetNonPassiveTypes(); EXPECT_TRUE(non_passive_types.Equals( sync_prefs.GetPreferredDataTypes(non_passive_types))); - const syncable::ModelTypeSet user_visible_types = GetUserVisibleTypes(); - for (syncable::ModelTypeSet::Iterator it = user_visible_types.First(); + const syncer::ModelTypeSet user_visible_types = GetUserVisibleTypes(); + for (syncer::ModelTypeSet::Iterator it = user_visible_types.First(); it.Good(); it.Inc()) { - syncable::ModelTypeSet preferred_types; + syncer::ModelTypeSet preferred_types; preferred_types.Put(it.Get()); - syncable::ModelTypeSet expected_preferred_types(preferred_types); - if (it.Get() == syncable::AUTOFILL) { - expected_preferred_types.Put(syncable::AUTOFILL_PROFILE); + syncer::ModelTypeSet expected_preferred_types(preferred_types); + if (it.Get() == syncer::AUTOFILL) { + expected_preferred_types.Put(syncer::AUTOFILL_PROFILE); } - if (it.Get() == syncable::PREFERENCES) { - expected_preferred_types.Put(syncable::SEARCH_ENGINES); + if (it.Get() == syncer::PREFERENCES) { + expected_preferred_types.Put(syncer::SEARCH_ENGINES); } - if (it.Get() == syncable::APPS) { - expected_preferred_types.Put(syncable::APP_NOTIFICATIONS); - expected_preferred_types.Put(syncable::APP_SETTINGS); + if (it.Get() == syncer::APPS) { + expected_preferred_types.Put(syncer::APP_NOTIFICATIONS); + expected_preferred_types.Put(syncer::APP_SETTINGS); } - if (it.Get() == syncable::EXTENSIONS) { - expected_preferred_types.Put(syncable::EXTENSION_SETTINGS); + if (it.Get() == syncer::EXTENSIONS) { + expected_preferred_types.Put(syncer::EXTENSION_SETTINGS); } sync_prefs.SetPreferredDataTypes(non_passive_types, preferred_types); EXPECT_TRUE(expected_preferred_types.Equals( @@ -153,12 +153,11 @@ TEST_F(SyncPrefsTest, ObservedPrefs) { TEST_F(SyncPrefsTest, AcknowledgeSyncedTypes) { SyncPrefs sync_prefs(&pref_service_); - syncable::ModelTypeSet expected_acknowledge_synced_types = + syncer::ModelTypeSet expected_acknowledge_synced_types = sync_prefs.GetAcknowledgeSyncedTypesForTest(); - for (int i = syncable::EXTENSION_SETTINGS; - i < syncable::MODEL_TYPE_COUNT; ++i) { - const syncable::ModelType type = syncable::ModelTypeFromInt(i); - syncable::ModelTypeSet acknowledge_synced_types(type); + for (int i = syncer::EXTENSION_SETTINGS; i < syncer::MODEL_TYPE_COUNT; ++i) { + const syncer::ModelType type = syncer::ModelTypeFromInt(i); + syncer::ModelTypeSet acknowledge_synced_types(type); expected_acknowledge_synced_types.Put(type); sync_prefs.AcknowledgeSyncedTypes(acknowledge_synced_types); EXPECT_TRUE(expected_acknowledge_synced_types.Equals( @@ -195,7 +194,7 @@ TEST_F(SyncPrefsTest, NullPrefService) { EXPECT_FALSE(sync_prefs.IsStartSuppressed()); EXPECT_EQ(base::Time(), sync_prefs.GetLastSyncedTime()); EXPECT_FALSE(sync_prefs.HasKeepEverythingSynced()); - const syncable::ModelTypeSet non_passive_types = GetNonPassiveTypes(); + const syncer::ModelTypeSet non_passive_types = GetNonPassiveTypes(); EXPECT_TRUE(sync_prefs.GetPreferredDataTypes(non_passive_types).Empty()); EXPECT_FALSE(sync_prefs.IsManaged()); EXPECT_TRUE(sync_prefs.GetEncryptionBootstrapToken().empty()); diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc index abbbf26..0b6e609 100644 --- a/chrome/browser/sync/sync_ui_util.cc +++ b/chrome/browser/sync/sync_ui_util.cc @@ -604,7 +604,7 @@ void ConstructAboutInformation(ProfileSyncService* service, full_status.crypto_has_pending_keys); sync_ui_util::AddStringSyncDetails(encryption, "Encrypted Types", - syncable::ModelTypeSetToString(full_status.encrypted_types)); + syncer::ModelTypeSetToString(full_status.encrypted_types)); ListValue* cycles = AddSyncDetailsSection( diff --git a/chrome/browser/sync/test/integration/enable_disable_test.cc b/chrome/browser/sync/test/integration/enable_disable_test.cc index ef2b5a2..0915056 100644 --- a/chrome/browser/sync/test/integration/enable_disable_test.cc +++ b/chrome/browser/sync/test/integration/enable_disable_test.cc @@ -31,10 +31,10 @@ class EnableDisableSingleClientTest : public EnableDisableTest { }; bool DoesTopLevelNodeExist(syncer::UserShare* user_share, - syncable::ModelType type) { + syncer::ModelType type) { syncer::ReadTransaction trans(FROM_HERE, user_share); syncer::ReadNode node(&trans); - return node.InitByTagLookup(syncable::ModelTypeToRootTag(type)) == + return node.InitByTagLookup(syncer::ModelTypeToRootTag(type)) == syncer::BaseNode::INIT_OK; } @@ -42,32 +42,32 @@ IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, EnableOneAtATime) { ASSERT_TRUE(SetupClients()); // Setup sync with no enabled types. - ASSERT_TRUE(GetClient(0)->SetupSync(syncable::ModelTypeSet())); + ASSERT_TRUE(GetClient(0)->SetupSync(syncer::ModelTypeSet())); // TODO(rlarocque, 97780): It should be possible to disable notifications // before calling SetupSync(). We should move this line back to the top // of this function when this is supported. DisableNotifications(); - const syncable::ModelTypeSet registered_types = + const syncer::ModelTypeSet registered_types = GetClient(0)->service()->GetRegisteredDataTypes(); syncer::UserShare* user_share = GetClient(0)->service()->GetUserShare(); - for (syncable::ModelTypeSet::Iterator it = registered_types.First(); + for (syncer::ModelTypeSet::Iterator it = registered_types.First(); it.Good(); it.Inc()) { ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(it.Get())); // AUTOFILL_PROFILE is lumped together with AUTOFILL. - if (it.Get() == syncable::AUTOFILL_PROFILE) { + if (it.Get() == syncer::AUTOFILL_PROFILE) { continue; } ASSERT_TRUE(DoesTopLevelNodeExist(user_share, it.Get())) - << syncable::ModelTypeToString(it.Get()); + << syncer::ModelTypeToString(it.Get()); // AUTOFILL_PROFILE is lumped together with AUTOFILL. - if (it.Get() == syncable::AUTOFILL) { + if (it.Get() == syncer::AUTOFILL) { ASSERT_TRUE(DoesTopLevelNodeExist(user_share, - syncable::AUTOFILL_PROFILE)); + syncer::AUTOFILL_PROFILE)); } } @@ -85,23 +85,23 @@ IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, DisableOneAtATime) { // of this function when this is supported. DisableNotifications(); - const syncable::ModelTypeSet registered_types = + const syncer::ModelTypeSet registered_types = GetClient(0)->service()->GetRegisteredDataTypes(); syncer::UserShare* user_share = GetClient(0)->service()->GetUserShare(); // Make sure all top-level nodes exist first. - for (syncable::ModelTypeSet::Iterator it = registered_types.First(); + for (syncer::ModelTypeSet::Iterator it = registered_types.First(); it.Good(); it.Inc()) { ASSERT_TRUE(DoesTopLevelNodeExist(user_share, it.Get())); } - for (syncable::ModelTypeSet::Iterator it = registered_types.First(); + for (syncer::ModelTypeSet::Iterator it = registered_types.First(); it.Good(); it.Inc()) { ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(it.Get())); // AUTOFILL_PROFILE is lumped together with AUTOFILL. - if (it.Get() == syncable::AUTOFILL_PROFILE) { + if (it.Get() == syncer::AUTOFILL_PROFILE) { continue; } @@ -109,12 +109,12 @@ IN_PROC_BROWSER_TEST_F(EnableDisableSingleClientTest, DisableOneAtATime) { GetClient(0)->service()->GetUserShare(); ASSERT_FALSE(DoesTopLevelNodeExist(user_share, it.Get())) - << syncable::ModelTypeToString(it.Get()); + << syncer::ModelTypeToString(it.Get()); // AUTOFILL_PROFILE is lumped together with AUTOFILL. - if (it.Get() == syncable::AUTOFILL) { + if (it.Get() == syncer::AUTOFILL) { ASSERT_FALSE(DoesTopLevelNodeExist(user_share, - syncable::AUTOFILL_PROFILE)); + syncer::AUTOFILL_PROFILE)); } } diff --git a/chrome/browser/sync/test/integration/migration_errors_test.cc b/chrome/browser/sync/test/integration/migration_errors_test.cc index 4785ca4..11ff994 100644 --- a/chrome/browser/sync/test/integration/migration_errors_test.cc +++ b/chrome/browser/sync/test/integration/migration_errors_test.cc @@ -9,8 +9,8 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/sync/profile_sync_service_harness.h" #include "chrome/browser/sync/test/integration/bookmarks_helper.h" -#include "chrome/browser/sync/test/integration/sync_test.h" #include "chrome/browser/sync/test/integration/preferences_helper.h" +#include "chrome/browser/sync/test/integration/sync_test.h" #include "chrome/browser/translate/translate_prefs.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/ui_test_utils.h" @@ -27,40 +27,40 @@ namespace { // Utility functions to make a model type set out of a small number of // model types. -syncable::ModelTypeSet MakeSet(syncable::ModelType type) { - return syncable::ModelTypeSet(type); +syncer::ModelTypeSet MakeSet(syncer::ModelType type) { + return syncer::ModelTypeSet(type); } -syncable::ModelTypeSet MakeSet(syncable::ModelType type1, - syncable::ModelType type2) { - return syncable::ModelTypeSet(type1, type2); +syncer::ModelTypeSet MakeSet(syncer::ModelType type1, + syncer::ModelType type2) { + return syncer::ModelTypeSet(type1, type2); } // An ordered list of model types sets to migrate. Used by // RunMigrationTest(). -typedef std::deque<syncable::ModelTypeSet> MigrationList; +typedef std::deque<syncer::ModelTypeSet> MigrationList; // Utility functions to make a MigrationList out of a small number of // model types / model type sets. -MigrationList MakeList(syncable::ModelTypeSet model_types) { +MigrationList MakeList(syncer::ModelTypeSet model_types) { return MigrationList(1, model_types); } -MigrationList MakeList(syncable::ModelTypeSet model_types1, - syncable::ModelTypeSet model_types2) { +MigrationList MakeList(syncer::ModelTypeSet model_types1, + syncer::ModelTypeSet model_types2) { MigrationList migration_list; migration_list.push_back(model_types1); migration_list.push_back(model_types2); return migration_list; } -MigrationList MakeList(syncable::ModelType type) { +MigrationList MakeList(syncer::ModelType type) { return MakeList(MakeSet(type)); } -MigrationList MakeList(syncable::ModelType type1, - syncable::ModelType type2) { +MigrationList MakeList(syncer::ModelType type1, + syncer::ModelType type2) { return MakeList(MakeSet(type1), MakeSet(type2)); } @@ -73,12 +73,12 @@ class MigrationTest : public SyncTest { // well as a poll-based trigger method. enum TriggerMethod { MODIFY_PREF, MODIFY_BOOKMARK, TRIGGER_NOTIFICATION }; - syncable::ModelTypeSet GetPreferredDataTypes() { - const syncable::ModelTypeSet preferred_data_types = + syncer::ModelTypeSet GetPreferredDataTypes() { + const syncer::ModelTypeSet preferred_data_types = GetClient(0)->service()->GetPreferredDataTypes(); // Make sure all clients have the same preferred data types. for (int i = 1; i < num_clients(); ++i) { - const syncable::ModelTypeSet other_preferred_data_types = + const syncer::ModelTypeSet other_preferred_data_types = GetClient(i)->service()->GetPreferredDataTypes(); EXPECT_TRUE(preferred_data_types.Equals(other_preferred_data_types)); } @@ -89,9 +89,9 @@ class MigrationTest : public SyncTest { // set. MigrationList GetPreferredDataTypesList() { MigrationList migration_list; - const syncable::ModelTypeSet preferred_data_types = + const syncer::ModelTypeSet preferred_data_types = GetPreferredDataTypes(); - for (syncable::ModelTypeSet::Iterator it = + for (syncer::ModelTypeSet::Iterator it = preferred_data_types.First(); it.Good(); it.Inc()) { migration_list.push_back(MakeSet(it.Get())); } @@ -99,7 +99,7 @@ class MigrationTest : public SyncTest { } // Trigger a migration for the given types with the given method. - void TriggerMigration(syncable::ModelTypeSet model_types, + void TriggerMigration(syncer::ModelTypeSet model_types, TriggerMethod trigger_method) { switch (trigger_method) { case MODIFY_PREF: @@ -124,7 +124,7 @@ class MigrationTest : public SyncTest { // Block until all clients have completed migration for the given // types. - void AwaitMigration(syncable::ModelTypeSet migrate_types) { + void AwaitMigration(syncer::ModelTypeSet migrate_types) { for (int i = 0; i < num_clients(); ++i) { ASSERT_TRUE(GetClient(i)->AwaitMigration(migrate_types)); } @@ -211,24 +211,24 @@ class MigrationSingleClientTest : public MigrationTest { // The simplest possible migration tests -- a single data type. IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsOnlyModifyPref) { - RunSingleClientMigrationTest(MakeList(syncable::PREFERENCES), MODIFY_PREF); + RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), MODIFY_PREF); } IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsOnlyModifyBookmark) { - RunSingleClientMigrationTest(MakeList(syncable::PREFERENCES), + RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), MODIFY_BOOKMARK); } IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsOnlyTriggerNotification) { - RunSingleClientMigrationTest(MakeList(syncable::PREFERENCES), + RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), TRIGGER_NOTIFICATION); } // Nigori is handled specially, so we test that separately. IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, NigoriOnly) { - RunSingleClientMigrationTest(MakeList(syncable::PREFERENCES), + RunSingleClientMigrationTest(MakeList(syncer::PREFERENCES), TRIGGER_NOTIFICATION); } @@ -237,13 +237,13 @@ IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, NigoriOnly) { IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, BookmarksPrefsIndividually) { RunSingleClientMigrationTest( - MakeList(syncable::BOOKMARKS, syncable::PREFERENCES), + MakeList(syncer::BOOKMARKS, syncer::PREFERENCES), MODIFY_PREF); } IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, BookmarksPrefsBoth) { RunSingleClientMigrationTest( - MakeList(MakeSet(syncable::BOOKMARKS, syncable::PREFERENCES)), + MakeList(MakeSet(syncer::BOOKMARKS, syncer::PREFERENCES)), MODIFY_BOOKMARK); } @@ -253,13 +253,13 @@ IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, BookmarksPrefsBoth) { IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, DISABLED_PrefsNigoriIndividiaully) { RunSingleClientMigrationTest( - MakeList(syncable::PREFERENCES, syncable::NIGORI), + MakeList(syncer::PREFERENCES, syncer::NIGORI), TRIGGER_NOTIFICATION); } IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, PrefsNigoriBoth) { RunSingleClientMigrationTest( - MakeList(MakeSet(syncable::PREFERENCES, syncable::NIGORI)), + MakeList(MakeSet(syncer::PREFERENCES, syncer::NIGORI)), MODIFY_PREF); } @@ -297,15 +297,15 @@ IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, DISABLED_AllTypesWithNigoriIndividually) { ASSERT_TRUE(SetupClients()); MigrationList migration_list = GetPreferredDataTypesList(); - migration_list.push_front(MakeSet(syncable::NIGORI)); + migration_list.push_front(MakeSet(syncer::NIGORI)); RunSingleClientMigrationTest(migration_list, MODIFY_BOOKMARK); } IN_PROC_BROWSER_TEST_F(MigrationSingleClientTest, AllTypesWithNigoriAtOnce) { ASSERT_TRUE(SetupClients()); - syncable::ModelTypeSet all_types = GetPreferredDataTypes(); - all_types.Put(syncable::NIGORI); + syncer::ModelTypeSet all_types = GetPreferredDataTypes(); + all_types.Put(syncer::NIGORI); RunSingleClientMigrationTest(MakeList(all_types), MODIFY_PREF); } @@ -346,7 +346,7 @@ class MigrationTwoClientTest : public MigrationTest { // Easiest possible test of migration errors: triggers a server // migration on one datatype, then modifies some other datatype. IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, MigratePrefsThenModifyBookmark) { - RunTwoClientMigrationTest(MakeList(syncable::PREFERENCES), + RunTwoClientMigrationTest(MakeList(syncer::PREFERENCES), MODIFY_BOOKMARK); } @@ -355,7 +355,7 @@ IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, MigratePrefsThenModifyBookmark) { IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, MigratePrefsAndBookmarksThenModifyBookmark) { RunTwoClientMigrationTest( - MakeList(syncable::PREFERENCES, syncable::BOOKMARKS), + MakeList(syncer::PREFERENCES, syncer::BOOKMARKS), MODIFY_BOOKMARK); } @@ -366,7 +366,7 @@ IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, MigrationHellWithoutNigori) { MigrationList migration_list = GetPreferredDataTypesList(); // Let the first nudge be a datatype that's neither prefs nor // bookmarks. - migration_list.push_front(MakeSet(syncable::THEMES)); + migration_list.push_front(MakeSet(syncer::THEMES)); RunTwoClientMigrationTest(migration_list, MODIFY_BOOKMARK); } @@ -377,12 +377,12 @@ IN_PROC_BROWSER_TEST_F(MigrationTwoClientTest, MigrationList migration_list = GetPreferredDataTypesList(); // Let the first nudge be a datatype that's neither prefs nor // bookmarks. - migration_list.push_front(MakeSet(syncable::THEMES)); + migration_list.push_front(MakeSet(syncer::THEMES)); // Pop off one so that we don't migrate all data types; the syncer // freaks out if we do that (see http://crbug.com/94882). ASSERT_GE(migration_list.size(), 2u); - ASSERT_FALSE(migration_list.back().Equals(MakeSet(syncable::NIGORI))); - migration_list.back() = MakeSet(syncable::NIGORI); + ASSERT_FALSE(migration_list.back().Equals(MakeSet(syncer::NIGORI))); + migration_list.back() = MakeSet(syncer::NIGORI); RunTwoClientMigrationTest(migration_list, MODIFY_BOOKMARK); } diff --git a/chrome/browser/sync/test/integration/multiple_client_sessions_sync_test.cc b/chrome/browser/sync/test/integration/multiple_client_sessions_sync_test.cc index c6396e3..a9a4272 100644 --- a/chrome/browser/sync/test/integration/multiple_client_sessions_sync_test.cc +++ b/chrome/browser/sync/test/integration/multiple_client_sessions_sync_test.cc @@ -6,8 +6,8 @@ #include "base/stringprintf.h" #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/sync/profile_sync_service_harness.h" -#include "chrome/browser/sync/test/integration/sync_test.h" #include "chrome/browser/sync/test/integration/sessions_helper.h" +#include "chrome/browser/sync/test/integration/sync_test.h" using sessions_helper::CheckForeignSessionsAgainst; using sessions_helper::CheckInitialState; @@ -70,7 +70,7 @@ IN_PROC_BROWSER_TEST_F(MultipleClientSessionsSyncTest, } // Enable encryption on client 0, should propagate to all other clients. - ASSERT_TRUE(EnableEncryption(0, syncable::SESSIONS)); + ASSERT_TRUE(EnableEncryption(0, syncer::SESSIONS)); // Wait for sync. // TODO(zea): Fix sync completion detection so we don't need this. For now, @@ -92,7 +92,7 @@ IN_PROC_BROWSER_TEST_F(MultipleClientSessionsSyncTest, // Get foreign session data from all clients and check it against all // client_windows. for (int i = 0; i < num_clients(); ++i) { - ASSERT_TRUE(IsEncrypted(i, syncable::SESSIONS)); + ASSERT_TRUE(IsEncrypted(i, syncer::SESSIONS)); ASSERT_TRUE(CheckForeignSessionsAgainst(i, client_windows)); } } diff --git a/chrome/browser/sync/test/integration/sync_errors_test.cc b/chrome/browser/sync/test/integration/sync_errors_test.cc index d8fd3e0..06b2ba3 100644 --- a/chrome/browser/sync/test/integration/sync_errors_test.cc +++ b/chrome/browser/sync/test/integration/sync_errors_test.cc @@ -100,14 +100,14 @@ IN_PROC_BROWSER_TEST_F(SyncErrorTest, ErrorWhileSettingUp) { // In Non auto start enabled environments if the setup sync fails then // the setup would fail. So setup sync normally. ASSERT_TRUE(SetupSync()) << "Setup sync failed"; - ASSERT_TRUE(clients()[0]->DisableSyncForDatatype(syncable::AUTOFILL)); + ASSERT_TRUE(clients()[0]->DisableSyncForDatatype(syncer::AUTOFILL)); // Trigger error on every 2 out of 3 requests. TriggerSyncError(protocol_error, SyncTest::ERROR_FREQUENCY_TWO_THIRDS); // Now enable a datatype, whose first 2 syncs would fail, but we should // recover and setup succesfully on the third attempt. - ASSERT_TRUE(clients()[0]->EnableSyncForDatatype(syncable::AUTOFILL)); + ASSERT_TRUE(clients()[0]->EnableSyncForDatatype(syncer::AUTOFILL)); } } @@ -159,14 +159,14 @@ IN_PROC_BROWSER_TEST_F(SyncErrorTest, AuthErrorTest) { // TODO(lipalani): Fix the typed_url dtc so this test case can pass. IN_PROC_BROWSER_TEST_F(SyncErrorTest, DISABLED_DisableDatatypeWhileRunning) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; - syncable::ModelTypeSet synced_datatypes = - GetClient(0)->service()->GetPreferredDataTypes(); - ASSERT_TRUE(synced_datatypes.Has(syncable::TYPED_URLS)); + syncer::ModelTypeSet synced_datatypes = + GetClient(0)->service()->GetPreferredDataTypes(); + ASSERT_TRUE(synced_datatypes.Has(syncer::TYPED_URLS)); GetProfile(0)->GetPrefs()->SetBoolean( prefs::kSavingBrowserHistoryDisabled, true); synced_datatypes = GetClient(0)->service()->GetPreferredDataTypes(); - ASSERT_FALSE(synced_datatypes.Has(syncable::TYPED_URLS)); + ASSERT_FALSE(synced_datatypes.Has(syncer::TYPED_URLS)); const BookmarkNode* node1 = AddFolder(0, 0, L"title1"); SetTitle(0, node1, L"new_title1"); diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index e1a9781..fe09c85 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -594,11 +594,11 @@ void SyncTest::DisableNetwork(Profile* profile) { net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); } -bool SyncTest::EnableEncryption(int index, syncable::ModelType type) { +bool SyncTest::EnableEncryption(int index, syncer::ModelType type) { return GetClient(index)->EnableEncryptionForType(type); } -bool SyncTest::IsEncrypted(int index, syncable::ModelType type) { +bool SyncTest::IsEncrypted(int index, syncer::ModelType type) { return GetClient(index)->IsTypeEncrypted(type); } @@ -639,8 +639,7 @@ void SyncTest::EnableNotifications() { notifications_enabled_ = true; } -void SyncTest::TriggerNotification( - syncable::ModelTypeSet changed_types) { +void SyncTest::TriggerNotification(syncer::ModelTypeSet changed_types) { ASSERT_TRUE(ServerSupportsNotificationControl()); const std::string& data = syncer::P2PNotificationData("from_server", @@ -661,17 +660,16 @@ bool SyncTest::ServerSupportsErrorTriggering() const { return server_type_ == LOCAL_PYTHON_SERVER; } -void SyncTest::TriggerMigrationDoneError( - syncable::ModelTypeSet model_types) { +void SyncTest::TriggerMigrationDoneError(syncer::ModelTypeSet model_types) { ASSERT_TRUE(ServerSupportsErrorTriggering()); std::string path = "chromiumsync/migrate"; char joiner = '?'; - for (syncable::ModelTypeSet::Iterator it = model_types.First(); + for (syncer::ModelTypeSet::Iterator it = model_types.First(); it.Good(); it.Inc()) { path.append( base::StringPrintf( "%ctype=%d", joiner, - syncable::GetSpecificsFieldNumberFromModelType(it.Get()))); + syncer::GetSpecificsFieldNumberFromModelType(it.Get()))); joiner = '&'; } ui_test_utils::NavigateToURL(browser(), sync_server_.GetURL(path)); diff --git a/chrome/browser/sync/test/integration/sync_test.h b/chrome/browser/sync/test/integration/sync_test.h index e30d2cf..af3c407 100644 --- a/chrome/browser/sync/test/integration/sync_test.h +++ b/chrome/browser/sync/test/integration/sync_test.h @@ -148,10 +148,10 @@ class SyncTest : public InProcessBrowserTest { virtual void DisableNetwork(Profile* profile); // Encrypts the datatype |type| for profile |index|. - bool EnableEncryption(int index, syncable::ModelType type); + bool EnableEncryption(int index, syncer::ModelType type); // Checks if the datatype |type| is encrypted for profile |index|. - bool IsEncrypted(int index, syncable::ModelType type); + bool IsEncrypted(int index, syncer::ModelType type); // Blocks until all sync clients have completed their mutual sync cycles. // Returns true if a quiescent state was successfully reached. @@ -172,7 +172,7 @@ class SyncTest : public InProcessBrowserTest { // Trigger a notification to be sent to all clients. This operation // is available only if ServerSupportsNotificationControl() returned // true. - void TriggerNotification(syncable::ModelTypeSet changed_types); + void TriggerNotification(syncer::ModelTypeSet changed_types); // Returns true if the server being used supports injecting errors. bool ServerSupportsErrorTriggering() const; @@ -180,7 +180,7 @@ class SyncTest : public InProcessBrowserTest { // Triggers a migration for one or more datatypes, and waits // for the server to complete it. This operation is available // only if ServerSupportsErrorTriggering() returned true. - void TriggerMigrationDoneError(syncable::ModelTypeSet model_types); + void TriggerMigrationDoneError(syncer::ModelTypeSet model_types); // Triggers the server to set its birthday to a random value thereby // the server would return a birthday error on next sync. diff --git a/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc b/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc index d4313b9..0535303 100644 --- a/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_apps_sync_test.cc @@ -3,7 +3,6 @@ // found in the LICENSE file. #include "base/basictypes.h" -#include "chrome/common/extensions/extension_constants.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/extension_sorting.h" #include "chrome/browser/profiles/profile.h" @@ -11,6 +10,7 @@ #include "chrome/browser/sync/test/integration/apps_helper.h" #include "chrome/browser/sync/test/integration/sync_app_helper.h" #include "chrome/browser/sync/test/integration/sync_test.h" +#include "chrome/common/extensions/extension_constants.h" using apps_helper::AllProfilesHaveSameAppsAsVerifier; using apps_helper::CopyNTPOrdinals; @@ -292,14 +292,14 @@ IN_PROC_BROWSER_TEST_F(TwoClientAppsSyncTest, DisableApps) { ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AllProfilesHaveSameAppsAsVerifier()); - ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::APPS)); + ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::APPS)); InstallApp(GetProfile(0), 0); InstallApp(verifier(), 0); ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(HasSameAppsAsVerifier(0)); ASSERT_FALSE(HasSameAppsAsVerifier(1)); - ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncable::APPS)); + ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::APPS)); ASSERT_TRUE(AwaitQuiescence()); InstallAppsPendingForSync(GetProfile(0)); diff --git a/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc b/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc index c0857f6..764e9ac 100644 --- a/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_autofill_sync_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -344,7 +344,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, DisableAutofill) { ASSERT_TRUE(ProfilesMatch(0, 1)); ASSERT_EQ(1U, GetAllProfiles(0).size()); - ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(syncable::AUTOFILL)); + ASSERT_TRUE(GetClient(0)->DisableSyncForDatatype(syncer::AUTOFILL)); AddProfile(0, CreateAutofillProfile(PROFILE_FRASIER)); MakeABookmarkChange(0); ASSERT_TRUE(AwaitQuiescence()); @@ -352,7 +352,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientAutofillSyncTest, DisableAutofill) { ASSERT_EQ(2U, GetAllProfiles(0).size()); ASSERT_EQ(1U, GetAllProfiles(1).size()); - ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(syncable::AUTOFILL)); + ASSERT_TRUE(GetClient(0)->EnableSyncForDatatype(syncer::AUTOFILL)); MakeABookmarkChange(0); ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(ProfilesMatch(0, 1)); diff --git a/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc b/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc index b6d8432..e53a618 100644 --- a/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_bookmarks_sync_test.cc @@ -1509,12 +1509,12 @@ IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, DisableBookmarks) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllModelsMatchVerifier()); - ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::BOOKMARKS)); + ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::BOOKMARKS)); ASSERT_TRUE(AddFolder(1, kGenericFolderName) != NULL); ASSERT_TRUE(AwaitQuiescence()); ASSERT_FALSE(AllModelsMatch()); - ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncable::BOOKMARKS)); + ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::BOOKMARKS)); ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(AllModelsMatch()); } @@ -1564,7 +1564,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, MC_DuplicateFolders) { IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, MC_DeleteBookmark) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; - ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::BOOKMARKS)); + ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::BOOKMARKS)); const GURL bar_url("http://example.com/bar"); const GURL other_url("http://example.com/other"); @@ -1585,7 +1585,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, MC_DeleteBookmark) { ASSERT_FALSE(HasNodeWithURL(0, bar_url)); ASSERT_TRUE(HasNodeWithURL(0, other_url)); - ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncable::BOOKMARKS)); + ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::BOOKMARKS)); ASSERT_TRUE(AwaitQuiescence()); ASSERT_FALSE(HasNodeWithURL(0, bar_url)); @@ -1726,10 +1726,10 @@ IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllModelsMatchVerifier()); - ASSERT_TRUE(EnableEncryption(0, syncable::BOOKMARKS)); + ASSERT_TRUE(EnableEncryption(0, syncer::BOOKMARKS)); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); - ASSERT_TRUE(IsEncrypted(0, syncable::BOOKMARKS)); - ASSERT_TRUE(IsEncrypted(1, syncable::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(0, syncer::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(1, syncer::BOOKMARKS)); ASSERT_TRUE(AllModelsMatchVerifier()); } @@ -1738,11 +1738,11 @@ IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllModelsMatchVerifier()); - ASSERT_TRUE(EnableEncryption(0, syncable::BOOKMARKS)); + ASSERT_TRUE(EnableEncryption(0, syncer::BOOKMARKS)); ASSERT_TRUE(AddURL(0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); - ASSERT_TRUE(IsEncrypted(0, syncable::BOOKMARKS)); - ASSERT_TRUE(IsEncrypted(1, syncable::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(0, syncer::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(1, syncer::BOOKMARKS)); ASSERT_TRUE(AllModelsMatchVerifier()); } @@ -1751,11 +1751,11 @@ IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllModelsMatchVerifier()); - ASSERT_TRUE(EnableEncryption(0, syncable::BOOKMARKS)); - ASSERT_TRUE(EnableEncryption(1, syncable::BOOKMARKS)); + ASSERT_TRUE(EnableEncryption(0, syncer::BOOKMARKS)); + ASSERT_TRUE(EnableEncryption(1, syncer::BOOKMARKS)); ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(IsEncrypted(0, syncable::BOOKMARKS)); - ASSERT_TRUE(IsEncrypted(1, syncable::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(0, syncer::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(1, syncer::BOOKMARKS)); ASSERT_TRUE(AllModelsMatchVerifier()); } @@ -1764,16 +1764,16 @@ IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllModelsMatchVerifier()); - ASSERT_TRUE(EnableEncryption(0, syncable::BOOKMARKS)); + ASSERT_TRUE(EnableEncryption(0, syncer::BOOKMARKS)); ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(IsEncrypted(0, syncable::BOOKMARKS)); - ASSERT_TRUE(IsEncrypted(1, syncable::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(0, syncer::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(1, syncer::BOOKMARKS)); ASSERT_TRUE(AddURL(0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL); ASSERT_TRUE(AddURL(0, IndexedURLTitle(1), GURL(IndexedURL(1))) != NULL); ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(AllModelsMatchVerifier()); - ASSERT_TRUE(IsEncrypted(0, syncable::BOOKMARKS)); - ASSERT_TRUE(IsEncrypted(1, syncable::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(0, syncer::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(1, syncer::BOOKMARKS)); } IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, @@ -1782,10 +1782,10 @@ IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, ASSERT_TRUE(AllModelsMatchVerifier()); ASSERT_TRUE(AddURL(0, IndexedURLTitle(0), GURL(IndexedURL(0))) != NULL); - ASSERT_TRUE(EnableEncryption(0, syncable::BOOKMARKS)); + ASSERT_TRUE(EnableEncryption(0, syncer::BOOKMARKS)); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); - ASSERT_TRUE(IsEncrypted(0, syncable::BOOKMARKS)); - ASSERT_TRUE(IsEncrypted(1, syncable::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(0, syncer::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(1, syncer::BOOKMARKS)); ASSERT_TRUE(AllModelsMatchVerifier()); ASSERT_TRUE(AddURL(0, IndexedURLTitle(1), GURL(IndexedURL(1))) != NULL); @@ -1810,10 +1810,10 @@ IN_PROC_BROWSER_TEST_F(TwoClientBookmarksSyncTest, // understand the bookmark updates. SetEncryptionPassphrase(0, kValidPassphrase, ProfileSyncService::EXPLICIT); ASSERT_TRUE(GetClient(0)->AwaitPassphraseAccepted()); - ASSERT_TRUE(EnableEncryption(0, syncable::BOOKMARKS)); + ASSERT_TRUE(EnableEncryption(0, syncer::BOOKMARKS)); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); - ASSERT_TRUE(IsEncrypted(0, syncable::BOOKMARKS)); - ASSERT_TRUE(IsEncrypted(1, syncable::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(0, syncer::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(1, syncer::BOOKMARKS)); ASSERT_TRUE(GetClient(1)->service()->IsPassphraseRequired()); ASSERT_GT(GetClient(1)->GetLastSessionSnapshot().num_encryption_conflicts(), 3); // The encrypted nodes. diff --git a/chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc b/chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc index 54fae52..0311bdc 100644 --- a/chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -244,13 +244,13 @@ IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest, DisableExtensions) { ASSERT_TRUE(SetupSync()); ASSERT_TRUE(AllProfilesHaveSameExtensionsAsVerifier()); - ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::EXTENSIONS)); + ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::EXTENSIONS)); InstallExtension(GetProfile(0), 1); InstallExtension(verifier(), 1); ASSERT_TRUE(AwaitQuiescence()); ASSERT_FALSE(AllProfilesHaveSameExtensionsAsVerifier()); - ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncable::EXTENSIONS)); + ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::EXTENSIONS)); ASSERT_TRUE(AwaitQuiescence()); InstallExtensionsPendingForSync(GetProfile(0)); InstallExtensionsPendingForSync(GetProfile(1)); diff --git a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc index b37a6a4..31a58f2 100644 --- a/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_passwords_sync_test.cc @@ -73,7 +73,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, DisablePasswords) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); - ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::PASSWORDS)); + ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::PASSWORDS)); PasswordForm form = CreateTestPasswordForm(0); AddLogin(GetVerifierPasswordStore(), form); ASSERT_EQ(1, GetVerifierPasswordCount()); @@ -84,7 +84,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, DisablePasswords) { ASSERT_TRUE(ProfileContainsSamePasswordFormsAsVerifier(0)); ASSERT_FALSE(ProfileContainsSamePasswordFormsAsVerifier(1)); - ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncable::PASSWORDS)); + ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::PASSWORDS)); ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(AllProfilesContainSamePasswordFormsAsVerifier()); ASSERT_EQ(1, GetPasswordCount(1)); @@ -254,10 +254,10 @@ IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, // Following ensures types are enabled and active (see bug 87572). syncer::ModelSafeRoutingInfo routes; GetClient(0)->service()->GetModelSafeRoutingInfo(&routes); - ASSERT_EQ(syncer::GROUP_PASSWORD, routes[syncable::PASSWORDS]); + ASSERT_EQ(syncer::GROUP_PASSWORD, routes[syncer::PASSWORDS]); routes.clear(); GetClient(1)->service()->GetModelSafeRoutingInfo(&routes); - ASSERT_EQ(syncer::GROUP_PASSWORD, routes[syncable::PASSWORDS]); + ASSERT_EQ(syncer::GROUP_PASSWORD, routes[syncer::PASSWORDS]); } IN_PROC_BROWSER_TEST_F(TwoClientPasswordsSyncTest, diff --git a/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc b/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc index 6c72862..1110fb8 100644 --- a/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_preferences_sync_test.cc @@ -4,9 +4,9 @@ #include "base/values.h" #include "chrome/browser/sync/profile_sync_service_harness.h" -#include "chrome/browser/translate/translate_prefs.h" -#include "chrome/browser/sync/test/integration/sync_test.h" #include "chrome/browser/sync/test/integration/preferences_helper.h" +#include "chrome/browser/sync/test/integration/sync_test.h" +#include "chrome/browser/translate/translate_prefs.h" #include "chrome/common/pref_names.h" using preferences_helper::AppendStringPref; @@ -82,7 +82,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, prefs::kSyncKeepEverythingSynced)); ASSERT_TRUE(BooleanPrefMatches(prefs::kSyncThemes)); - GetClient(0)->DisableSyncForDatatype(syncable::THEMES); + GetClient(0)->DisableSyncForDatatype(syncer::THEMES); ASSERT_FALSE(BooleanPrefMatches( prefs::kSyncKeepEverythingSynced)); } @@ -96,13 +96,13 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, DisablePreferences) { ASSERT_TRUE(BooleanPrefMatches( prefs::kPasswordManagerEnabled)); - GetClient(1)->DisableSyncForDatatype(syncable::PREFERENCES); + GetClient(1)->DisableSyncForDatatype(syncer::PREFERENCES); ChangeBooleanPref(0, prefs::kPasswordManagerEnabled); ASSERT_TRUE(AwaitQuiescence()); ASSERT_FALSE(BooleanPrefMatches( prefs::kPasswordManagerEnabled)); - GetClient(1)->EnableSyncForDatatype(syncable::PREFERENCES); + GetClient(1)->EnableSyncForDatatype(syncer::PREFERENCES); ASSERT_TRUE(AwaitQuiescence()); ASSERT_TRUE(BooleanPrefMatches( prefs::kPasswordManagerEnabled)); @@ -147,16 +147,16 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, SignInDialog) { ASSERT_TRUE(BooleanPrefMatches( prefs::kSyncKeepEverythingSynced)); - GetClient(0)->DisableSyncForDatatype(syncable::PREFERENCES); - GetClient(1)->EnableSyncForDatatype(syncable::PREFERENCES); - GetClient(0)->DisableSyncForDatatype(syncable::AUTOFILL); - GetClient(1)->EnableSyncForDatatype(syncable::AUTOFILL); - GetClient(0)->DisableSyncForDatatype(syncable::BOOKMARKS); - GetClient(1)->EnableSyncForDatatype(syncable::BOOKMARKS); - GetClient(0)->DisableSyncForDatatype(syncable::EXTENSIONS); - GetClient(1)->EnableSyncForDatatype(syncable::EXTENSIONS); - GetClient(0)->DisableSyncForDatatype(syncable::THEMES); - GetClient(1)->EnableSyncForDatatype(syncable::THEMES); + GetClient(0)->DisableSyncForDatatype(syncer::PREFERENCES); + GetClient(1)->EnableSyncForDatatype(syncer::PREFERENCES); + GetClient(0)->DisableSyncForDatatype(syncer::AUTOFILL); + GetClient(1)->EnableSyncForDatatype(syncer::AUTOFILL); + GetClient(0)->DisableSyncForDatatype(syncer::BOOKMARKS); + GetClient(1)->EnableSyncForDatatype(syncer::BOOKMARKS); + GetClient(0)->DisableSyncForDatatype(syncer::EXTENSIONS); + GetClient(1)->EnableSyncForDatatype(syncer::EXTENSIONS); + GetClient(0)->DisableSyncForDatatype(syncer::THEMES); + GetClient(1)->EnableSyncForDatatype(syncer::THEMES); ASSERT_TRUE(AwaitQuiescence()); @@ -615,10 +615,10 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, SingleClientEnabledEncryption) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; - ASSERT_TRUE(EnableEncryption(0, syncable::PREFERENCES)); + ASSERT_TRUE(EnableEncryption(0, syncer::PREFERENCES)); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); - ASSERT_TRUE(IsEncrypted(0, syncable::PREFERENCES)); - ASSERT_TRUE(IsEncrypted(1, syncable::PREFERENCES)); + ASSERT_TRUE(IsEncrypted(0, syncer::PREFERENCES)); + ASSERT_TRUE(IsEncrypted(1, syncer::PREFERENCES)); } IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, @@ -628,10 +628,10 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, prefs::kHomePageIsNewTabPage)); ChangeBooleanPref(0, prefs::kHomePageIsNewTabPage); - ASSERT_TRUE(EnableEncryption(0, syncable::PREFERENCES)); + ASSERT_TRUE(EnableEncryption(0, syncer::PREFERENCES)); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); - ASSERT_TRUE(IsEncrypted(0, syncable::PREFERENCES)); - ASSERT_TRUE(IsEncrypted(1, syncable::PREFERENCES)); + ASSERT_TRUE(IsEncrypted(0, syncer::PREFERENCES)); + ASSERT_TRUE(IsEncrypted(1, syncer::PREFERENCES)); ASSERT_TRUE(BooleanPrefMatches( prefs::kHomePageIsNewTabPage)); } @@ -640,11 +640,11 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, BothClientsEnabledEncryption) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; - ASSERT_TRUE(EnableEncryption(0, syncable::PREFERENCES)); - ASSERT_TRUE(EnableEncryption(1, syncable::PREFERENCES)); + ASSERT_TRUE(EnableEncryption(0, syncer::PREFERENCES)); + ASSERT_TRUE(EnableEncryption(1, syncer::PREFERENCES)); ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(IsEncrypted(0, syncable::PREFERENCES)); - ASSERT_TRUE(IsEncrypted(1, syncable::PREFERENCES)); + ASSERT_TRUE(IsEncrypted(0, syncer::PREFERENCES)); + ASSERT_TRUE(IsEncrypted(1, syncer::PREFERENCES)); } IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, @@ -654,13 +654,13 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, prefs::kHomePageIsNewTabPage)); ASSERT_TRUE(StringPrefMatches(prefs::kHomePage)); - ASSERT_TRUE(EnableEncryption(0, syncable::PREFERENCES)); + ASSERT_TRUE(EnableEncryption(0, syncer::PREFERENCES)); ChangeBooleanPref(0, prefs::kHomePageIsNewTabPage); ChangeStringPref(1, prefs::kHomePage, "http://www.google.com/1"); ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(IsEncrypted(0, syncable::PREFERENCES)); - ASSERT_TRUE(IsEncrypted(1, syncable::PREFERENCES)); + ASSERT_TRUE(IsEncrypted(0, syncer::PREFERENCES)); + ASSERT_TRUE(IsEncrypted(1, syncer::PREFERENCES)); ASSERT_TRUE(BooleanPrefMatches( prefs::kHomePageIsNewTabPage)); ASSERT_TRUE(StringPrefMatches(prefs::kHomePage)); @@ -673,10 +673,10 @@ IN_PROC_BROWSER_TEST_F(TwoClientPreferencesSyncTest, prefs::kHomePageIsNewTabPage)); ChangeBooleanPref(0, prefs::kHomePageIsNewTabPage); - ASSERT_TRUE(EnableEncryption(0, syncable::PREFERENCES)); + ASSERT_TRUE(EnableEncryption(0, syncer::PREFERENCES)); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); - ASSERT_TRUE(IsEncrypted(0, syncable::PREFERENCES)); - ASSERT_TRUE(IsEncrypted(1, syncable::PREFERENCES)); + ASSERT_TRUE(IsEncrypted(0, syncer::PREFERENCES)); + ASSERT_TRUE(IsEncrypted(1, syncer::PREFERENCES)); ASSERT_TRUE(BooleanPrefMatches( prefs::kHomePageIsNewTabPage)); diff --git a/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc b/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc index 4a9b02e..50d0a41 100644 --- a/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_sessions_sync_test.cc @@ -66,15 +66,15 @@ IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, ASSERT_TRUE(CheckInitialState(0)); ASSERT_TRUE(CheckInitialState(1)); - ASSERT_TRUE(EnableEncryption(0, syncable::SESSIONS)); + ASSERT_TRUE(EnableEncryption(0, syncer::SESSIONS)); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); - ASSERT_TRUE(IsEncrypted(0, syncable::SESSIONS)); - ASSERT_TRUE(IsEncrypted(1, syncable::SESSIONS)); + ASSERT_TRUE(IsEncrypted(0, syncer::SESSIONS)); + ASSERT_TRUE(IsEncrypted(1, syncer::SESSIONS)); // Should enable encryption for all other types as well. Just check a subset. - ASSERT_TRUE(IsEncrypted(1, syncable::PREFERENCES)); - ASSERT_TRUE(IsEncrypted(1, syncable::BOOKMARKS)); - ASSERT_TRUE(IsEncrypted(1, syncable::APPS)); + ASSERT_TRUE(IsEncrypted(1, syncer::PREFERENCES)); + ASSERT_TRUE(IsEncrypted(1, syncer::BOOKMARKS)); + ASSERT_TRUE(IsEncrypted(1, syncer::APPS)); } IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, @@ -87,11 +87,11 @@ IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, ScopedWindowMap client0_windows; ASSERT_TRUE(OpenTabAndGetLocalWindows(0, GURL(kURL1), client0_windows.GetMutable())); - ASSERT_TRUE(EnableEncryption(0, syncable::SESSIONS)); + ASSERT_TRUE(EnableEncryption(0, syncer::SESSIONS)); ASSERT_TRUE(GetClient(0)->AwaitMutualSyncCycleCompletion(GetClient(1))); // Get foreign session data from client 1. - ASSERT_TRUE(IsEncrypted(1, syncable::SESSIONS)); + ASSERT_TRUE(IsEncrypted(1, syncer::SESSIONS)); SyncedSessionVector sessions1; ASSERT_TRUE(GetSessionData(1, &sessions1)); @@ -107,11 +107,11 @@ IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, ASSERT_TRUE(CheckInitialState(0)); ASSERT_TRUE(CheckInitialState(1)); - ASSERT_TRUE(EnableEncryption(0, syncable::SESSIONS)); - ASSERT_TRUE(EnableEncryption(1, syncable::SESSIONS)); + ASSERT_TRUE(EnableEncryption(0, syncer::SESSIONS)); + ASSERT_TRUE(EnableEncryption(1, syncer::SESSIONS)); ASSERT_TRUE(AwaitQuiescence()); - ASSERT_TRUE(IsEncrypted(0, syncable::SESSIONS)); - ASSERT_TRUE(IsEncrypted(1, syncable::SESSIONS)); + ASSERT_TRUE(IsEncrypted(0, syncer::SESSIONS)); + ASSERT_TRUE(IsEncrypted(1, syncer::SESSIONS)); } IN_PROC_BROWSER_TEST_F(TwoClientSessionsSyncTest, BothChanged) { diff --git a/chrome/browser/sync/test/integration/two_client_themes_sync_test.cc b/chrome/browser/sync/test/integration/two_client_themes_sync_test.cc index 4c487e0..d0e1cce 100644 --- a/chrome/browser/sync/test/integration/two_client_themes_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_themes_sync_test.cc @@ -1,11 +1,11 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/basictypes.h" #include "chrome/browser/sync/profile_sync_service_harness.h" -#include "chrome/browser/sync/test/integration/themes_helper.h" #include "chrome/browser/sync/test/integration/sync_test.h" +#include "chrome/browser/sync/test/integration/themes_helper.h" using themes_helper::GetCustomTheme; using themes_helper::GetThemeID; @@ -199,7 +199,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DisableThemes) { ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); ASSERT_FALSE(UsingCustomTheme(verifier())); - ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncable::THEMES)); + ASSERT_TRUE(GetClient(1)->DisableSyncForDatatype(syncer::THEMES)); UseCustomTheme(GetProfile(0), 0); UseCustomTheme(verifier(), 0); ASSERT_TRUE(AwaitQuiescence()); @@ -208,7 +208,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientThemesSyncTest, DisableThemes) { ASSERT_FALSE(UsingCustomTheme(GetProfile(1))); ASSERT_EQ(GetCustomTheme(0), GetThemeID(verifier())); - ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncable::THEMES)); + ASSERT_TRUE(GetClient(1)->EnableSyncForDatatype(syncer::THEMES)); ASSERT_TRUE(AwaitQuiescence()); ASSERT_EQ(GetCustomTheme(0), GetThemeID(GetProfile(0))); diff --git a/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc b/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc index 5d270e1..063e064 100644 --- a/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_typed_urls_sync_test.cc @@ -193,7 +193,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientTypedUrlsSyncTest, DisableEnableSync) { ASSERT_TRUE(SetupSync()) << "SetupSync() failed."; // Disable typed url sync for one client, leave it active for the other. - GetClient(0)->DisableSyncForDatatype(syncable::TYPED_URLS); + GetClient(0)->DisableSyncForDatatype(syncer::TYPED_URLS); // Add one URL to non-syncing client, add a different URL to the other, // wait for sync cycle to complete. No data should be exchanged. @@ -212,7 +212,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientTypedUrlsSyncTest, DisableEnableSync) { ASSERT_EQ(url2, post_sync_urls[0].url()); // Enable typed url sync, make both URLs are synced to each client. - GetClient(0)->EnableSyncForDatatype(syncable::TYPED_URLS); + GetClient(0)->EnableSyncForDatatype(syncer::TYPED_URLS); ASSERT_TRUE(AwaitQuiescence()); AssertAllProfilesHaveSameURLsAsVerifier(); diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc index fa597b4..26a0b1b 100644 --- a/chrome/browser/sync/test_profile_sync_service.cc +++ b/chrome/browser/sync/test_profile_sync_service.cc @@ -45,10 +45,10 @@ SyncBackendHostForProfileSyncTest::~SyncBackendHostForProfileSyncTest() {} void SyncBackendHostForProfileSyncTest:: SimulateSyncCycleCompletedInitialSyncEnded( const tracked_objects::Location& location) { - syncable::ModelTypeSet sync_ended; + syncer::ModelTypeSet sync_ended; if (!fail_initial_download_) - sync_ended = syncable::ModelTypeSet::All(); - syncable::ModelTypePayloadMap download_progress_markers; + sync_ended = syncer::ModelTypeSet::All(); + syncer::ModelTypePayloadMap download_progress_markers; HandleSyncCycleCompletedOnFrontendLoop( SyncSessionSnapshot( ModelNeutralState(), false, sync_ended, download_progress_markers, @@ -88,11 +88,11 @@ void SyncBackendHostForProfileSyncTest::StartConfiguration( const base::Closure& callback) { SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop(); if (IsDownloadingNigoriForTest()) { - syncable::ModelTypeSet sync_ended; + syncer::ModelTypeSet sync_ended; if (!fail_initial_download_) - sync_ended.Put(syncable::NIGORI); - syncable::ModelTypePayloadMap download_progress_markers; + sync_ended.Put(syncer::NIGORI); + syncer::ModelTypePayloadMap download_progress_markers; HandleSyncCycleCompletedOnFrontendLoop( SyncSessionSnapshot( ModelNeutralState(), false, sync_ended, download_progress_markers, @@ -147,10 +147,10 @@ void TestProfileSyncService::SetInitialSyncEndedForAllTypes() { UserShare* user_share = GetUserShare(); Directory* directory = user_share->directory.get(); - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i < syncable::MODEL_TYPE_COUNT; ++i) { + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i < syncer::MODEL_TYPE_COUNT; ++i) { directory->set_initial_sync_ended_for_type( - syncable::ModelTypeFromInt(i), true); + syncer::ModelTypeFromInt(i), true); } } @@ -174,9 +174,9 @@ void TestProfileSyncService::OnBackendInitialized( UserShare* user_share = GetUserShare(); Directory* directory = user_share->directory.get(); - if (!directory->initial_sync_ended_for_type(syncable::NIGORI)) { + if (!directory->initial_sync_ended_for_type(syncer::NIGORI)) { ProfileSyncServiceTestHelper::CreateRoot( - syncable::NIGORI, GetUserShare(), + syncer::NIGORI, GetUserShare(), id_factory()); // A side effect of adding the NIGORI mode (normally done by the diff --git a/chrome/browser/sync/user_selectable_sync_type.h b/chrome/browser/sync/user_selectable_sync_type.h index c1a4ddf..1399b66 100644 --- a/chrome/browser/sync/user_selectable_sync_type.h +++ b/chrome/browser/sync/user_selectable_sync_type.h @@ -20,7 +20,7 @@ namespace user_selectable_type { // THIS ENUM IS MEANT SOLELY FOR THE PURPOSE OF HISTOGRAM LOGGING. IF YOU ARE // LOOKING TO MODIFY SYNC FUNCTIONALITY AND NEED A LIST OF SYNC TYPES, USE -// syncable::ModelType. +// syncer::ModelType. enum UserSelectableSyncType { BOOKMARKS = 0, diff --git a/chrome/browser/ui/webui/ntp/foreign_session_handler.cc b/chrome/browser/ui/webui/ntp/foreign_session_handler.cc index fd58295..6193cf1 100644 --- a/chrome/browser/ui/webui/ntp/foreign_session_handler.cc +++ b/chrome/browser/ui/webui/ntp/foreign_session_handler.cc @@ -20,8 +20,8 @@ #include "chrome/browser/sessions/session_restore.h" #include "chrome/browser/sync/profile_sync_service.h" #include "chrome/browser/sync/profile_sync_service_factory.h" -#include "chrome/browser/ui/webui/session_favicon_source.h" #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" +#include "chrome/browser/ui/webui/session_favicon_source.h" #include "chrome/browser/ui/webui/web_ui_util.h" #include "chrome/common/chrome_notification_types.h" #include "chrome/common/pref_names.h" @@ -127,7 +127,7 @@ bool ForeignSessionHandler::IsTabSyncEnabled() { Profile* profile = Profile::FromWebUI(web_ui()); ProfileSyncService* service = ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile); - return service && service->GetPreferredDataTypes().Has(syncable::SESSIONS); + return service && service->GetPreferredDataTypes().Has(syncer::SESSIONS); } string16 ForeignSessionHandler::FormatSessionTime(const base::Time& time) { diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc b/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc index cb9aebd..5564f37 100644 --- a/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc +++ b/chrome/browser/ui/webui/sync_promo/sync_promo_handler.cc @@ -147,7 +147,7 @@ void SyncPromoHandler::DisplayConfigureSync(bool show_advanced, // everything by default. This makes the first run experience simpler. Note, // there's an advanced link in the sync promo that takes users to Settings // where the configure pane is not skipped. - service->OnUserChoseDatatypes(true, syncable::ModelTypeSet()); + service->OnUserChoseDatatypes(true, syncer::ModelTypeSet()); ConfigureSyncDone(); } } diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc index 7a7d34e..e6dca55 100644 --- a/chrome/browser/ui/webui/sync_setup_handler.cc +++ b/chrome/browser/ui/webui/sync_setup_handler.cc @@ -51,7 +51,7 @@ struct SyncConfigInfo { bool encrypt_all; bool sync_everything; - syncable::ModelTypeSet data_types; + syncer::ModelTypeSet data_types; std::string passphrase; bool passphrase_is_gaia; }; @@ -76,16 +76,16 @@ const char* kDataTypeNames[] = { "typedUrls" }; -const syncable::ModelType kDataTypes[] = { - syncable::APPS, - syncable::AUTOFILL, - syncable::BOOKMARKS, - syncable::EXTENSIONS, - syncable::PASSWORDS, - syncable::PREFERENCES, - syncable::SESSIONS, - syncable::THEMES, - syncable::TYPED_URLS +const syncer::ModelType kDataTypes[] = { + syncer::APPS, + syncer::AUTOFILL, + syncer::BOOKMARKS, + syncer::EXTENSIONS, + syncer::PASSWORDS, + syncer::PREFERENCES, + syncer::SESSIONS, + syncer::THEMES, + syncer::TYPED_URLS }; static const size_t kNumDataTypes = arraysize(kDataTypes); @@ -400,9 +400,9 @@ void SyncSetupHandler::DisplayConfigureSync(bool show_advanced, DictionaryValue args; // Tell the UI layer which data types are registered/enabled by the user. - const syncable::ModelTypeSet registered_types = + const syncer::ModelTypeSet registered_types = service->GetRegisteredDataTypes(); - const syncable::ModelTypeSet preferred_types = + const syncer::ModelTypeSet preferred_types = service->GetPreferredDataTypes(); for (size_t i = 0; i < kNumDataTypes; ++i) { const std::string key_name = kDataTypeNames[i]; diff --git a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc index 6efe5f1..f8ac644 100644 --- a/chrome/browser/ui/webui/sync_setup_handler_unittest.cc +++ b/chrome/browser/ui/webui/sync_setup_handler_unittest.cc @@ -12,10 +12,10 @@ #include "base/stl_util.h" #include "base/values.h" #include "chrome/browser/prefs/pref_service.h" -#include "chrome/browser/sync/profile_sync_service_mock.h" -#include "chrome/browser/signin/signin_manager_fake.h" #include "chrome/browser/signin/signin_manager_factory.h" +#include "chrome/browser/signin/signin_manager_fake.h" #include "chrome/browser/sync/profile_sync_service_factory.h" +#include "chrome/browser/sync/profile_sync_service_mock.h" #include "chrome/browser/ui/webui/signin/login_ui_service.h" #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" @@ -46,21 +46,21 @@ const char kTestCaptchaImageUrl[] = "http://pizzamyheart/image"; const char kTestCaptchaUnlockUrl[] = "http://pizzamyheart/unlock"; // List of all the types a user can select in the sync config dialog. -const syncable::ModelType kUserSelectableTypes[] = { - syncable::APPS, - syncable::AUTOFILL, - syncable::BOOKMARKS, - syncable::EXTENSIONS, - syncable::PASSWORDS, - syncable::PREFERENCES, - syncable::SESSIONS, - syncable::THEMES, - syncable::TYPED_URLS +const syncer::ModelType kUserSelectableTypes[] = { + syncer::APPS, + syncer::AUTOFILL, + syncer::BOOKMARKS, + syncer::EXTENSIONS, + syncer::PASSWORDS, + syncer::PREFERENCES, + syncer::SESSIONS, + syncer::THEMES, + syncer::TYPED_URLS }; // Returns a ModelTypeSet with all user selectable types set. -syncable::ModelTypeSet GetAllTypes() { - syncable::ModelTypeSet types; +syncer::ModelTypeSet GetAllTypes() { + syncer::ModelTypeSet types; for (size_t i = 0; i < arraysize(kUserSelectableTypes); ++i) types.Put(kUserSelectableTypes[i]); return types; @@ -81,7 +81,7 @@ enum EncryptAllConfig { // the passed dictionary are added to the json. std::string GetConfiguration(const DictionaryValue* extra_values, SyncAllDataConfig sync_all, - syncable::ModelTypeSet types, + syncer::ModelTypeSet types, const std::string& passphrase, EncryptAllConfig encrypt_all) { DictionaryValue result; @@ -93,15 +93,15 @@ std::string GetConfiguration(const DictionaryValue* extra_values, if (!passphrase.empty()) result.SetString("passphrase", passphrase); // Add all of our data types. - result.SetBoolean("appsSynced", types.Has(syncable::APPS)); - result.SetBoolean("autofillSynced", types.Has(syncable::AUTOFILL)); - result.SetBoolean("bookmarksSynced", types.Has(syncable::BOOKMARKS)); - result.SetBoolean("extensionsSynced", types.Has(syncable::EXTENSIONS)); - result.SetBoolean("passwordsSynced", types.Has(syncable::PASSWORDS)); - result.SetBoolean("preferencesSynced", types.Has(syncable::PREFERENCES)); - result.SetBoolean("sessionsSynced", types.Has(syncable::SESSIONS)); - result.SetBoolean("themesSynced", types.Has(syncable::THEMES)); - result.SetBoolean("typedUrlsSynced", types.Has(syncable::TYPED_URLS)); + result.SetBoolean("appsSynced", types.Has(syncer::APPS)); + result.SetBoolean("autofillSynced", types.Has(syncer::AUTOFILL)); + result.SetBoolean("bookmarksSynced", types.Has(syncer::BOOKMARKS)); + result.SetBoolean("extensionsSynced", types.Has(syncer::EXTENSIONS)); + result.SetBoolean("passwordsSynced", types.Has(syncer::PASSWORDS)); + result.SetBoolean("preferencesSynced", types.Has(syncer::PREFERENCES)); + result.SetBoolean("sessionsSynced", types.Has(syncer::SESSIONS)); + result.SetBoolean("themesSynced", types.Has(syncer::THEMES)); + result.SetBoolean("typedUrlsSynced", types.Has(syncer::TYPED_URLS)); std::string args; base::JSONWriter::Write(&result, &args); return args; @@ -190,17 +190,17 @@ void CheckShowSyncSetupArgs(const DictionaryValue* dictionary, // types. void CheckConfigDataTypeArguments(DictionaryValue* dictionary, SyncAllDataConfig config, - syncable::ModelTypeSet types) { + syncer::ModelTypeSet types) { CheckBool(dictionary, "syncAllDataTypes", config == SYNC_ALL_DATA); - CheckBool(dictionary, "appsSynced", types.Has(syncable::APPS)); - CheckBool(dictionary, "autofillSynced", types.Has(syncable::AUTOFILL)); - CheckBool(dictionary, "bookmarksSynced", types.Has(syncable::BOOKMARKS)); - CheckBool(dictionary, "extensionsSynced", types.Has(syncable::EXTENSIONS)); - CheckBool(dictionary, "passwordsSynced", types.Has(syncable::PASSWORDS)); - CheckBool(dictionary, "preferencesSynced", types.Has(syncable::PREFERENCES)); - CheckBool(dictionary, "sessionsSynced", types.Has(syncable::SESSIONS)); - CheckBool(dictionary, "themesSynced", types.Has(syncable::THEMES)); - CheckBool(dictionary, "typedUrlsSynced", types.Has(syncable::TYPED_URLS)); + CheckBool(dictionary, "appsSynced", types.Has(syncer::APPS)); + CheckBool(dictionary, "autofillSynced", types.Has(syncer::AUTOFILL)); + CheckBool(dictionary, "bookmarksSynced", types.Has(syncer::BOOKMARKS)); + CheckBool(dictionary, "extensionsSynced", types.Has(syncer::EXTENSIONS)); + CheckBool(dictionary, "passwordsSynced", types.Has(syncer::PASSWORDS)); + CheckBool(dictionary, "preferencesSynced", types.Has(syncer::PREFERENCES)); + CheckBool(dictionary, "sessionsSynced", types.Has(syncer::SESSIONS)); + CheckBool(dictionary, "themesSynced", types.Has(syncer::THEMES)); + CheckBool(dictionary, "typedUrlsSynced", types.Has(syncer::TYPED_URLS)); } @@ -881,7 +881,7 @@ TEST_P(SyncSetupHandlerTest, UnsuccessfullySetPassphrase) { // data type. TEST_P(SyncSetupHandlerTest, TestSyncIndividualTypes) { for (size_t i = 0; i < arraysize(kUserSelectableTypes); ++i) { - syncable::ModelTypeSet type_to_set; + syncer::ModelTypeSet type_to_set; type_to_set.Put(kUserSelectableTypes[i]); std::string args = GetConfiguration( NULL, CHOOSE_WHAT_TO_SYNC, type_to_set, "", ENCRYPT_PASSWORDS); @@ -1031,7 +1031,7 @@ TEST_P(SyncSetupHandlerTest, ShowSetupSyncForAllTypesIndividually) { browser_sync::SyncPrefs sync_prefs(profile_->GetPrefs()); sync_prefs.SetKeepEverythingSynced(false); SetDefaultExpectationsForConfigPage(); - syncable::ModelTypeSet types; + syncer::ModelTypeSet types; types.Put(kUserSelectableTypes[i]); EXPECT_CALL(*mock_pss_, GetPreferredDataTypes()). WillRepeatedly(Return(types)); diff --git a/chrome/browser/webdata/autocomplete_syncable_service.cc b/chrome/browser/webdata/autocomplete_syncable_service.cc index 3bb91b2..9992ba7 100644 --- a/chrome/browser/webdata/autocomplete_syncable_service.cc +++ b/chrome/browser/webdata/autocomplete_syncable_service.cc @@ -108,7 +108,7 @@ AutocompleteSyncableService::AutocompleteSyncableService() } syncer::SyncError AutocompleteSyncableService::MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> error_handler) { @@ -173,19 +173,19 @@ syncer::SyncError AutocompleteSyncableService::MergeDataAndStartSyncing( return error; } -void AutocompleteSyncableService::StopSyncing(syncable::ModelType type) { +void AutocompleteSyncableService::StopSyncing(syncer::ModelType type) { DCHECK(CalledOnValidThread()); - DCHECK_EQ(syncable::AUTOFILL, type); + DCHECK_EQ(syncer::AUTOFILL, type); sync_processor_.reset(NULL); error_handler_.reset(); } syncer::SyncDataList AutocompleteSyncableService::GetAllSyncData( - syncable::ModelType type) const { + syncer::ModelType type) const { DCHECK(CalledOnValidThread()); DCHECK(sync_processor_.get()); - DCHECK_EQ(type, syncable::AUTOFILL); + DCHECK_EQ(type, syncer::AUTOFILL); syncer::SyncDataList current_data; @@ -209,7 +209,7 @@ syncer::SyncError AutocompleteSyncableService::ProcessSyncChanges( if (!sync_processor_.get()) { syncer::SyncError error(FROM_HERE, "Models not yet associated.", - syncable::AUTOFILL); + syncer::AUTOFILL); return error; } diff --git a/chrome/browser/webdata/autocomplete_syncable_service.h b/chrome/browser/webdata/autocomplete_syncable_service.h index 5ab0b64..c900e43 100644 --- a/chrome/browser/webdata/autocomplete_syncable_service.h +++ b/chrome/browser/webdata/autocomplete_syncable_service.h @@ -48,17 +48,17 @@ class AutocompleteSyncableService explicit AutocompleteSyncableService(WebDataService* web_data_service); virtual ~AutocompleteSyncableService(); - static syncable::ModelType model_type() { return syncable::AUTOFILL; } + static syncer::ModelType model_type() { return syncer::AUTOFILL; } // syncer::SyncableService implementation. virtual syncer::SyncError MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> error_handler) OVERRIDE; - virtual void StopSyncing(syncable::ModelType type) OVERRIDE; + virtual void StopSyncing(syncer::ModelType type) OVERRIDE; virtual syncer::SyncDataList GetAllSyncData( - syncable::ModelType type) const OVERRIDE; + syncer::ModelType type) const OVERRIDE; virtual syncer::SyncError ProcessSyncChanges( const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) OVERRIDE; diff --git a/chrome/browser/webdata/autofill_profile_syncable_service.cc b/chrome/browser/webdata/autofill_profile_syncable_service.cc index 16ee53d..1eed62e 100644 --- a/chrome/browser/webdata/autofill_profile_syncable_service.cc +++ b/chrome/browser/webdata/autofill_profile_syncable_service.cc @@ -58,7 +58,7 @@ AutofillProfileSyncableService::AutofillProfileSyncableService() } syncer::SyncError AutofillProfileSyncableService::MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) { @@ -160,9 +160,9 @@ syncer::SyncError AutofillProfileSyncableService::MergeDataAndStartSyncing( return error; } -void AutofillProfileSyncableService::StopSyncing(syncable::ModelType type) { +void AutofillProfileSyncableService::StopSyncing(syncer::ModelType type) { DCHECK(CalledOnValidThread()); - DCHECK_EQ(type, syncable::AUTOFILL_PROFILE); + DCHECK_EQ(type, syncer::AUTOFILL_PROFILE); sync_processor_.reset(); sync_error_factory_.reset(); @@ -171,10 +171,10 @@ void AutofillProfileSyncableService::StopSyncing(syncable::ModelType type) { } syncer::SyncDataList AutofillProfileSyncableService::GetAllSyncData( - syncable::ModelType type) const { + syncer::ModelType type) const { DCHECK(CalledOnValidThread()); DCHECK(sync_processor_.get()); - DCHECK_EQ(type, syncable::AUTOFILL_PROFILE); + DCHECK_EQ(type, syncer::AUTOFILL_PROFILE); syncer::SyncDataList current_data; @@ -191,7 +191,7 @@ syncer::SyncError AutofillProfileSyncableService::ProcessSyncChanges( DCHECK(CalledOnValidThread()); if (!sync_processor_.get()) { syncer::SyncError error(FROM_HERE, "Models not yet associated.", - syncable::AUTOFILL_PROFILE); + syncer::AUTOFILL_PROFILE); return error; } @@ -376,7 +376,7 @@ AutofillProfileSyncableService::CreateOrUpdateProfile( DCHECK(profile_map); DCHECK(bundle); - DCHECK_EQ(syncable::AUTOFILL_PROFILE, data.GetDataType()); + DCHECK_EQ(syncer::AUTOFILL_PROFILE, data.GetDataType()); const sync_pb::EntitySpecifics& specifics = data.GetSpecifics(); const sync_pb::AutofillProfileSpecifics& autofill_specifics( diff --git a/chrome/browser/webdata/autofill_profile_syncable_service.h b/chrome/browser/webdata/autofill_profile_syncable_service.h index 7f33189..0fc15c2 100644 --- a/chrome/browser/webdata/autofill_profile_syncable_service.h +++ b/chrome/browser/webdata/autofill_profile_syncable_service.h @@ -45,17 +45,17 @@ class AutofillProfileSyncableService explicit AutofillProfileSyncableService(WebDataService* web_data_service); virtual ~AutofillProfileSyncableService(); - static syncable::ModelType model_type() { return syncable::AUTOFILL_PROFILE; } + static syncer::ModelType model_type() { return syncer::AUTOFILL_PROFILE; } // syncer::SyncableService implementation. virtual syncer::SyncError MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; - virtual void StopSyncing(syncable::ModelType type) OVERRIDE; + virtual void StopSyncing(syncer::ModelType type) OVERRIDE; virtual syncer::SyncDataList GetAllSyncData( - syncable::ModelType type) const OVERRIDE; + syncer::ModelType type) const OVERRIDE; virtual syncer::SyncError ProcessSyncChanges( const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) OVERRIDE; diff --git a/chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc b/chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc index e6652e8..09088e7 100644 --- a/chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc +++ b/chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc @@ -170,10 +170,10 @@ TEST_F(AutofillProfileSyncableServiceTest, MergeDataAndStartSyncing) { // Takes ownership of sync_processor_. autofill_syncable_service_.MergeDataAndStartSyncing( - syncable::AUTOFILL_PROFILE, data_list, + syncer::AUTOFILL_PROFILE, data_list, sync_processor_.PassAs<syncer::SyncChangeProcessor>(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); - autofill_syncable_service_.StopSyncing(syncable::AUTOFILL_PROFILE); + autofill_syncable_service_.StopSyncing(syncer::AUTOFILL_PROFILE); } TEST_F(AutofillProfileSyncableServiceTest, GetAllSyncData) { @@ -204,12 +204,12 @@ TEST_F(AutofillProfileSyncableServiceTest, GetAllSyncData) { syncer::SyncDataList data_list; // Takes ownership of sync_processor_. autofill_syncable_service_.MergeDataAndStartSyncing( - syncable::AUTOFILL_PROFILE, data_list, + syncer::AUTOFILL_PROFILE, data_list, sync_processor_.PassAs<syncer::SyncChangeProcessor>(), scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock())); syncer::SyncDataList data = - autofill_syncable_service_.GetAllSyncData(syncable::AUTOFILL_PROFILE); + autofill_syncable_service_.GetAllSyncData(syncer::AUTOFILL_PROFILE); EXPECT_EQ(2U, data.size()); EXPECT_EQ(guid_present1, data.front().GetSpecifics() @@ -258,7 +258,7 @@ TEST_F(AutofillProfileSyncableServiceTest, ActOnChange) { ON_CALL(*sync_processor_, ProcessSyncChanges(_, _)) .WillByDefault( Return(syncer::SyncError(FROM_HERE, std::string("an error"), - syncable::AUTOFILL_PROFILE))); + syncer::AUTOFILL_PROFILE))); EXPECT_CALL(*sync_processor_, ProcessSyncChanges(_, _)).Times(2); autofill_syncable_service_.set_sync_processor(sync_processor_.release()); diff --git a/chrome/common/chrome_notification_types.h b/chrome/common/chrome_notification_types.h index 6990616..44deed4 100644 --- a/chrome/common/chrome_notification_types.h +++ b/chrome/common/chrome_notification_types.h @@ -802,13 +802,13 @@ enum NotificationType { NOTIFICATION_SYNC_CONFIGURE_DONE, // A service is requesting a sync datatype refresh for the current profile. - // The details value is a const syncable::ModelTypePayloadMap. + // The details value is a const syncer::ModelTypePayloadMap. // If the payload map is empty, it should be treated as an invalidation for // all enabled types. This is used by session sync. NOTIFICATION_SYNC_REFRESH_LOCAL, // External notification requesting a sync datatype refresh for the current - // profile. The details value is a const syncable::ModelTypePayloadMap. + // profile. The details value is a const syncer::ModelTypePayloadMap. // If the payload map is empty, it should be treated as an invalidation for // all enabled types. This is used for notifications on Android. NOTIFICATION_SYNC_REFRESH_REMOTE, diff --git a/sync/api/fake_syncable_service.cc b/sync/api/fake_syncable_service.cc index b0ec323..078201b 100644 --- a/sync/api/fake_syncable_service.cc +++ b/sync/api/fake_syncable_service.cc @@ -11,7 +11,7 @@ namespace syncer { FakeSyncableService::FakeSyncableService() : syncing_(false), - type_(syncable::UNSPECIFIED) {} + type_(syncer::UNSPECIFIED) {} FakeSyncableService::~FakeSyncableService() {} @@ -31,7 +31,7 @@ bool FakeSyncableService::syncing() const { // SyncableService implementation. SyncError FakeSyncableService::MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const SyncDataList& initial_sync_data, scoped_ptr<SyncChangeProcessor> sync_processor, scoped_ptr<SyncErrorFactory> sync_error_factory) { @@ -43,13 +43,13 @@ SyncError FakeSyncableService::MergeDataAndStartSyncing( return merge_data_and_start_syncing_error_; } -void FakeSyncableService::StopSyncing(syncable::ModelType type) { +void FakeSyncableService::StopSyncing(syncer::ModelType type) { syncing_ = false; sync_processor_.reset(); } SyncDataList FakeSyncableService::GetAllSyncData( - syncable::ModelType type) const { + syncer::ModelType type) const { return SyncDataList(); } diff --git a/sync/api/fake_syncable_service.h b/sync/api/fake_syncable_service.h index b89cf1f..22e1c8c 100644 --- a/sync/api/fake_syncable_service.h +++ b/sync/api/fake_syncable_service.h @@ -29,12 +29,12 @@ class FakeSyncableService : public SyncableService { // SyncableService implementation. virtual SyncError MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const SyncDataList& initial_sync_data, scoped_ptr<SyncChangeProcessor> sync_processor, scoped_ptr<SyncErrorFactory> sync_error_factory) OVERRIDE; - virtual void StopSyncing(syncable::ModelType type) OVERRIDE; - virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE; + virtual void StopSyncing(syncer::ModelType type) OVERRIDE; + virtual SyncDataList GetAllSyncData(syncer::ModelType type) const OVERRIDE; virtual SyncError ProcessSyncChanges( const tracked_objects::Location& from_here, const SyncChangeList& change_list) OVERRIDE; @@ -44,7 +44,7 @@ class FakeSyncableService : public SyncableService { SyncError merge_data_and_start_syncing_error_; SyncError process_sync_changes_error_; bool syncing_; - syncable::ModelType type_; + syncer::ModelType type_; }; } // namespace syncer diff --git a/sync/api/sync_change.cc b/sync/api/sync_change.cc index 49a387b..64da5b7 100644 --- a/sync/api/sync_change.cc +++ b/sync/api/sync_change.cc @@ -25,11 +25,11 @@ bool SyncChange::IsValid() const { // Data from the syncer must always have valid specifics. if (!sync_data_.IsLocal()) - return syncable::IsRealDataType(sync_data_.GetDataType()); + return syncer::IsRealDataType(sync_data_.GetDataType()); // Local changes must always have a tag and specify a valid datatype. if (sync_data_.GetTag().empty() || - !syncable::IsRealDataType(sync_data_.GetDataType())) { + !syncer::IsRealDataType(sync_data_.GetDataType())) { return false; } diff --git a/sync/api/sync_change_unittest.cc b/sync/api/sync_change_unittest.cc index 3faa587..765bcdf 100644 --- a/sync/api/sync_change_unittest.cc +++ b/sync/api/sync_change_unittest.cc @@ -26,10 +26,10 @@ TEST_F(SyncChangeTest, LocalDelete) { SyncChange::SyncChangeType change_type = SyncChange::ACTION_DELETE; std::string tag = "client_tag"; SyncChange e(change_type, - SyncData::CreateLocalDelete(tag, syncable::PREFERENCES)); + SyncData::CreateLocalDelete(tag, syncer::PREFERENCES)); EXPECT_EQ(change_type, e.change_type()); EXPECT_EQ(tag, e.sync_data().GetTag()); - EXPECT_EQ(syncable::PREFERENCES, e.sync_data().GetDataType()); + EXPECT_EQ(syncer::PREFERENCES, e.sync_data().GetDataType()); } TEST_F(SyncChangeTest, LocalUpdate) { @@ -44,7 +44,7 @@ TEST_F(SyncChangeTest, LocalUpdate) { EXPECT_EQ(change_type, e.change_type()); EXPECT_EQ(tag, e.sync_data().GetTag()); EXPECT_EQ(title, e.sync_data().GetTitle()); - EXPECT_EQ(syncable::PREFERENCES, e.sync_data().GetDataType()); + EXPECT_EQ(syncer::PREFERENCES, e.sync_data().GetDataType()); scoped_ptr<DictionaryValue> ref_spec(EntitySpecificsToValue(specifics)); scoped_ptr<DictionaryValue> e_spec(EntitySpecificsToValue( e.sync_data().GetSpecifics())); @@ -63,7 +63,7 @@ TEST_F(SyncChangeTest, LocalAdd) { EXPECT_EQ(change_type, e.change_type()); EXPECT_EQ(tag, e.sync_data().GetTag()); EXPECT_EQ(title, e.sync_data().GetTitle()); - EXPECT_EQ(syncable::PREFERENCES, e.sync_data().GetDataType()); + EXPECT_EQ(syncer::PREFERENCES, e.sync_data().GetDataType()); scoped_ptr<DictionaryValue> ref_spec(EntitySpecificsToValue(specifics)); scoped_ptr<DictionaryValue> e_spec(EntitySpecificsToValue( e.sync_data().GetSpecifics())); @@ -103,7 +103,7 @@ TEST_F(SyncChangeTest, SyncerChanges) { // Verify update. SyncChange e = change_list[0]; EXPECT_EQ(SyncChange::ACTION_UPDATE, e.change_type()); - EXPECT_EQ(syncable::PREFERENCES, e.sync_data().GetDataType()); + EXPECT_EQ(syncer::PREFERENCES, e.sync_data().GetDataType()); scoped_ptr<DictionaryValue> ref_spec(EntitySpecificsToValue( update_specifics)); scoped_ptr<DictionaryValue> e_spec(EntitySpecificsToValue( @@ -113,7 +113,7 @@ TEST_F(SyncChangeTest, SyncerChanges) { // Verify add. e = change_list[1]; EXPECT_EQ(SyncChange::ACTION_ADD, e.change_type()); - EXPECT_EQ(syncable::PREFERENCES, e.sync_data().GetDataType()); + EXPECT_EQ(syncer::PREFERENCES, e.sync_data().GetDataType()); ref_spec.reset(EntitySpecificsToValue(add_specifics)); e_spec.reset(EntitySpecificsToValue(e.sync_data().GetSpecifics())); EXPECT_TRUE(ref_spec->Equals(e_spec.get())); @@ -121,7 +121,7 @@ TEST_F(SyncChangeTest, SyncerChanges) { // Verify delete. e = change_list[2]; EXPECT_EQ(SyncChange::ACTION_DELETE, e.change_type()); - EXPECT_EQ(syncable::PREFERENCES, e.sync_data().GetDataType()); + EXPECT_EQ(syncer::PREFERENCES, e.sync_data().GetDataType()); ref_spec.reset(EntitySpecificsToValue(delete_specifics)); e_spec.reset(EntitySpecificsToValue(e.sync_data().GetSpecifics())); EXPECT_TRUE(ref_spec->Equals(e_spec.get())); diff --git a/sync/api/sync_data.cc b/sync/api/sync_data.cc index 13c47c2..a2a4191 100644 --- a/sync/api/sync_data.cc +++ b/sync/api/sync_data.cc @@ -56,9 +56,9 @@ SyncData::~SyncData() {} // Static. SyncData SyncData::CreateLocalDelete( const std::string& sync_tag, - syncable::ModelType datatype) { + syncer::ModelType datatype) { sync_pb::EntitySpecifics specifics; - syncable::AddDefaultFieldValue(datatype, &specifics); + syncer::AddDefaultFieldValue(datatype, &specifics); return CreateLocalData(sync_tag, "", specifics); } @@ -91,8 +91,8 @@ const sync_pb::EntitySpecifics& SyncData::GetSpecifics() const { return immutable_entity_.Get().specifics(); } -syncable::ModelType SyncData::GetDataType() const { - return syncable::GetModelTypeFromSpecifics(GetSpecifics()); +syncer::ModelType SyncData::GetDataType() const { + return syncer::GetModelTypeFromSpecifics(GetSpecifics()); } const std::string& SyncData::GetTag() const { @@ -119,7 +119,7 @@ std::string SyncData::ToString() const { if (!IsValid()) return "<Invalid SyncData>"; - std::string type = syncable::ModelTypeToString(GetDataType()); + std::string type = syncer::ModelTypeToString(GetDataType()); std::string specifics; scoped_ptr<DictionaryValue> value( syncer::EntitySpecificsToValue(GetSpecifics())); diff --git a/sync/api/sync_data.h b/sync/api/sync_data.h index cabeab9..aa91912 100644 --- a/sync/api/sync_data.h +++ b/sync/api/sync_data.h @@ -21,7 +21,7 @@ class SyncEntity; namespace syncer { -typedef syncable::ModelType SyncDataType; +typedef syncer::ModelType SyncDataType; // A light-weight container for immutable sync data. Pass-by-value and storage // in STL containers are supported and encouraged if helpful. @@ -44,7 +44,7 @@ class SyncData { // overwritten if the datatype is encrypted. static SyncData CreateLocalDelete( const std::string& sync_tag, - syncable::ModelType datatype); + syncer::ModelType datatype); static SyncData CreateLocalData( const std::string& sync_tag, const std::string& non_unique_title, diff --git a/sync/api/sync_error.cc b/sync/api/sync_error.cc index be2a457..307f339 100644 --- a/sync/api/sync_error.cc +++ b/sync/api/sync_error.cc @@ -18,7 +18,7 @@ SyncError::SyncError() { SyncError::SyncError(const tracked_objects::Location& location, const std::string& message, - syncable::ModelType type) { + syncer::ModelType type) { Init(location, message, type); PrintLogError(); } @@ -51,19 +51,19 @@ void SyncError::Copy(const SyncError& other) { void SyncError::Clear() { location_.reset(); message_ = std::string(); - type_ = syncable::UNSPECIFIED; + type_ = syncer::UNSPECIFIED; } void SyncError::Reset(const tracked_objects::Location& location, const std::string& message, - syncable::ModelType type) { + syncer::ModelType type) { Init(location, message, type); PrintLogError(); } void SyncError::Init(const tracked_objects::Location& location, const std::string& message, - syncable::ModelType type) { + syncer::ModelType type) { location_.reset(new tracked_objects::Location(location)); message_ = message; type_ = type; @@ -84,7 +84,7 @@ const std::string& SyncError::message() const { return message_; } -syncable::ModelType SyncError::type() const { +syncer::ModelType SyncError::type() const { CHECK(IsSet()); return type_; } @@ -93,7 +93,7 @@ std::string SyncError::ToString() const { if (!IsSet()) { return std::string(); } - return location_->ToString() + ", " + syncable::ModelTypeToString(type_) + + return location_->ToString() + ", " + syncer::ModelTypeToString(type_) + ", Sync Error: " + message_; } @@ -102,7 +102,7 @@ void SyncError::PrintLogError() const { location_->line_number(), logging::LOG_ERROR).stream(), LOG_IS_ON(ERROR)) - << syncable::ModelTypeToString(type_) << ", Sync Error: " << message_; + << syncer::ModelTypeToString(type_) << ", Sync Error: " << message_; } void PrintTo(const SyncError& sync_error, std::ostream* os) { diff --git a/sync/api/sync_error.h b/sync/api/sync_error.h index 0e3a3c9..657c17d 100644 --- a/sync/api/sync_error.h +++ b/sync/api/sync_error.h @@ -33,7 +33,7 @@ class SyncError { // Will print the new error to LOG(ERROR). SyncError(const tracked_objects::Location& location, const std::string& message, - syncable::ModelType type); + syncer::ModelType type); // Copy and assign via deep copy. SyncError(const SyncError& other); @@ -46,7 +46,7 @@ class SyncError { // Will print the new error to LOG(ERROR). void Reset(const tracked_objects::Location& location, const std::string& message, - syncable::ModelType type); + syncer::ModelType type); // Whether this is a valid error or not. bool IsSet() const; @@ -54,7 +54,7 @@ class SyncError { // These must only be called if IsSet() is true. const tracked_objects::Location& location() const; const std::string& message() const; - syncable::ModelType type() const; + syncer::ModelType type() const; // Returns empty string is IsSet() is false. std::string ToString() const; @@ -70,7 +70,7 @@ class SyncError { // is called, IsSet() will return true. void Init(const tracked_objects::Location& location, const std::string& message, - syncable::ModelType type); + syncer::ModelType type); // Reset the error to it's default (unset) values. void Clear(); @@ -78,7 +78,7 @@ class SyncError { // scoped_ptr is necessary because Location objects aren't assignable. scoped_ptr<tracked_objects::Location> location_; std::string message_; - syncable::ModelType type_; + syncer::ModelType type_; }; // gmock printer helper. diff --git a/sync/api/sync_error_unittest.cc b/sync/api/sync_error_unittest.cc index 593eb0f..d14409f 100644 --- a/sync/api/sync_error_unittest.cc +++ b/sync/api/sync_error_unittest.cc @@ -12,7 +12,7 @@ namespace syncer { using std::string; -using syncable::ModelType; +using syncer::ModelType; namespace { @@ -26,7 +26,7 @@ TEST_F(SyncErrorTest, Unset) { TEST_F(SyncErrorTest, Default) { tracked_objects::Location location = FROM_HERE; std::string msg = "test"; - ModelType type = syncable::PREFERENCES; + ModelType type = syncer::PREFERENCES; SyncError error(location, msg, type); ASSERT_TRUE(error.IsSet()); EXPECT_EQ(location.line_number(), error.location().line_number()); @@ -37,7 +37,7 @@ TEST_F(SyncErrorTest, Default) { TEST_F(SyncErrorTest, Reset) { tracked_objects::Location location = FROM_HERE; std::string msg = "test"; - ModelType type = syncable::PREFERENCES; + ModelType type = syncer::PREFERENCES; SyncError error; EXPECT_FALSE(error.IsSet()); @@ -50,7 +50,7 @@ TEST_F(SyncErrorTest, Reset) { tracked_objects::Location location2 = FROM_HERE; std::string msg2 = "test"; - ModelType type2 = syncable::PREFERENCES; + ModelType type2 = syncer::PREFERENCES; error.Reset(location2, msg2, type2); ASSERT_TRUE(error.IsSet()); EXPECT_EQ(location2.line_number(), error.location().line_number()); @@ -61,7 +61,7 @@ TEST_F(SyncErrorTest, Reset) { TEST_F(SyncErrorTest, Copy) { tracked_objects::Location location = FROM_HERE; std::string msg = "test"; - ModelType type = syncable::PREFERENCES; + ModelType type = syncer::PREFERENCES; SyncError error1; EXPECT_FALSE(error1.IsSet()); @@ -89,7 +89,7 @@ TEST_F(SyncErrorTest, Copy) { TEST_F(SyncErrorTest, Assign) { tracked_objects::Location location = FROM_HERE; std::string msg = "test"; - ModelType type = syncable::PREFERENCES; + ModelType type = syncer::PREFERENCES; SyncError error1; EXPECT_FALSE(error1.IsSet()); @@ -116,7 +116,7 @@ TEST_F(SyncErrorTest, Assign) { TEST_F(SyncErrorTest, ToString) { tracked_objects::Location location = FROM_HERE; std::string msg = "test"; - ModelType type = syncable::PREFERENCES; + ModelType type = syncer::PREFERENCES; std::string expected = "Preferences, Sync Error: test"; SyncError error(location, msg, type); EXPECT_TRUE(error.IsSet()); diff --git a/sync/api/syncable_service.h b/sync/api/syncable_service.h index 2093047b..c3b2589 100644 --- a/sync/api/syncable_service.h +++ b/sync/api/syncable_service.h @@ -38,18 +38,18 @@ class SyncableService : public SyncChangeProcessor, // encountered, and a filled SyncError (IsSet() == true) // otherwise. virtual SyncError MergeDataAndStartSyncing( - syncable::ModelType type, + syncer::ModelType type, const SyncDataList& initial_sync_data, scoped_ptr<SyncChangeProcessor> sync_processor, scoped_ptr<SyncErrorFactory> error_handler) = 0; // Stop syncing the specified type and reset state. - virtual void StopSyncing(syncable::ModelType type) = 0; + virtual void StopSyncing(syncer::ModelType type) = 0; // Fills a list of SyncData from the local data. This should create an up // to date representation of the SyncableService's view of that datatype, and // should match/be a subset of the server's view of that datatype. - virtual SyncDataList GetAllSyncData(syncable::ModelType type) const = 0; + virtual SyncDataList GetAllSyncData(syncer::ModelType type) const = 0; // SyncChangeProcessor interface. // Process a list of new SyncChanges and update the local data as necessary. 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); diff --git a/sync/internal_api/base_node.cc b/sync/internal_api/base_node.cc index 911bc6a..fc0dfb2 100644 --- a/sync/internal_api/base_node.cc +++ b/sync/internal_api/base_node.cc @@ -64,11 +64,11 @@ BaseNode::BaseNode() : password_data_(new sync_pb::PasswordSpecificsData) {} BaseNode::~BaseNode() {} std::string BaseNode::GenerateSyncableHash( - syncable::ModelType model_type, const std::string& client_tag) { + syncer::ModelType model_type, const std::string& client_tag) { // Blank PB with just the field in it has termination symbol, // handy for delimiter. sync_pb::EntitySpecifics serialized_type; - syncable::AddDefaultFieldValue(model_type, &serialized_type); + syncer::AddDefaultFieldValue(model_type, &serialized_type); std::string hash_input; serialized_type.AppendToString(&hash_input); hash_input.append(client_tag); @@ -101,7 +101,7 @@ bool BaseNode::DecryptIfNecessary() { // we fill the unencrypted_data_ with a copy of the bookmark specifics that // follows the new bookmarks format. if (!specifics.has_encrypted()) { - if (GetModelType() == syncable::BOOKMARKS && + if (GetModelType() == syncer::BOOKMARKS && !specifics.bookmark().has_title() && !GetTitle().empty()) { // Last check ensures this isn't a new node. // We need to fill in the title. @@ -122,7 +122,7 @@ bool BaseNode::DecryptIfNecessary() { DecryptToString(encrypted); if (plaintext_data.length() == 0) { LOG(ERROR) << "Failed to decrypt encrypted node of type " << - syncable::ModelTypeToString(GetModelType()) << "."; + syncer::ModelTypeToString(GetModelType()) << "."; // Debugging for crbug.com/123223. We failed to decrypt the data, which // means we applied an update without having the key or lost the key at a // later point. @@ -135,7 +135,7 @@ bool BaseNode::DecryptIfNecessary() { return false; } DVLOG(2) << "Decrypted specifics of type " - << syncable::ModelTypeToString(GetModelType()) + << syncer::ModelTypeToString(GetModelType()) << " with content: " << plaintext_data; return true; } @@ -144,15 +144,15 @@ const sync_pb::EntitySpecifics& BaseNode::GetUnencryptedSpecifics( const syncable::Entry* entry) const { const sync_pb::EntitySpecifics& specifics = entry->Get(SPECIFICS); if (specifics.has_encrypted()) { - DCHECK_NE(syncable::GetModelTypeFromSpecifics(unencrypted_data_), - syncable::UNSPECIFIED); + DCHECK_NE(syncer::GetModelTypeFromSpecifics(unencrypted_data_), + syncer::UNSPECIFIED); return unencrypted_data_; } else { // Due to the change in bookmarks format, we need to check to see if this is // a legacy bookmarks (and has no title field in the proto). If it is, we // return the unencrypted_data_, which was filled in with the title by // DecryptIfNecessary(). - if (GetModelType() == syncable::BOOKMARKS) { + if (GetModelType() == syncer::BOOKMARKS) { const sync_pb::BookmarkSpecifics& bookmark_specifics = specifics.bookmark(); if (bookmark_specifics.has_title() || @@ -163,13 +163,13 @@ const sync_pb::EntitySpecifics& BaseNode::GetUnencryptedSpecifics( // |unencrypted_data_| to be non-empty. return specifics; } else { - DCHECK_EQ(syncable::GetModelTypeFromSpecifics(unencrypted_data_), - syncable::BOOKMARKS); + DCHECK_EQ(syncer::GetModelTypeFromSpecifics(unencrypted_data_), + syncer::BOOKMARKS); return unencrypted_data_; } } else { - DCHECK_EQ(syncable::GetModelTypeFromSpecifics(unencrypted_data_), - syncable::UNSPECIFIED); + DCHECK_EQ(syncer::GetModelTypeFromSpecifics(unencrypted_data_), + syncer::UNSPECIFIED); return specifics; } } @@ -195,7 +195,7 @@ bool BaseNode::GetIsFolder() const { std::string BaseNode::GetTitle() const { std::string result; // TODO(zea): refactor bookmarks to not need this functionality. - if (syncable::BOOKMARKS == GetModelType() && + if (syncer::BOOKMARKS == GetModelType() && GetEntry()->Get(syncable::SPECIFICS).has_encrypted()) { // Special case for legacy bookmarks dealing with encryption. ServerNameToSyncAPIName(GetBookmarkSpecifics().title(), &result); @@ -286,52 +286,52 @@ int64 BaseNode::GetExternalId() const { } const sync_pb::AppSpecifics& BaseNode::GetAppSpecifics() const { - DCHECK_EQ(syncable::APPS, GetModelType()); + DCHECK_EQ(syncer::APPS, GetModelType()); return GetEntitySpecifics().app(); } const sync_pb::AutofillSpecifics& BaseNode::GetAutofillSpecifics() const { - DCHECK_EQ(syncable::AUTOFILL, GetModelType()); + DCHECK_EQ(syncer::AUTOFILL, GetModelType()); return GetEntitySpecifics().autofill(); } const AutofillProfileSpecifics& BaseNode::GetAutofillProfileSpecifics() const { - DCHECK_EQ(GetModelType(), syncable::AUTOFILL_PROFILE); + DCHECK_EQ(GetModelType(), syncer::AUTOFILL_PROFILE); return GetEntitySpecifics().autofill_profile(); } const sync_pb::BookmarkSpecifics& BaseNode::GetBookmarkSpecifics() const { - DCHECK_EQ(syncable::BOOKMARKS, GetModelType()); + DCHECK_EQ(syncer::BOOKMARKS, GetModelType()); return GetEntitySpecifics().bookmark(); } const sync_pb::NigoriSpecifics& BaseNode::GetNigoriSpecifics() const { - DCHECK_EQ(syncable::NIGORI, GetModelType()); + DCHECK_EQ(syncer::NIGORI, GetModelType()); return GetEntitySpecifics().nigori(); } const sync_pb::PasswordSpecificsData& BaseNode::GetPasswordSpecifics() const { - DCHECK_EQ(syncable::PASSWORDS, GetModelType()); + DCHECK_EQ(syncer::PASSWORDS, GetModelType()); return *password_data_; } const sync_pb::ThemeSpecifics& BaseNode::GetThemeSpecifics() const { - DCHECK_EQ(syncable::THEMES, GetModelType()); + DCHECK_EQ(syncer::THEMES, GetModelType()); return GetEntitySpecifics().theme(); } const sync_pb::TypedUrlSpecifics& BaseNode::GetTypedUrlSpecifics() const { - DCHECK_EQ(syncable::TYPED_URLS, GetModelType()); + DCHECK_EQ(syncer::TYPED_URLS, GetModelType()); return GetEntitySpecifics().typed_url(); } const sync_pb::ExtensionSpecifics& BaseNode::GetExtensionSpecifics() const { - DCHECK_EQ(syncable::EXTENSIONS, GetModelType()); + DCHECK_EQ(syncer::EXTENSIONS, GetModelType()); return GetEntitySpecifics().extension(); } const sync_pb::SessionSpecifics& BaseNode::GetSessionSpecifics() const { - DCHECK_EQ(syncable::SESSIONS, GetModelType()); + DCHECK_EQ(syncer::SESSIONS, GetModelType()); return GetEntitySpecifics().session(); } @@ -339,15 +339,15 @@ const sync_pb::EntitySpecifics& BaseNode::GetEntitySpecifics() const { return GetUnencryptedSpecifics(GetEntry()); } -syncable::ModelType BaseNode::GetModelType() const { +syncer::ModelType BaseNode::GetModelType() const { return GetEntry()->GetModelType(); } void BaseNode::SetUnencryptedSpecifics( const sync_pb::EntitySpecifics& specifics) { - syncable::ModelType type = syncable::GetModelTypeFromSpecifics(specifics); - DCHECK_NE(syncable::UNSPECIFIED, type); - if (GetModelType() != syncable::UNSPECIFIED) { + syncer::ModelType type = syncer::GetModelTypeFromSpecifics(specifics); + DCHECK_NE(syncer::UNSPECIFIED, type); + if (GetModelType() != syncer::UNSPECIFIED) { DCHECK_EQ(GetModelType(), type); } unencrypted_data_.CopyFrom(specifics); diff --git a/sync/internal_api/base_transaction.cc b/sync/internal_api/base_transaction.cc index 5b81136..94a78c1 100644 --- a/sync/internal_api/base_transaction.cc +++ b/sync/internal_api/base_transaction.cc @@ -24,8 +24,7 @@ syncer::Cryptographer* BaseTransaction::GetCryptographer() const { return directory_->GetCryptographer(this->GetWrappedTrans()); } -syncable::ModelTypeSet GetEncryptedTypes( - const syncer::BaseTransaction* trans) { +syncer::ModelTypeSet GetEncryptedTypes(const syncer::BaseTransaction* trans) { return trans->GetCryptographer()->GetEncryptedTypes(); } diff --git a/sync/internal_api/change_reorder_buffer.cc b/sync/internal_api/change_reorder_buffer.cc index 916ce3a0..1d7da38 100644 --- a/sync/internal_api/change_reorder_buffer.cc +++ b/sync/internal_api/change_reorder_buffer.cc @@ -154,8 +154,7 @@ bool ChangeReorderBuffer::GetAllChangesInTreeOrder( CHECK_EQ(BaseNode::INIT_OK, node.InitByIdLookup(i->first)); // We only care about parents of entry's with position-sensitive models. - if (syncable::ShouldMaintainPosition( - node.GetEntry()->GetModelType())) { + if (syncer::ShouldMaintainPosition(node.GetEntry()->GetModelType())) { parents_of_position_changes.insert(node.GetParentId()); } } diff --git a/sync/internal_api/debug_info_event_listener.cc b/sync/internal_api/debug_info_event_listener.cc index 99f5411..259ad76 100644 --- a/sync/internal_api/debug_info_event_listener.cc +++ b/sync/internal_api/debug_info_event_listener.cc @@ -79,7 +79,7 @@ void DebugInfoEventListener::OnUpdatedToken(const std::string& token) { } void DebugInfoEventListener::OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) { CreateAndAddEvent(sync_pb::DebugEventInfo::ENCRYPTED_TYPES_CHANGED); } @@ -101,23 +101,22 @@ void DebugInfoEventListener::SetCryptographerReady(bool ready) { cryptographer_ready_ = ready; } -void DebugInfoEventListener::OnNudgeFromDatatype( - syncable::ModelType datatype) { +void DebugInfoEventListener::OnNudgeFromDatatype(syncer::ModelType datatype) { sync_pb::DebugEventInfo event_info; event_info.set_nudging_datatype( - syncable::GetSpecificsFieldNumberFromModelType(datatype)); + syncer::GetSpecificsFieldNumberFromModelType(datatype)); AddEventToQueue(event_info); } void DebugInfoEventListener::OnIncomingNotification( - const syncable::ModelTypePayloadMap& type_payloads) { + const syncer::ModelTypePayloadMap& type_payloads) { sync_pb::DebugEventInfo event_info; - syncable::ModelTypeSet types = ModelTypePayloadMapToEnumSet(type_payloads); + syncer::ModelTypeSet types = ModelTypePayloadMapToEnumSet(type_payloads); - for (syncable::ModelTypeSet::Iterator it = types.First(); + for (syncer::ModelTypeSet::Iterator it = types.First(); it.Good(); it.Inc()) { event_info.add_datatypes_notified_from_server( - syncable::GetSpecificsFieldNumberFromModelType(it.Get())); + syncer::GetSpecificsFieldNumberFromModelType(it.Get())); } AddEventToQueue(event_info); diff --git a/sync/internal_api/debug_info_event_listener.h b/sync/internal_api/debug_info_event_listener.h index 8fe9847..403c182 100644 --- a/sync/internal_api/debug_info_event_listener.h +++ b/sync/internal_api/debug_info_event_listener.h @@ -46,16 +46,16 @@ class DebugInfoEventListener : public syncer::SyncManager::Observer, virtual void OnStopSyncingPermanently() OVERRIDE; virtual void OnUpdatedToken(const std::string& token) OVERRIDE; virtual void OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) OVERRIDE; virtual void OnEncryptionComplete() OVERRIDE; virtual void OnActionableError( const syncer::SyncProtocolError& sync_error) OVERRIDE; // Sync manager events. - void OnNudgeFromDatatype(syncable::ModelType datatype); + void OnNudgeFromDatatype(syncer::ModelType datatype); void OnIncomingNotification( - const syncable::ModelTypePayloadMap& type_payloads); + const syncer::ModelTypePayloadMap& type_payloads); // DebugInfoGetter Implementation. virtual void GetAndClearDebugInfo(sync_pb::DebugInfo* debug_info) OVERRIDE; diff --git a/sync/internal_api/js_mutation_event_observer.cc b/sync/internal_api/js_mutation_event_observer.cc index 02f5837..d977fa5 100644 --- a/sync/internal_api/js_mutation_event_observer.cc +++ b/sync/internal_api/js_mutation_event_observer.cc @@ -44,14 +44,14 @@ const size_t kChangeLimit = 100; } // namespace void JsMutationEventObserver::OnChangesApplied( - syncable::ModelType model_type, + syncer::ModelType model_type, int64 write_transaction_id, const syncer::ImmutableChangeRecordList& changes) { if (!event_handler_.IsInitialized()) { return; } DictionaryValue details; - details.SetString("modelType", syncable::ModelTypeToString(model_type)); + details.SetString("modelType", syncer::ModelTypeToString(model_type)); details.SetString("writeTransactionId", base::Int64ToString(write_transaction_id)); base::Value* changes_value = NULL; @@ -74,18 +74,18 @@ void JsMutationEventObserver::OnChangesApplied( } void JsMutationEventObserver::OnChangesComplete( - syncable::ModelType model_type) { + syncer::ModelType model_type) { if (!event_handler_.IsInitialized()) { return; } DictionaryValue details; - details.SetString("modelType", syncable::ModelTypeToString(model_type)); + details.SetString("modelType", syncer::ModelTypeToString(model_type)); HandleJsEvent(FROM_HERE, "onChangesComplete", JsEventDetails(&details)); } void JsMutationEventObserver::OnTransactionWrite( const syncable::ImmutableWriteTransactionInfo& write_transaction_info, - syncable::ModelTypeSet models_with_changes) { + syncer::ModelTypeSet models_with_changes) { DCHECK(CalledOnValidThread()); if (!event_handler_.IsInitialized()) { return; @@ -94,7 +94,7 @@ void JsMutationEventObserver::OnTransactionWrite( details.Set("writeTransactionInfo", write_transaction_info.Get().ToValue(kChangeLimit)); details.Set("modelsWithChanges", - syncable::ModelTypeSetToValue(models_with_changes)); + syncer::ModelTypeSetToValue(models_with_changes)); HandleJsEvent(FROM_HERE, "onTransactionWrite", JsEventDetails(&details)); } diff --git a/sync/internal_api/js_mutation_event_observer.h b/sync/internal_api/js_mutation_event_observer.h index 18f6e32..858c05f 100644 --- a/sync/internal_api/js_mutation_event_observer.h +++ b/sync/internal_api/js_mutation_event_observer.h @@ -44,15 +44,15 @@ class JsMutationEventObserver // syncer::SyncManager::ChangeObserver implementation. virtual void OnChangesApplied( - syncable::ModelType model_type, + syncer::ModelType model_type, int64 write_transaction_id, const syncer::ImmutableChangeRecordList& changes) OVERRIDE; - virtual void OnChangesComplete(syncable::ModelType model_type) OVERRIDE; + virtual void OnChangesComplete(syncer::ModelType model_type) OVERRIDE; // syncable::TransactionObserver implementation. virtual void OnTransactionWrite( const syncable::ImmutableWriteTransactionInfo& write_transaction_info, - syncable::ModelTypeSet models_with_changes) OVERRIDE; + syncer::ModelTypeSet models_with_changes) OVERRIDE; private: base::WeakPtrFactory<JsMutationEventObserver> weak_ptr_factory_; diff --git a/sync/internal_api/js_mutation_event_observer_unittest.cc b/sync/internal_api/js_mutation_event_observer_unittest.cc index d13218a..a7eb824 100644 --- a/sync/internal_api/js_mutation_event_observer_unittest.cc +++ b/sync/internal_api/js_mutation_event_observer_unittest.cc @@ -46,9 +46,8 @@ TEST_F(JsMutationEventObserverTest, OnChangesApplied) { // We don't test with passwords as that requires additional setup. // Build a list of example ChangeRecords. - syncer::ChangeRecord changes[syncable::MODEL_TYPE_COUNT]; - for (int i = syncable::AUTOFILL_PROFILE; - i < syncable::MODEL_TYPE_COUNT; ++i) { + syncer::ChangeRecord changes[syncer::MODEL_TYPE_COUNT]; + for (int i = syncer::AUTOFILL_PROFILE; i < syncer::MODEL_TYPE_COUNT; ++i) { changes[i].id = i; switch (i % 3) { case 0: @@ -71,16 +70,15 @@ TEST_F(JsMutationEventObserverTest, OnChangesApplied) { // starting from changes[i]. // Set expectations for each data type. - for (int i = syncable::AUTOFILL_PROFILE; - i < syncable::MODEL_TYPE_COUNT; ++i) { + for (int i = syncer::AUTOFILL_PROFILE; i < syncer::MODEL_TYPE_COUNT; ++i) { const std::string& model_type_str = - syncable::ModelTypeToString(syncable::ModelTypeFromInt(i)); + syncer::ModelTypeToString(syncer::ModelTypeFromInt(i)); DictionaryValue expected_details; expected_details.SetString("modelType", model_type_str); expected_details.SetString("writeTransactionId", "0"); ListValue* expected_changes = new ListValue(); expected_details.Set("changes", expected_changes); - for (int j = i; j < syncable::MODEL_TYPE_COUNT; ++j) { + for (int j = i; j < syncer::MODEL_TYPE_COUNT; ++j) { expected_changes->Append(changes[j].ToValue()); } EXPECT_CALL(mock_js_event_handler_, @@ -89,12 +87,11 @@ TEST_F(JsMutationEventObserverTest, OnChangesApplied) { } // Fire OnChangesApplied() for each data type. - for (int i = syncable::AUTOFILL_PROFILE; - i < syncable::MODEL_TYPE_COUNT; ++i) { + for (int i = syncer::AUTOFILL_PROFILE; i < syncer::MODEL_TYPE_COUNT; ++i) { syncer::ChangeRecordList local_changes(changes + i, changes + arraysize(changes)); js_mutation_event_observer_.OnChangesApplied( - syncable::ModelTypeFromInt(i), + syncer::ModelTypeFromInt(i), 0, syncer::ImmutableChangeRecordList(&local_changes)); } @@ -104,21 +101,21 @@ TEST_F(JsMutationEventObserverTest, OnChangesApplied) { TEST_F(JsMutationEventObserverTest, OnChangesComplete) { InSequence dummy; - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i < syncable::MODEL_TYPE_COUNT; ++i) { + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i < syncer::MODEL_TYPE_COUNT; ++i) { DictionaryValue expected_details; expected_details.SetString( "modelType", - syncable::ModelTypeToString(syncable::ModelTypeFromInt(i))); + syncer::ModelTypeToString(syncer::ModelTypeFromInt(i))); EXPECT_CALL(mock_js_event_handler_, HandleJsEvent("onChangesComplete", HasDetailsAsDictionary(expected_details))); } - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i < syncable::MODEL_TYPE_COUNT; ++i) { + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i < syncer::MODEL_TYPE_COUNT; ++i) { js_mutation_event_observer_.OnChangesComplete( - syncable::ModelTypeFromInt(i)); + syncer::ModelTypeFromInt(i)); } PumpLoop(); } diff --git a/sync/internal_api/js_sync_manager_observer.cc b/sync/internal_api/js_sync_manager_observer.cc index 8a9889b..4bad2e0 100644 --- a/sync/internal_api/js_sync_manager_observer.cc +++ b/sync/internal_api/js_sync_manager_observer.cc @@ -92,14 +92,14 @@ void JsSyncManagerObserver::OnBootstrapTokenUpdated( } void JsSyncManagerObserver::OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) { if (!event_handler_.IsInitialized()) { return; } DictionaryValue details; details.Set("encryptedTypes", - syncable::ModelTypeSetToValue(encrypted_types)); + syncer::ModelTypeSetToValue(encrypted_types)); details.SetBoolean("encryptEverything", encrypt_everything); HandleJsEvent(FROM_HERE, "onEncryptedTypesChanged", JsEventDetails(&details)); diff --git a/sync/internal_api/js_sync_manager_observer.h b/sync/internal_api/js_sync_manager_observer.h index 918eab5..04eec48 100644 --- a/sync/internal_api/js_sync_manager_observer.h +++ b/sync/internal_api/js_sync_manager_observer.h @@ -44,7 +44,7 @@ class JsSyncManagerObserver : public syncer::SyncManager::Observer { virtual void OnBootstrapTokenUpdated( const std::string& bootstrap_token) OVERRIDE; virtual void OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) OVERRIDE; virtual void OnEncryptionComplete() OVERRIDE; virtual void OnInitializationComplete( diff --git a/sync/internal_api/js_sync_manager_observer_unittest.cc b/sync/internal_api/js_sync_manager_observer_unittest.cc index f0b9e85..8861311 100644 --- a/sync/internal_api/js_sync_manager_observer_unittest.cc +++ b/sync/internal_api/js_sync_manager_observer_unittest.cc @@ -64,10 +64,10 @@ TEST_F(JsSyncManagerObserverTest, NoArgNotifiations) { } TEST_F(JsSyncManagerObserverTest, OnSyncCycleCompleted) { - syncable::ModelTypePayloadMap download_progress_markers; + syncer::ModelTypePayloadMap download_progress_markers; sessions::SyncSessionSnapshot snapshot(sessions::ModelNeutralState(), false, - syncable::ModelTypeSet(), + syncer::ModelTypeSet(), download_progress_markers, false, true, @@ -186,14 +186,14 @@ TEST_F(JsSyncManagerObserverTest, OnEncryptedTypesChanged) { const bool encrypt_everything = false; expected_details.Set("encryptedTypes", encrypted_type_values); expected_details.SetBoolean("encryptEverything", encrypt_everything); - syncable::ModelTypeSet encrypted_types; + syncer::ModelTypeSet encrypted_types; - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i < syncable::MODEL_TYPE_COUNT; ++i) { - syncable::ModelType type = syncable::ModelTypeFromInt(i); + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i < syncer::MODEL_TYPE_COUNT; ++i) { + syncer::ModelType type = syncer::ModelTypeFromInt(i); encrypted_types.Put(type); encrypted_type_values->Append(Value::CreateStringValue( - syncable::ModelTypeToString(type))); + syncer::ModelTypeToString(type))); } EXPECT_CALL(mock_js_event_handler_, diff --git a/sync/internal_api/public/base/model_type.h b/sync/internal_api/public/base/model_type.h index 77c2344..c8b1948 100644 --- a/sync/internal_api/public/base/model_type.h +++ b/sync/internal_api/public/base/model_type.h @@ -30,8 +30,6 @@ class SyncEntity; namespace syncer { -namespace syncable { - enum ModelType { // Object type unknown. Objects may transition through // the unknown state during their initial creation, before @@ -103,7 +101,7 @@ inline ModelType ModelTypeFromInt(int i) { return static_cast<ModelType>(i); } -void AddDefaultFieldValue(syncable::ModelType datatype, +void AddDefaultFieldValue(ModelType datatype, sync_pb::EntitySpecifics* specifics); // Extract the model type of a SyncEntity protocol buffer. ModelType is a @@ -172,56 +170,6 @@ bool NotificationTypeToRealModelType(const std::string& notification_type, // Returns true if |model_type| is a real datatype bool IsRealDataType(ModelType model_type); -} // namespace syncable - } // namespace syncer -// TODO(akalin): Move the names below to the 'syncer' namespace once -// we move this file to public/base. -namespace syncable { - -using syncer::syncable::ModelType; -using syncer::syncable::ModelTypeSet; -using syncer::syncable::FullModelTypeSet; -using syncer::syncable::UNSPECIFIED; -using syncer::syncable::TOP_LEVEL_FOLDER; -using syncer::syncable::BOOKMARKS; -using syncer::syncable::FIRST_REAL_MODEL_TYPE; -using syncer::syncable::PREFERENCES; -using syncer::syncable::PASSWORDS; -using syncer::syncable::AUTOFILL_PROFILE; -using syncer::syncable::AUTOFILL; -using syncer::syncable::THEMES; -using syncer::syncable::TYPED_URLS; -using syncer::syncable::EXTENSIONS; -using syncer::syncable::NIGORI; -using syncer::syncable::SEARCH_ENGINES; -using syncer::syncable::SESSIONS; -using syncer::syncable::APPS; -using syncer::syncable::APP_SETTINGS; -using syncer::syncable::EXTENSION_SETTINGS; -using syncer::syncable::APP_NOTIFICATIONS; -using syncer::syncable::LAST_REAL_MODEL_TYPE; -using syncer::syncable::MODEL_TYPE_COUNT; -using syncer::syncable::ModelTypeFromInt; -using syncer::syncable::AddDefaultFieldValue; -using syncer::syncable::GetModelType; -using syncer::syncable::GetModelTypeFromSpecifics; -using syncer::syncable::ShouldMaintainPosition; -using syncer::syncable::GetModelTypeFromSpecificsFieldNumber; -using syncer::syncable::GetSpecificsFieldNumberFromModelType; -using syncer::syncable::ModelTypeToString; -using syncer::syncable::ModelTypeToValue; -using syncer::syncable::ModelTypeFromValue; -using syncer::syncable::ModelTypeFromString; -using syncer::syncable::ModelTypeSetToString; -using syncer::syncable::ModelTypeSetToValue; -using syncer::syncable::ModelTypeSetFromValue; -using syncer::syncable::ModelTypeToRootTag; -using syncer::syncable::RealModelTypeToNotificationType; -using syncer::syncable::NotificationTypeToRealModelType; -using syncer::syncable::IsRealDataType; - -} // namespace syncable - #endif // SYNC_INTERNAL_API_PUBLIC_BASE_MODEL_TYPE_H_ diff --git a/sync/internal_api/public/base/model_type_payload_map.cc b/sync/internal_api/public/base/model_type_payload_map.cc index 8fb458c..04222ee 100644 --- a/sync/internal_api/public/base/model_type_payload_map.cc +++ b/sync/internal_api/public/base/model_type_payload_map.cc @@ -12,13 +12,12 @@ #include "base/values.h" namespace syncer { -namespace syncable { ModelTypePayloadMap ModelTypePayloadMapFromEnumSet( - syncable::ModelTypeSet types, + syncer::ModelTypeSet types, const std::string& payload) { ModelTypePayloadMap types_with_payloads; - for (syncable::ModelTypeSet::Iterator it = types.First(); + for (syncer::ModelTypeSet::Iterator it = types.First(); it.Good(); it.Inc()) { types_with_payloads[it.Get()] = payload; } @@ -53,7 +52,7 @@ DictionaryValue* ModelTypePayloadMapToValue( std::string base64_marker; bool encoded = base::Base64Encode(it->second, &base64_marker); DCHECK(encoded); - value->SetString(syncable::ModelTypeToString(it->first), base64_marker); + value->SetString(syncer::ModelTypeToString(it->first), base64_marker); } return value; } @@ -74,6 +73,4 @@ void CoalescePayloads(ModelTypePayloadMap* original, } } -} // namespace syncable } // namespace syncer - diff --git a/sync/internal_api/public/base/model_type_payload_map.h b/sync/internal_api/public/base/model_type_payload_map.h index b95e152..da708f7 100644 --- a/sync/internal_api/public/base/model_type_payload_map.h +++ b/sync/internal_api/public/base/model_type_payload_map.h @@ -18,7 +18,6 @@ class DictionaryValue; } namespace syncer { -namespace syncable { // A container that contains a set of datatypes with possible string // payloads. @@ -46,20 +45,6 @@ base::DictionaryValue* ModelTypePayloadMapToValue( void CoalescePayloads(ModelTypePayloadMap* original, const ModelTypePayloadMap& update); -} // namespace syncable } // namespace syncer -// TODO(akalin): Move the names below to the 'syncer' namespace once -// we move this file to public/base. -namespace syncable { - -using ::syncer::syncable::ModelTypePayloadMap; -using ::syncer::syncable::ModelTypePayloadMapFromEnumSet; -using ::syncer::syncable::ModelTypePayloadMapToEnumSet; -using ::syncer::syncable::ModelTypePayloadMapToString; -using ::syncer::syncable::ModelTypePayloadMapToValue; -using ::syncer::syncable::CoalescePayloads; - -} // namespace syncable - #endif // SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_PAYLOAD_MAP_H_ diff --git a/sync/internal_api/public/base/model_type_payload_map_unittest.cc b/sync/internal_api/public/base/model_type_payload_map_unittest.cc index 485048d..1a20867 100644 --- a/sync/internal_api/public/base/model_type_payload_map_unittest.cc +++ b/sync/internal_api/public/base/model_type_payload_map_unittest.cc @@ -13,7 +13,6 @@ #include "testing/gtest/include/gtest/gtest.h" namespace syncer { -namespace syncable { namespace { using base::ExpectDictStringValue; @@ -44,32 +43,31 @@ TEST_F(ModelTypePayloadMapTest, TypePayloadMapToValue) { } TEST_F(ModelTypePayloadMapTest, CoalescePayloads) { - syncable::ModelTypePayloadMap original; + syncer::ModelTypePayloadMap original; std::string empty_payload; std::string payload1 = "payload1"; std::string payload2 = "payload2"; std::string payload3 = "payload3"; - original[syncable::BOOKMARKS] = empty_payload; - original[syncable::PASSWORDS] = payload1; - original[syncable::AUTOFILL] = payload2; - original[syncable::THEMES] = payload3; + original[syncer::BOOKMARKS] = empty_payload; + original[syncer::PASSWORDS] = payload1; + original[syncer::AUTOFILL] = payload2; + original[syncer::THEMES] = payload3; - syncable::ModelTypePayloadMap update; - update[syncable::BOOKMARKS] = empty_payload; // Same. - update[syncable::PASSWORDS] = empty_payload; // Overwrite with empty. - update[syncable::AUTOFILL] = payload1; // Overwrite with non-empty. - update[syncable::SESSIONS] = payload2; // New. + syncer::ModelTypePayloadMap update; + update[syncer::BOOKMARKS] = empty_payload; // Same. + update[syncer::PASSWORDS] = empty_payload; // Overwrite with empty. + update[syncer::AUTOFILL] = payload1; // Overwrite with non-empty. + update[syncer::SESSIONS] = payload2; // New. // Themes untouched. CoalescePayloads(&original, update); ASSERT_EQ(5U, original.size()); - EXPECT_EQ(empty_payload, original[syncable::BOOKMARKS]); - EXPECT_EQ(payload1, original[syncable::PASSWORDS]); - EXPECT_EQ(payload1, original[syncable::AUTOFILL]); - EXPECT_EQ(payload2, original[syncable::SESSIONS]); - EXPECT_EQ(payload3, original[syncable::THEMES]); + EXPECT_EQ(empty_payload, original[syncer::BOOKMARKS]); + EXPECT_EQ(payload1, original[syncer::PASSWORDS]); + EXPECT_EQ(payload1, original[syncer::AUTOFILL]); + EXPECT_EQ(payload2, original[syncer::SESSIONS]); + EXPECT_EQ(payload3, original[syncer::THEMES]); } } // namespace -} // namespace syncable } // namespace syncer diff --git a/sync/internal_api/public/base/model_type_test_util.cc b/sync/internal_api/public/base/model_type_test_util.cc index 5c07e8c..8c1164b 100644 --- a/sync/internal_api/public/base/model_type_test_util.cc +++ b/sync/internal_api/public/base/model_type_test_util.cc @@ -5,7 +5,6 @@ #include "sync/internal_api/public/base/model_type_test_util.h" namespace syncer { -namespace syncable { void PrintTo(ModelTypeSet model_types, ::std::ostream* os) { *os << ModelTypeSetToString(model_types); @@ -50,5 +49,4 @@ class HasModelTypesMatcher return ::testing::MakeMatcher(new HasModelTypesMatcher(expected_types)); } -} // namespace syncable } // namespace syncer diff --git a/sync/internal_api/public/base/model_type_test_util.h b/sync/internal_api/public/base/model_type_test_util.h index 4f5b804..0bac4b7 100644 --- a/sync/internal_api/public/base/model_type_test_util.h +++ b/sync/internal_api/public/base/model_type_test_util.h @@ -12,7 +12,6 @@ #include "testing/gmock/include/gmock/gmock.h" namespace syncer { -namespace syncable { // Defined for googletest. Forwards to ModelTypeSetToString(). void PrintTo(ModelTypeSet model_types, ::std::ostream* os); @@ -22,7 +21,6 @@ void PrintTo(ModelTypeSet model_types, ::std::ostream* os); // EXPECT_CALL(mock, ProcessModelTypes(HasModelTypes(expected_types))); ::testing::Matcher<ModelTypeSet> HasModelTypes(ModelTypeSet expected_types); -} // namespace syncable } // namespace syncer #endif // SYNC_INTERNAL_PUBLIC_API_BASE_MODEL_TYPE_TEST_UTIL_H_ diff --git a/sync/internal_api/public/base_node.h b/sync/internal_api/public/base_node.h index 7112d73..7212927 100644 --- a/sync/internal_api/public/base_node.h +++ b/sync/internal_api/public/base_node.h @@ -79,7 +79,7 @@ class BaseNode { // by doing a client tag lookup. Returns false on failure. A deleted node // will return FALSE. virtual InitByLookupResult InitByClientTagLookup( - syncable::ModelType model_type, + syncer::ModelType model_type, const std::string& tag) = 0; // Each object is identified by a 64-bit id (internally, the syncable @@ -107,7 +107,7 @@ class BaseNode { // Returns the model type of this object. The model type is set at node // creation time and is expected never to change. - syncable::ModelType GetModelType() const; + syncer::ModelType GetModelType() const; // Getter specific to the BOOKMARK datatype. Returns protobuf // data. Can only be called if GetModelType() == BOOKMARK. @@ -203,7 +203,7 @@ class BaseNode { virtual ~BaseNode(); // The server has a size limit on client tags, so we generate a fixed length // hash locally. This also ensures that ModelTypes have unique namespaces. - static std::string GenerateSyncableHash(syncable::ModelType model_type, + static std::string GenerateSyncableHash(syncer::ModelType model_type, const std::string& client_tag); // Determines whether part of the entry is encrypted, and if so attempts to diff --git a/sync/internal_api/public/base_transaction.h b/sync/internal_api/public/base_transaction.h index 09d8a58..7781692 100644 --- a/sync/internal_api/public/base_transaction.h +++ b/sync/internal_api/public/base_transaction.h @@ -46,8 +46,7 @@ class BaseTransaction { DISALLOW_COPY_AND_ASSIGN(BaseTransaction); }; -syncable::ModelTypeSet GetEncryptedTypes( - const syncer::BaseTransaction* trans); +syncer::ModelTypeSet GetEncryptedTypes(const syncer::BaseTransaction* trans); } // namespace syncer diff --git a/sync/internal_api/public/engine/model_safe_worker.cc b/sync/internal_api/public/engine/model_safe_worker.cc index f3722d4..7623cd3 100644 --- a/sync/internal_api/public/engine/model_safe_worker.cc +++ b/sync/internal_api/public/engine/model_safe_worker.cc @@ -15,7 +15,7 @@ base::DictionaryValue* ModelSafeRoutingInfoToValue( base::DictionaryValue* dict = new base::DictionaryValue(); for (ModelSafeRoutingInfo::const_iterator it = routing_info.begin(); it != routing_info.end(); ++it) { - dict->SetString(syncable::ModelTypeToString(it->first), + dict->SetString(syncer::ModelTypeToString(it->first), ModelSafeGroupToString(it->second)); } return dict; @@ -29,10 +29,10 @@ std::string ModelSafeRoutingInfoToString( return json; } -syncable::ModelTypePayloadMap ModelSafeRoutingInfoToPayloadMap( +syncer::ModelTypePayloadMap ModelSafeRoutingInfoToPayloadMap( const ModelSafeRoutingInfo& routes, const std::string& payload) { - syncable::ModelTypePayloadMap types_with_payloads; + syncer::ModelTypePayloadMap types_with_payloads; for (ModelSafeRoutingInfo::const_iterator i = routes.begin(); i != routes.end(); ++i) { types_with_payloads[i->first] = payload; @@ -40,9 +40,9 @@ syncable::ModelTypePayloadMap ModelSafeRoutingInfoToPayloadMap( return types_with_payloads; } -syncable::ModelTypeSet GetRoutingInfoTypes( +syncer::ModelTypeSet GetRoutingInfoTypes( const ModelSafeRoutingInfo& routing_info) { - syncable::ModelTypeSet types; + syncer::ModelTypeSet types; for (ModelSafeRoutingInfo::const_iterator it = routing_info.begin(); it != routing_info.end(); ++it) { types.Put(it->first); @@ -50,11 +50,11 @@ syncable::ModelTypeSet GetRoutingInfoTypes( return types; } -ModelSafeGroup GetGroupForModelType(const syncable::ModelType type, +ModelSafeGroup GetGroupForModelType(const syncer::ModelType type, const ModelSafeRoutingInfo& routes) { ModelSafeRoutingInfo::const_iterator it = routes.find(type); if (it == routes.end()) { - if (type != syncable::UNSPECIFIED && type != syncable::TOP_LEVEL_FOLDER) + if (type != syncer::UNSPECIFIED && type != syncer::TOP_LEVEL_FOLDER) LOG(WARNING) << "Entry does not belong to active ModelSafeGroup!"; return GROUP_PASSIVE; } diff --git a/sync/internal_api/public/engine/model_safe_worker.h b/sync/internal_api/public/engine/model_safe_worker.h index ce14c1d..5c9c7ae 100644 --- a/sync/internal_api/public/engine/model_safe_worker.h +++ b/sync/internal_api/public/engine/model_safe_worker.h @@ -64,10 +64,10 @@ class ModelSafeWorker : public base::RefCountedThreadSafe<ModelSafeWorker> { friend class base::RefCountedThreadSafe<ModelSafeWorker>; }; -// A map that details which ModelSafeGroup each syncable::ModelType +// A map that details which ModelSafeGroup each syncer::ModelType // belongs to. Routing info can change in response to the user enabling / // disabling sync for certain types, as well as model association completions. -typedef std::map<syncable::ModelType, ModelSafeGroup> +typedef std::map<syncer::ModelType, ModelSafeGroup> ModelSafeRoutingInfo; // Caller takes ownership of return value. @@ -79,14 +79,14 @@ std::string ModelSafeRoutingInfoToString( // Make a ModelTypePayloadMap for all the enabled types in a // ModelSafeRoutingInfo using a default payload. -syncable::ModelTypePayloadMap ModelSafeRoutingInfoToPayloadMap( +syncer::ModelTypePayloadMap ModelSafeRoutingInfoToPayloadMap( const ModelSafeRoutingInfo& routes, const std::string& payload); -syncable::ModelTypeSet GetRoutingInfoTypes( +syncer::ModelTypeSet GetRoutingInfoTypes( const ModelSafeRoutingInfo& routing_info); -ModelSafeGroup GetGroupForModelType(const syncable::ModelType type, +ModelSafeGroup GetGroupForModelType(const syncer::ModelType type, const ModelSafeRoutingInfo& routes); } // namespace syncer diff --git a/sync/internal_api/public/engine/model_safe_worker_unittest.cc b/sync/internal_api/public/engine/model_safe_worker_unittest.cc index a25e0b1..b1036b5 100644 --- a/sync/internal_api/public/engine/model_safe_worker_unittest.cc +++ b/sync/internal_api/public/engine/model_safe_worker_unittest.cc @@ -16,9 +16,9 @@ class ModelSafeWorkerTest : public ::testing::Test { TEST_F(ModelSafeWorkerTest, ModelSafeRoutingInfoToValue) { ModelSafeRoutingInfo routing_info; - routing_info[syncable::BOOKMARKS] = GROUP_PASSIVE; - routing_info[syncable::NIGORI] = GROUP_UI; - routing_info[syncable::PREFERENCES] = GROUP_DB; + routing_info[syncer::BOOKMARKS] = GROUP_PASSIVE; + routing_info[syncer::NIGORI] = GROUP_UI; + routing_info[syncer::PREFERENCES] = GROUP_DB; DictionaryValue expected_value; expected_value.SetString("Bookmarks", "GROUP_PASSIVE"); expected_value.SetString("Encryption keys", "GROUP_UI"); @@ -30,9 +30,9 @@ TEST_F(ModelSafeWorkerTest, ModelSafeRoutingInfoToValue) { TEST_F(ModelSafeWorkerTest, ModelSafeRoutingInfoToString) { ModelSafeRoutingInfo routing_info; - routing_info[syncable::BOOKMARKS] = GROUP_PASSIVE; - routing_info[syncable::NIGORI] = GROUP_UI; - routing_info[syncable::PREFERENCES] = GROUP_DB; + routing_info[syncer::BOOKMARKS] = GROUP_PASSIVE; + routing_info[syncer::NIGORI] = GROUP_UI; + routing_info[syncer::PREFERENCES] = GROUP_DB; EXPECT_EQ( "{\"Bookmarks\":\"GROUP_PASSIVE\",\"Encryption keys\":\"GROUP_UI\"," "\"Preferences\":\"GROUP_DB\"}", @@ -41,23 +41,23 @@ TEST_F(ModelSafeWorkerTest, ModelSafeRoutingInfoToString) { TEST_F(ModelSafeWorkerTest, GetRoutingInfoTypes) { ModelSafeRoutingInfo routing_info; - routing_info[syncable::BOOKMARKS] = GROUP_PASSIVE; - routing_info[syncable::NIGORI] = GROUP_UI; - routing_info[syncable::PREFERENCES] = GROUP_DB; - const syncable::ModelTypeSet expected_types( - syncable::BOOKMARKS, - syncable::NIGORI, - syncable::PREFERENCES); + routing_info[syncer::BOOKMARKS] = GROUP_PASSIVE; + routing_info[syncer::NIGORI] = GROUP_UI; + routing_info[syncer::PREFERENCES] = GROUP_DB; + const syncer::ModelTypeSet expected_types( + syncer::BOOKMARKS, + syncer::NIGORI, + syncer::PREFERENCES); EXPECT_TRUE(GetRoutingInfoTypes(routing_info).Equals(expected_types)); } TEST_F(ModelSafeWorkerTest, ModelSafeRoutingInfoToPayloadMap) { std::string payload = "test"; ModelSafeRoutingInfo routing_info; - routing_info[syncable::BOOKMARKS] = GROUP_PASSIVE; - routing_info[syncable::NIGORI] = GROUP_UI; - routing_info[syncable::PREFERENCES] = GROUP_DB; - syncable::ModelTypePayloadMap types_with_payloads = + routing_info[syncer::BOOKMARKS] = GROUP_PASSIVE; + routing_info[syncer::NIGORI] = GROUP_UI; + routing_info[syncer::PREFERENCES] = GROUP_DB; + syncer::ModelTypePayloadMap types_with_payloads = ModelSafeRoutingInfoToPayloadMap(routing_info, payload); ASSERT_EQ(routing_info.size(), types_with_payloads.size()); for (ModelSafeRoutingInfo::iterator iter = routing_info.begin(); diff --git a/sync/internal_api/public/engine/sync_status.h b/sync/internal_api/public/engine/sync_status.h index c9cff52..5e330ac 100644 --- a/sync/internal_api/public/engine/sync_status.h +++ b/sync/internal_api/public/engine/sync_status.h @@ -80,12 +80,12 @@ struct SyncStatus { int useful_sync_cycles; // Encryption related. - syncable::ModelTypeSet encrypted_types; + syncer::ModelTypeSet encrypted_types; bool cryptographer_ready; bool crypto_has_pending_keys; // Per-datatype throttled status. - syncable::ModelTypeSet throttled_types; + syncer::ModelTypeSet throttled_types; // The unique identifer for this client. std::string unique_id; diff --git a/sync/internal_api/public/read_node.h b/sync/internal_api/public/read_node.h index c3947a7..f253fc3 100644 --- a/sync/internal_api/public/read_node.h +++ b/sync/internal_api/public/read_node.h @@ -30,7 +30,7 @@ class ReadNode : public BaseNode { // BaseNode implementation. virtual InitByLookupResult InitByIdLookup(int64 id) OVERRIDE; virtual InitByLookupResult InitByClientTagLookup( - syncable::ModelType model_type, + syncer::ModelType model_type, const std::string& tag) OVERRIDE; // There is always a root node, so this can't fail. The root node is diff --git a/sync/internal_api/public/sessions/model_neutral_state.h b/sync/internal_api/public/sessions/model_neutral_state.h index fa127b0..d9d53ab 100644 --- a/sync/internal_api/public/sessions/model_neutral_state.h +++ b/sync/internal_api/public/sessions/model_neutral_state.h @@ -24,7 +24,7 @@ struct ModelNeutralState { // We GetUpdates for some combination of types at once. // requested_update_types stores the set of types which were requested. - syncable::ModelTypeSet updates_request_types; + syncer::ModelTypeSet updates_request_types; sync_pb::ClientToServerResponse updates_response; @@ -40,7 +40,7 @@ struct ModelNeutralState { // If the syncer encountered a MIGRATION_DONE code, these are the types that // the client must now "migrate", by purging and re-downloading all updates. - syncable::ModelTypeSet types_needing_local_migration; + syncer::ModelTypeSet types_needing_local_migration; // Overwrites due to conflict resolution counters. int num_local_overwrites; diff --git a/sync/internal_api/public/sessions/sync_session_snapshot.cc b/sync/internal_api/public/sessions/sync_session_snapshot.cc index 4427236..4d966dee 100644 --- a/sync/internal_api/public/sessions/sync_session_snapshot.cc +++ b/sync/internal_api/public/sessions/sync_session_snapshot.cc @@ -27,8 +27,8 @@ SyncSessionSnapshot::SyncSessionSnapshot() SyncSessionSnapshot::SyncSessionSnapshot( const ModelNeutralState& model_neutral_state, bool is_share_usable, - syncable::ModelTypeSet initial_sync_ended, - const syncable::ModelTypePayloadMap& download_progress_markers, + syncer::ModelTypeSet initial_sync_ended, + const syncer::ModelTypePayloadMap& download_progress_markers, bool more_to_sync, bool is_silenced, int num_encryption_conflicts, @@ -80,9 +80,9 @@ DictionaryValue* SyncSessionSnapshot::ToValue() const { static_cast<int>(model_neutral_state_.num_server_changes_remaining)); value->SetBoolean("isShareUsable", is_share_usable_); value->Set("initialSyncEnded", - syncable::ModelTypeSetToValue(initial_sync_ended_)); + syncer::ModelTypeSetToValue(initial_sync_ended_)); value->Set("downloadProgressMarkers", - syncable::ModelTypePayloadMapToValue(download_progress_markers_)); + syncer::ModelTypePayloadMapToValue(download_progress_markers_)); value->SetBoolean("hasMoreToSync", has_more_to_sync_); value->SetBoolean("isSilenced", is_silenced_); // We don't care too much if we lose precision here, also. @@ -117,11 +117,11 @@ bool SyncSessionSnapshot::is_share_usable() const { return is_share_usable_; } -syncable::ModelTypeSet SyncSessionSnapshot::initial_sync_ended() const { +syncer::ModelTypeSet SyncSessionSnapshot::initial_sync_ended() const { return initial_sync_ended_; } -syncable::ModelTypePayloadMap +syncer::ModelTypePayloadMap SyncSessionSnapshot::download_progress_markers() const { return download_progress_markers_; } diff --git a/sync/internal_api/public/sessions/sync_session_snapshot.h b/sync/internal_api/public/sessions/sync_session_snapshot.h index 2363878..7c88753 100644 --- a/sync/internal_api/public/sessions/sync_session_snapshot.h +++ b/sync/internal_api/public/sessions/sync_session_snapshot.h @@ -33,8 +33,8 @@ class SyncSessionSnapshot { SyncSessionSnapshot( const ModelNeutralState& model_neutral_state, bool is_share_usable, - syncable::ModelTypeSet initial_sync_ended, - const syncable::ModelTypePayloadMap& download_progress_markers, + syncer::ModelTypeSet initial_sync_ended, + const syncer::ModelTypePayloadMap& download_progress_markers, bool more_to_sync, bool is_silenced, int num_encryption_conflicts, @@ -58,8 +58,8 @@ class SyncSessionSnapshot { } int64 num_server_changes_remaining() const; bool is_share_usable() const; - syncable::ModelTypeSet initial_sync_ended() const; - syncable::ModelTypePayloadMap download_progress_markers() const; + syncer::ModelTypeSet initial_sync_ended() const; + syncer::ModelTypePayloadMap download_progress_markers() const; bool has_more_to_sync() const; bool is_silenced() const; int num_encryption_conflicts() const; @@ -75,8 +75,8 @@ class SyncSessionSnapshot { private: ModelNeutralState model_neutral_state_; bool is_share_usable_; - syncable::ModelTypeSet initial_sync_ended_; - syncable::ModelTypePayloadMap download_progress_markers_; + syncer::ModelTypeSet initial_sync_ended_; + syncer::ModelTypePayloadMap download_progress_markers_; bool has_more_to_sync_; bool is_silenced_; int num_encryption_conflicts_; diff --git a/sync/internal_api/public/sessions/sync_source_info.cc b/sync/internal_api/public/sessions/sync_source_info.cc index e4536ee..e133f08 100644 --- a/sync/internal_api/public/sessions/sync_source_info.cc +++ b/sync/internal_api/public/sessions/sync_source_info.cc @@ -13,13 +13,12 @@ namespace sessions { SyncSourceInfo::SyncSourceInfo() : updates_source(sync_pb::GetUpdatesCallerInfo::UNKNOWN) {} -SyncSourceInfo::SyncSourceInfo( - const syncable::ModelTypePayloadMap& t) +SyncSourceInfo::SyncSourceInfo(const syncer::ModelTypePayloadMap& t) : updates_source(sync_pb::GetUpdatesCallerInfo::UNKNOWN), types(t) {} SyncSourceInfo::SyncSourceInfo( const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& u, - const syncable::ModelTypePayloadMap& t) + const syncer::ModelTypePayloadMap& t) : updates_source(u), types(t) {} SyncSourceInfo::~SyncSourceInfo() {} @@ -28,7 +27,7 @@ DictionaryValue* SyncSourceInfo::ToValue() const { DictionaryValue* value = new DictionaryValue(); value->SetString("updatesSource", GetUpdatesSourceString(updates_source)); - value->Set("types", syncable::ModelTypePayloadMapToValue(types)); + value->Set("types", syncer::ModelTypePayloadMapToValue(types)); return value; } diff --git a/sync/internal_api/public/sessions/sync_source_info.h b/sync/internal_api/public/sessions/sync_source_info.h index 6505411..812afb7 100644 --- a/sync/internal_api/public/sessions/sync_source_info.h +++ b/sync/internal_api/public/sessions/sync_source_info.h @@ -23,17 +23,17 @@ namespace sessions { // specific payloads which should be sent to the server. struct SyncSourceInfo { SyncSourceInfo(); - explicit SyncSourceInfo(const syncable::ModelTypePayloadMap& t); + explicit SyncSourceInfo(const syncer::ModelTypePayloadMap& t); SyncSourceInfo( const sync_pb::GetUpdatesCallerInfo::GetUpdatesSource& u, - const syncable::ModelTypePayloadMap& t); + const syncer::ModelTypePayloadMap& t); ~SyncSourceInfo(); // Caller takes ownership of the returned dictionary. base::DictionaryValue* ToValue() const; sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source; - syncable::ModelTypePayloadMap types; + syncer::ModelTypePayloadMap types; }; } // namespace sessions diff --git a/sync/internal_api/public/sync_manager.h b/sync/internal_api/public/sync_manager.h index 8c196a1..75e55aa 100644 --- a/sync/internal_api/public/sync_manager.h +++ b/sync/internal_api/public/sync_manager.h @@ -122,7 +122,7 @@ class SyncManager { // operations, a delete may temporarily orphan a node that is // updated later in the list. virtual void OnChangesApplied( - syncable::ModelType model_type, + syncer::ModelType model_type, const BaseTransaction* trans, const ImmutableChangeRecordList& changes) = 0; @@ -137,7 +137,7 @@ class SyncManager { // those changes, let the transaction fall out of scope, and then commit // those changes from within OnChangesComplete (postponing the blocking // I/O to when it no longer holds any lock). - virtual void OnChangesComplete(syncable::ModelType model_type) = 0; + virtual void OnChangesComplete(syncer::ModelType model_type) = 0; protected: virtual ~ChangeDelegate(); @@ -165,11 +165,11 @@ class SyncManager { // be able to apply changes without being under a transaction. // But that's a ways off... virtual void OnChangesApplied( - syncable::ModelType model_type, + syncer::ModelType model_type, int64 write_transaction_id, const ImmutableChangeRecordList& changes) = 0; - virtual void OnChangesComplete(syncable::ModelType model_type) = 0; + virtual void OnChangesComplete(syncer::ModelType model_type) = 0; protected: virtual ~ChangeObserver(); @@ -324,7 +324,7 @@ class SyncManager { // // Called from within a transaction. virtual void OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) = 0; // Called after we finish encrypting the current set of encrypted @@ -399,13 +399,13 @@ class SyncManager { void ThrowUnrecoverableError(); // Returns the set of types for which we have stored some sync data. - syncable::ModelTypeSet InitialSyncEndedTypes(); + syncer::ModelTypeSet InitialSyncEndedTypes(); // Update tokens that we're using in Sync. Email must stay the same. void UpdateCredentials(const SyncCredentials& credentials); // Called when the user disables or enables a sync type. - void UpdateEnabledTypes(const syncable::ModelTypeSet& enabled_types); + void UpdateEnabledTypes(const syncer::ModelTypeSet& enabled_types); // Put the syncer in normal mode ready to perform nudges and polls. void StartSyncingNormally( @@ -437,7 +437,7 @@ class SyncManager { // Switches the mode of operation to CONFIGURATION_MODE and // schedules a config task to fetch updates for |types|. void RequestConfig(const syncer::ModelSafeRoutingInfo& routing_info, - const syncable::ModelTypeSet& types, + const syncer::ModelTypeSet& types, syncer::ConfigureReason reason); void RequestCleanupDisabledTypes( @@ -511,7 +511,7 @@ class SyncManager { // Gets the set of encrypted types from the cryptographer // Note: opens a transaction. May be called from any thread. - syncable::ModelTypeSet GetEncryptedDataTypesForTest() const; + syncer::ModelTypeSet GetEncryptedDataTypesForTest() const; // Reads the nigori node to determine if any experimental features should // be enabled. @@ -529,7 +529,7 @@ class SyncManager { void SimulateDisableNotificationsForTest(int reason); void TriggerOnIncomingNotificationForTest( - syncable::ModelTypeSet model_types); + syncer::ModelTypeSet model_types); static const int kDefaultNudgeDelayMilliseconds; static const int kPreferencesNudgeDelayMilliseconds; @@ -541,7 +541,7 @@ class SyncManager { FRIEND_TEST_ALL_PREFIXES(SyncManagerTest, NudgeDelayTest); // For unit tests. - base::TimeDelta GetNudgeDelayTimeDelta(const syncable::ModelType& model_type); + base::TimeDelta GetNudgeDelayTimeDelta(const syncer::ModelType& model_type); base::ThreadChecker thread_checker_; @@ -551,10 +551,10 @@ class SyncManager { DISALLOW_COPY_AND_ASSIGN(SyncManager); }; -bool InitialSyncEndedForTypes(syncable::ModelTypeSet types, UserShare* share); +bool InitialSyncEndedForTypes(syncer::ModelTypeSet types, UserShare* share); -syncable::ModelTypeSet GetTypesWithEmptyProgressMarkerToken( - syncable::ModelTypeSet types, +syncer::ModelTypeSet GetTypesWithEmptyProgressMarkerToken( + syncer::ModelTypeSet types, syncer::UserShare* share); const char* ConnectionStatusToString(ConnectionStatus status); diff --git a/sync/internal_api/public/test/test_entry_factory.h b/sync/internal_api/public/test/test_entry_factory.h index bcf5316..931b8e7 100644 --- a/sync/internal_api/public/test/test_entry_factory.h +++ b/sync/internal_api/public/test/test_entry_factory.h @@ -42,18 +42,18 @@ class TestEntryFactory { const syncable::Id& parent_id, const std::string& name, bool is_folder, - syncable::ModelType model_type, + syncer::ModelType model_type, int64* metahandle_out); // Creates an item that is both unsynced an an unapplied update. Returns the // metahandle of the created item. int64 CreateUnappliedAndUnsyncedItem(const std::string& name, - syncable::ModelType model_type); + syncer::ModelType model_type); // Creates an item that has neither IS_UNSYNED or IS_UNAPPLIED_UPDATE. The // item is known to both the server and client. Returns the metahandle of // the created item. - int64 CreateSyncedItem(const std::string& name, syncable::ModelType + int64 CreateSyncedItem(const std::string& name, syncer::ModelType model_type, bool is_folder); int64 GetNextRevision(); diff --git a/sync/internal_api/public/write_node.h b/sync/internal_api/public/write_node.h index 29182de..2965741 100644 --- a/sync/internal_api/public/write_node.h +++ b/sync/internal_api/public/write_node.h @@ -65,7 +65,7 @@ class WriteNode : public BaseNode { // BaseNode implementation. virtual InitByLookupResult InitByIdLookup(int64 id) OVERRIDE; virtual InitByLookupResult InitByClientTagLookup( - syncable::ModelType model_type, + syncer::ModelType model_type, const std::string& tag) OVERRIDE; // Create a new node with the specified parent and predecessor. |model_type| @@ -74,7 +74,7 @@ class WriteNode : public BaseNode { // to indicate that this is to be the first child. // |predecessor| must be a child of |new_parent| or NULL. Returns false on // failure. - bool InitByCreation(syncable::ModelType model_type, + bool InitByCreation(syncer::ModelType model_type, const BaseNode& parent, const BaseNode* predecessor); @@ -85,7 +85,7 @@ class WriteNode : public BaseNode { // actually undelete it // Client unique tagged nodes must NOT be folders. InitUniqueByCreationResult InitUniqueByCreation( - syncable::ModelType model_type, + syncer::ModelType model_type, const BaseNode& parent, const std::string& client_tag); @@ -178,7 +178,7 @@ class WriteNode : public BaseNode { void* operator new(size_t size); // Node is meant for stack use only. // Helper to set model type. This will clear any specifics data. - void PutModelType(syncable::ModelType model_type); + void PutModelType(syncer::ModelType model_type); // Helper to set the previous node. bool PutPredecessor(const BaseNode* predecessor) WARN_UNUSED_RESULT; diff --git a/sync/internal_api/read_node.cc b/sync/internal_api/read_node.cc index 6f7fc35..9f31781 100644 --- a/sync/internal_api/read_node.cc +++ b/sync/internal_api/read_node.cc @@ -44,15 +44,15 @@ BaseNode::InitByLookupResult ReadNode::InitByIdLookup(int64 id) { return INIT_FAILED_ENTRY_NOT_GOOD; if (entry_->Get(syncable::IS_DEL)) return INIT_FAILED_ENTRY_IS_DEL; - syncable::ModelType model_type = GetModelType(); - LOG_IF(WARNING, model_type == syncable::UNSPECIFIED || - model_type == syncable::TOP_LEVEL_FOLDER) + syncer::ModelType model_type = GetModelType(); + LOG_IF(WARNING, model_type == syncer::UNSPECIFIED || + model_type == syncer::TOP_LEVEL_FOLDER) << "SyncAPI InitByIdLookup referencing unusual object."; return DecryptIfNecessary() ? INIT_OK : INIT_FAILED_DECRYPT_IF_NECESSARY; } BaseNode::InitByLookupResult ReadNode::InitByClientTagLookup( - syncable::ModelType model_type, + syncer::ModelType model_type, const std::string& tag) { DCHECK(!entry_) << "Init called twice"; if (tag.empty()) @@ -88,9 +88,9 @@ BaseNode::InitByLookupResult ReadNode::InitByTagLookup( return INIT_FAILED_ENTRY_NOT_GOOD; if (entry_->Get(syncable::IS_DEL)) return INIT_FAILED_ENTRY_IS_DEL; - syncable::ModelType model_type = GetModelType(); - LOG_IF(WARNING, model_type == syncable::UNSPECIFIED || - model_type == syncable::TOP_LEVEL_FOLDER) + syncer::ModelType model_type = GetModelType(); + LOG_IF(WARNING, model_type == syncer::UNSPECIFIED || + model_type == syncer::TOP_LEVEL_FOLDER) << "SyncAPI InitByTagLookup referencing unusually typed object."; return DecryptIfNecessary() ? INIT_OK : INIT_FAILED_DECRYPT_IF_NECESSARY; } diff --git a/sync/internal_api/sync_manager.cc b/sync/internal_api/sync_manager.cc index 2d0645d..c8a293e 100644 --- a/sync/internal_api/sync_manager.cc +++ b/sync/internal_api/sync_manager.cc @@ -98,8 +98,6 @@ namespace syncer { using sessions::SyncSessionContext; using syncable::ImmutableWriteTransactionInfo; -using syncable::ModelType; -using syncable::ModelTypeSet; using syncable::SPECIFICS; const int SyncManager::kDefaultNudgeDelayMilliseconds = 200; @@ -135,10 +133,10 @@ class SyncManager::SyncInternal created_on_loop_(MessageLoop::current()), nigori_overwrite_count_(0) { // Pre-fill |notification_info_map_|. - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i < syncable::MODEL_TYPE_COUNT; ++i) { + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i < syncer::MODEL_TYPE_COUNT; ++i) { notification_info_map_.insert( - std::make_pair(syncable::ModelTypeFromInt(i), NotificationInfo())); + std::make_pair(syncer::ModelTypeFromInt(i), NotificationInfo())); } // Bind message handlers. @@ -297,7 +295,7 @@ class SyncManager::SyncInternal // Cryptographer::Observer implementation. virtual void OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) OVERRIDE; // SyncNotifierObserver implementation. @@ -305,7 +303,7 @@ class SyncManager::SyncInternal virtual void OnNotificationsDisabled( syncer::NotificationsDisabledReason reason) OVERRIDE; virtual void OnIncomingNotification( - const syncable::ModelTypePayloadMap& type_payloads, + const syncer::ModelTypePayloadMap& type_payloads, syncer::IncomingNotificationSource source) OVERRIDE; void AddObserver(SyncManager::Observer* observer); @@ -349,7 +347,7 @@ class SyncManager::SyncInternal // ExtraPasswordChangeRecordData field of |buffer|. Otherwise sets // |buffer|'s specifics field to contain the unencrypted data. void SetExtraChangeRecordData(int64 id, - syncable::ModelType type, + syncer::ModelType type, ChangeReorderBuffer* buffer, Cryptographer* cryptographer, const syncable::EntryKernel& original, @@ -359,7 +357,7 @@ class SyncManager::SyncInternal // Called only by our NetworkChangeNotifier. virtual void OnIPAddressChanged() OVERRIDE; - syncable::ModelTypeSet InitialSyncEndedTypes() { + syncer::ModelTypeSet InitialSyncEndedTypes() { DCHECK(initialized_); return directory()->initial_sync_ended_types(); } @@ -396,7 +394,7 @@ class SyncManager::SyncInternal } }; - typedef std::map<syncable::ModelType, NotificationInfo> NotificationInfoMap; + typedef std::map<syncer::ModelType, NotificationInfo> NotificationInfoMap; typedef JsArgList (SyncManager::SyncInternal::*UnboundJsMessageHandler)(const JsArgList&); typedef base::Callback<JsArgList(const JsArgList&)> JsMessageHandler; @@ -421,7 +419,7 @@ class SyncManager::SyncInternal // If the datatype isn't one where the browser model cares about position, // don't bother notifying that data model of position-only changes. if (!ShouldMaintainPosition( - syncable::GetModelTypeFromSpecifics(b.ref(SPECIFICS)))) + syncer::GetModelTypeFromSpecifics(b.ref(SPECIFICS)))) return false; if (a.ref(syncable::NEXT_ID) != b.ref(syncable::NEXT_ID)) return true; @@ -440,12 +438,12 @@ class SyncManager::SyncInternal const syncable::EntryKernel& b = mutation.mutated; const sync_pb::EntitySpecifics& a_specifics = a.ref(SPECIFICS); const sync_pb::EntitySpecifics& b_specifics = b.ref(SPECIFICS); - DCHECK_EQ(syncable::GetModelTypeFromSpecifics(a_specifics), - syncable::GetModelTypeFromSpecifics(b_specifics)); - syncable::ModelType model_type = - syncable::GetModelTypeFromSpecifics(b_specifics); + DCHECK_EQ(syncer::GetModelTypeFromSpecifics(a_specifics), + syncer::GetModelTypeFromSpecifics(b_specifics)); + syncer::ModelType model_type = + syncer::GetModelTypeFromSpecifics(b_specifics); // Suppress updates to items that aren't tracked by any browser model. - if (model_type < syncable::FIRST_REAL_MODEL_TYPE || + if (model_type < syncer::FIRST_REAL_MODEL_TYPE || !a.ref(syncable::UNIQUE_SERVER_TAG).empty()) { return false; } @@ -467,7 +465,7 @@ class SyncManager::SyncInternal } bool ChangeBuffersAreEmpty() { - for (int i = 0; i < syncable::MODEL_TYPE_COUNT; ++i) { + for (int i = 0; i < syncer::MODEL_TYPE_COUNT; ++i) { if (!change_buffers_[i].IsEmpty()) return false; } @@ -479,7 +477,7 @@ class SyncManager::SyncInternal // Called for every notification. This updates the notification statistics // to be displayed in about:sync. void UpdateNotificationInfo( - const syncable::ModelTypePayloadMap& type_payloads); + const syncer::ModelTypePayloadMap& type_payloads); // Checks for server reachabilty and requests a nudge. void OnIPAddressChangedImpl(); @@ -560,7 +558,7 @@ class SyncManager::SyncInternal // forwarded to the observer slightly later, at the TRANSACTION_ENDING // step by HandleTransactionEndingChangeEvent. The list is cleared in the // TRANSACTION_COMPLETE step by HandleTransactionCompleteChangeEvent. - ChangeReorderBuffer change_buffers_[syncable::MODEL_TYPE_COUNT]; + ChangeReorderBuffer change_buffers_[syncer::MODEL_TYPE_COUNT]; SyncManager::ChangeDelegate* change_delegate_; @@ -633,10 +631,10 @@ class NudgeStrategy { static NudgeDelayStrategy GetNudgeDelayStrategy(const ModelType& type) { switch (type) { - case syncable::AUTOFILL: + case syncer::AUTOFILL: return ACCOMPANY_ONLY; - case syncable::PREFERENCES: - case syncable::SESSIONS: + case syncer::PREFERENCES: + case syncer::SESSIONS: return CUSTOM; default: return IMMEDIATE; @@ -660,11 +658,11 @@ class NudgeStrategy { break; case CUSTOM: switch (model_type) { - case syncable::PREFERENCES: + case syncer::PREFERENCES: delay = TimeDelta::FromMilliseconds( SyncManager::kPreferencesNudgeDelayMilliseconds); break; - case syncable::SESSIONS: + case syncer::SESSIONS: delay = core->scheduler()->sessions_commit_delay(); break; default: @@ -747,7 +745,7 @@ void SyncManager::ThrowUnrecoverableError() { FROM_HERE, "Simulating unrecoverable error for testing purposes."); } -syncable::ModelTypeSet SyncManager::InitialSyncEndedTypes() { +syncer::ModelTypeSet SyncManager::InitialSyncEndedTypes() { return data_->InitialSyncEndedTypes(); } @@ -1013,7 +1011,7 @@ void SyncManager::SyncInternal::UpdateCryptographerAndNigoriCallback( const std::string& chrome_version, const base::Closure& done_callback, const std::string& session_name) { - if (!directory()->initial_sync_ended_for_type(syncable::NIGORI)) { + if (!directory()->initial_sync_ended_for_type(syncer::NIGORI)) { done_callback.Run(); // Should only happen during first time sync. return; } @@ -1553,15 +1551,14 @@ void SyncManager::SyncInternal::ReEncryptEverything(WriteTransaction* trans) { Cryptographer* cryptographer = trans->GetCryptographer(); if (!cryptographer || !cryptographer->is_ready()) return; - syncable::ModelTypeSet encrypted_types = GetEncryptedTypes(trans); - for (syncable::ModelTypeSet::Iterator iter = encrypted_types.First(); + syncer::ModelTypeSet encrypted_types = GetEncryptedTypes(trans); + for (syncer::ModelTypeSet::Iterator iter = encrypted_types.First(); iter.Good(); iter.Inc()) { - if (iter.Get() == syncable::PASSWORDS || - iter.Get() == syncable::NIGORI) + if (iter.Get() == syncer::PASSWORDS || iter.Get() == syncer::NIGORI) continue; // These types handle encryption differently. ReadNode type_root(trans); - std::string tag = syncable::ModelTypeToRootTag(iter.Get()); + std::string tag = syncer::ModelTypeToRootTag(iter.Get()); if (type_root.InitByTagLookup(tag) != syncer::BaseNode::INIT_OK) continue; // Don't try to reencrypt if the type's data is unavailable. @@ -1595,8 +1592,7 @@ void SyncManager::SyncInternal::ReEncryptEverything(WriteTransaction* trans) { // Passwords are encrypted with their own legacy scheme. Passwords are always // encrypted so we don't need to check GetEncryptedTypes() here. ReadNode passwords_root(trans); - std::string passwords_tag = - syncable::ModelTypeToRootTag(syncable::PASSWORDS); + std::string passwords_tag = syncer::ModelTypeToRootTag(syncer::PASSWORDS); if (passwords_root.InitByTagLookup(passwords_tag) == syncer::BaseNode::INIT_OK) { int64 child_id = passwords_root.GetFirstChildId(); @@ -1774,9 +1770,9 @@ ModelTypeSet ReadTransaction read_trans(GetUserShare(), trans); ModelTypeSet models_with_changes; - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i < syncable::MODEL_TYPE_COUNT; ++i) { - const syncable::ModelType type = syncable::ModelTypeFromInt(i); + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i < syncer::MODEL_TYPE_COUNT; ++i) { + const syncer::ModelType type = syncer::ModelTypeFromInt(i); if (change_buffers_[type].IsEmpty()) continue; @@ -1810,7 +1806,7 @@ void SyncManager::SyncInternal::HandleCalculateChangesChangeEventFromSyncApi( "CALCULATE_CHANGES called with unapplied old changes."; // The mutated model type, or UNSPECIFIED if nothing was mutated. - syncable::ModelTypeSet mutated_model_types; + syncer::ModelTypeSet mutated_model_types; const syncable::ImmutableEntryKernelMutationMap& mutations = write_transaction_info.Get().mutations; @@ -1820,16 +1816,16 @@ void SyncManager::SyncInternal::HandleCalculateChangesChangeEventFromSyncApi( continue; } - syncable::ModelType model_type = - syncable::GetModelTypeFromSpecifics( + syncer::ModelType model_type = + syncer::GetModelTypeFromSpecifics( it->second.mutated.ref(SPECIFICS)); - if (model_type < syncable::FIRST_REAL_MODEL_TYPE) { + if (model_type < syncer::FIRST_REAL_MODEL_TYPE) { NOTREACHED() << "Permanent or underspecified item changed via syncapi."; continue; } // Found real mutation. - if (model_type != syncable::UNSPECIFIED) { + if (model_type != syncer::UNSPECIFIED) { mutated_model_types.Put(model_type); } } @@ -1848,14 +1844,14 @@ void SyncManager::SyncInternal::HandleCalculateChangesChangeEventFromSyncApi( } void SyncManager::SyncInternal::SetExtraChangeRecordData(int64 id, - syncable::ModelType type, ChangeReorderBuffer* buffer, + syncer::ModelType type, ChangeReorderBuffer* buffer, Cryptographer* cryptographer, const syncable::EntryKernel& original, bool existed_before, bool exists_now) { // If this is a deletion and the datatype was encrypted, we need to decrypt it // and attach it to the buffer. if (!exists_now && existed_before) { sync_pb::EntitySpecifics original_specifics(original.ref(SPECIFICS)); - if (type == syncable::PASSWORDS) { + if (type == syncer::PASSWORDS) { // Passwords must use their own legacy ExtraPasswordChangeRecordData. scoped_ptr<sync_pb::PasswordSpecificsData> data( DecryptPasswordSpecifics(original_specifics, cryptographer)); @@ -1894,10 +1890,10 @@ void SyncManager::SyncInternal::HandleCalculateChangesChangeEventFromSyncer( bool exists_now = !it->second.mutated.ref(syncable::IS_DEL); // Omit items that aren't associated with a model. - syncable::ModelType type = - syncable::GetModelTypeFromSpecifics( + syncer::ModelType type = + syncer::GetModelTypeFromSpecifics( it->second.mutated.ref(SPECIFICS)); - if (type < syncable::FIRST_REAL_MODEL_TYPE) + if (type < syncer::FIRST_REAL_MODEL_TYPE) continue; int64 handle = it->first; @@ -1979,7 +1975,7 @@ void SyncManager::SyncInternal::OnSyncEngineEvent( OnPassphraseRequired(syncer::REASON_DECRYPTION, pending_keys)); } else if (!cryptographer->is_ready() && - event.snapshot.initial_sync_ended().Has(syncable::NIGORI)) { + event.snapshot.initial_sync_ended().Has(syncer::NIGORI)) { DVLOG(1) << "OnPassphraseRequired sent because cryptographer is not " << "ready"; FOR_EACH_OBSERVER(SyncManager::Observer, observers_, @@ -2022,7 +2018,7 @@ void SyncManager::SyncInternal::OnSyncEngineEvent( if (is_notifiable_commit) { if (sync_notifier_.get()) { const ModelTypeSet changed_types = - syncable::ModelTypePayloadMapToEnumSet( + syncer::ModelTypePayloadMapToEnumSet( event.snapshot.source().types); sync_notifier_->SendNotification(changed_types); } else { @@ -2100,7 +2096,7 @@ DictionaryValue* SyncManager::SyncInternal::NotificationInfoToValue( for (NotificationInfoMap::const_iterator it = notification_info.begin(); it != notification_info.end(); ++it) { const std::string& model_type_str = - syncable::ModelTypeToString(it->first); + syncer::ModelTypeToString(it->first); value->Set(model_type_str, it->second.ToValue()); } @@ -2233,7 +2229,7 @@ JsArgList SyncManager::SyncInternal::GetChildNodeIds( } void SyncManager::SyncInternal::OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) { // NOTE: We're in a transaction. FOR_EACH_OBSERVER( @@ -2242,8 +2238,8 @@ void SyncManager::SyncInternal::OnEncryptedTypesChanged( } void SyncManager::SyncInternal::UpdateNotificationInfo( - const syncable::ModelTypePayloadMap& type_payloads) { - for (syncable::ModelTypePayloadMap::const_iterator it = type_payloads.begin(); + const syncer::ModelTypePayloadMap& type_payloads) { + for (syncer::ModelTypePayloadMap::const_iterator it = type_payloads.begin(); it != type_payloads.end(); ++it) { NotificationInfo* info = ¬ification_info_map_[it->first]; info->total_count++; @@ -2290,7 +2286,7 @@ void SyncManager::SyncInternal::OnNotificationsDisabled( } void SyncManager::SyncInternal::OnIncomingNotification( - const syncable::ModelTypePayloadMap& type_payloads, + const syncer::ModelTypePayloadMap& type_payloads, syncer::IncomingNotificationSource source) { DCHECK(thread_checker_.CalledOnValidThread()); if (source == syncer::LOCAL_NOTIFICATION) { @@ -2318,11 +2314,11 @@ void SyncManager::SyncInternal::OnIncomingNotification( DictionaryValue details; ListValue* changed_types = new ListValue(); details.Set("changedTypes", changed_types); - for (syncable::ModelTypePayloadMap::const_iterator + for (syncer::ModelTypePayloadMap::const_iterator it = type_payloads.begin(); it != type_payloads.end(); ++it) { const std::string& model_type_str = - syncable::ModelTypeToString(it->first); + syncer::ModelTypeToString(it->first); changed_types->Append(Value::CreateStringValue(model_type_str)); } details.SetString("source", (source == syncer::LOCAL_NOTIFICATION) ? @@ -2374,7 +2370,7 @@ TimeDelta SyncManager::GetNudgeDelayTimeDelta( return data_->GetNudgeDelayTimeDelta(model_type); } -syncable::ModelTypeSet SyncManager::GetEncryptedDataTypesForTest() const { +syncer::ModelTypeSet SyncManager::GetEncryptedDataTypesForTest() const { ReadTransaction trans(FROM_HERE, GetUserShare()); return GetEncryptedTypes(&trans); } @@ -2414,8 +2410,8 @@ void SyncManager::SimulateDisableNotificationsForTest(int reason) { void SyncManager::TriggerOnIncomingNotificationForTest( ModelTypeSet model_types) { DCHECK(thread_checker_.CalledOnValidThread()); - syncable::ModelTypePayloadMap model_types_with_payloads = - syncable::ModelTypePayloadMapFromEnumSet(model_types, + syncer::ModelTypePayloadMap model_types_with_payloads = + syncer::ModelTypePayloadMapFromEnumSet(model_types, std::string()); data_->OnIncomingNotification(model_types_with_payloads, @@ -2453,9 +2449,9 @@ const char* PassphraseRequiredReasonToString( } // Helper function to determine if initial sync had ended for types. -bool InitialSyncEndedForTypes(syncable::ModelTypeSet types, +bool InitialSyncEndedForTypes(syncer::ModelTypeSet types, syncer::UserShare* share) { - for (syncable::ModelTypeSet::Iterator i = types.First(); + for (syncer::ModelTypeSet::Iterator i = types.First(); i.Good(); i.Inc()) { if (!share->directory->initial_sync_ended_for_type(i.Get())) return false; @@ -2463,11 +2459,11 @@ bool InitialSyncEndedForTypes(syncable::ModelTypeSet types, return true; } -syncable::ModelTypeSet GetTypesWithEmptyProgressMarkerToken( - syncable::ModelTypeSet types, +syncer::ModelTypeSet GetTypesWithEmptyProgressMarkerToken( + syncer::ModelTypeSet types, syncer::UserShare* share) { - syncable::ModelTypeSet result; - for (syncable::ModelTypeSet::Iterator i = types.First(); + syncer::ModelTypeSet result; + for (syncer::ModelTypeSet::Iterator i = types.First(); i.Good(); i.Inc()) { sync_pb::DataTypeProgressMarker marker; share->directory->GetDownloadProgress(i.Get(), &marker); diff --git a/sync/internal_api/syncapi_unittest.cc b/sync/internal_api/syncapi_unittest.cc index 43ae0d5..6fff8c5 100644 --- a/sync/internal_api/syncapi_unittest.cc +++ b/sync/internal_api/syncapi_unittest.cc @@ -81,8 +81,6 @@ using sessions::SyncSessionSnapshot; using syncable::IS_DEL; using syncable::IS_UNSYNCED; using syncable::kEncryptedString; -using syncable::ModelTypeSet; -using syncable::ModelType; using syncable::NON_UNIQUE_NAME; using syncable::SPECIFICS; @@ -162,11 +160,11 @@ int64 MakeFolderWithParent(UserShare* share, int64 MakeServerNodeForType(UserShare* share, ModelType model_type) { sync_pb::EntitySpecifics specifics; - syncable::AddDefaultFieldValue(model_type, &specifics); + syncer::AddDefaultFieldValue(model_type, &specifics); syncable::WriteTransaction trans( FROM_HERE, syncable::UNITTEST, share->directory.get()); // Attempt to lookup by nigori tag. - std::string type_tag = syncable::ModelTypeToRootTag(model_type); + std::string type_tag = syncer::ModelTypeToRootTag(model_type); syncable::Id node_id = syncable::Id::CreateFromServerId(type_tag); syncable::MutableEntry entry(&trans, syncable::CREATE_NEW_UPDATE_ITEM, node_id); @@ -193,7 +191,7 @@ int64 MakeServerNode(UserShare* share, ModelType model_type, syncable::WriteTransaction trans( FROM_HERE, syncable::UNITTEST, share->directory.get()); syncable::Entry root_entry(&trans, syncable::GET_BY_SERVER_TAG, - syncable::ModelTypeToRootTag(model_type)); + syncer::ModelTypeToRootTag(model_type)); EXPECT_TRUE(root_entry.good()); syncable::Id root_id = root_entry.Get(syncable::ID); syncable::Id node_id = syncable::Id::CreateFromServerId(client_tag); @@ -259,13 +257,13 @@ TEST_F(SyncApiTest, BasicTagWrite) { } ignore_result(MakeNode(test_user_share_.user_share(), - syncable::BOOKMARKS, "testtag")); + syncer::BOOKMARKS, "testtag")); { ReadTransaction trans(FROM_HERE, test_user_share_.user_share()); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, "testtag")); + node.InitByClientTagLookup(syncer::BOOKMARKS, "testtag")); ReadNode root_node(&trans); root_node.InitByRootLookup(); @@ -276,18 +274,18 @@ TEST_F(SyncApiTest, BasicTagWrite) { TEST_F(SyncApiTest, GenerateSyncableHash) { EXPECT_EQ("OyaXV5mEzrPS4wbogmtKvRfekAI=", - BaseNode::GenerateSyncableHash(syncable::BOOKMARKS, "tag1")); + BaseNode::GenerateSyncableHash(syncer::BOOKMARKS, "tag1")); EXPECT_EQ("iNFQtRFQb+IZcn1kKUJEZDDkLs4=", - BaseNode::GenerateSyncableHash(syncable::PREFERENCES, "tag1")); + BaseNode::GenerateSyncableHash(syncer::PREFERENCES, "tag1")); EXPECT_EQ("gO1cPZQXaM73sHOvSA+tKCKFs58=", - BaseNode::GenerateSyncableHash(syncable::AUTOFILL, "tag1")); + BaseNode::GenerateSyncableHash(syncer::AUTOFILL, "tag1")); EXPECT_EQ("A0eYIHXM1/jVwKDDp12Up20IkKY=", - BaseNode::GenerateSyncableHash(syncable::BOOKMARKS, "tag2")); + BaseNode::GenerateSyncableHash(syncer::BOOKMARKS, "tag2")); EXPECT_EQ("XYxkF7bhS4eItStFgiOIAU23swI=", - BaseNode::GenerateSyncableHash(syncable::PREFERENCES, "tag2")); + BaseNode::GenerateSyncableHash(syncer::PREFERENCES, "tag2")); EXPECT_EQ("GFiWzo5NGhjLlN+OyCfhy28DJTQ=", - BaseNode::GenerateSyncableHash(syncable::AUTOFILL, "tag2")); + BaseNode::GenerateSyncableHash(syncer::AUTOFILL, "tag2")); } TEST_F(SyncApiTest, ModelTypesSiloed) { @@ -299,28 +297,28 @@ TEST_F(SyncApiTest, ModelTypesSiloed) { } ignore_result(MakeNode(test_user_share_.user_share(), - syncable::BOOKMARKS, "collideme")); + syncer::BOOKMARKS, "collideme")); ignore_result(MakeNode(test_user_share_.user_share(), - syncable::PREFERENCES, "collideme")); + syncer::PREFERENCES, "collideme")); ignore_result(MakeNode(test_user_share_.user_share(), - syncable::AUTOFILL, "collideme")); + syncer::AUTOFILL, "collideme")); { ReadTransaction trans(FROM_HERE, test_user_share_.user_share()); ReadNode bookmarknode(&trans); EXPECT_EQ(BaseNode::INIT_OK, - bookmarknode.InitByClientTagLookup(syncable::BOOKMARKS, + bookmarknode.InitByClientTagLookup(syncer::BOOKMARKS, "collideme")); ReadNode prefnode(&trans); EXPECT_EQ(BaseNode::INIT_OK, - prefnode.InitByClientTagLookup(syncable::PREFERENCES, + prefnode.InitByClientTagLookup(syncer::PREFERENCES, "collideme")); ReadNode autofillnode(&trans); EXPECT_EQ(BaseNode::INIT_OK, - autofillnode.InitByClientTagLookup(syncable::AUTOFILL, + autofillnode.InitByClientTagLookup(syncer::AUTOFILL, "collideme")); EXPECT_NE(bookmarknode.GetId(), prefnode.GetId()); @@ -334,14 +332,14 @@ TEST_F(SyncApiTest, ReadMissingTagsFails) { ReadTransaction trans(FROM_HERE, test_user_share_.user_share()); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_FAILED_ENTRY_NOT_GOOD, - node.InitByClientTagLookup(syncable::BOOKMARKS, + node.InitByClientTagLookup(syncer::BOOKMARKS, "testtag")); } { WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_FAILED_ENTRY_NOT_GOOD, - node.InitByClientTagLookup(syncable::BOOKMARKS, + node.InitByClientTagLookup(syncer::BOOKMARKS, "testtag")); } } @@ -360,13 +358,13 @@ TEST_F(SyncApiTest, TestDeleteBehavior) { // we'll use this spare folder later WriteNode folder_node(&trans); - EXPECT_TRUE(folder_node.InitByCreation(syncable::BOOKMARKS, + EXPECT_TRUE(folder_node.InitByCreation(syncer::BOOKMARKS, root_node, NULL)); folder_id = folder_node.GetId(); WriteNode wnode(&trans); syncer::WriteNode::InitUniqueByCreationResult result = - wnode.InitUniqueByCreation(syncable::BOOKMARKS, root_node, "testtag"); + wnode.InitUniqueByCreation(syncer::BOOKMARKS, root_node, "testtag"); EXPECT_EQ(syncer::WriteNode::INIT_SUCCESS, result); wnode.SetIsFolder(false); wnode.SetTitle(UTF8ToWide(test_title)); @@ -379,7 +377,7 @@ TEST_F(SyncApiTest, TestDeleteBehavior) { WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); WriteNode wnode(&trans); EXPECT_EQ(BaseNode::INIT_OK, - wnode.InitByClientTagLookup(syncable::BOOKMARKS, + wnode.InitByClientTagLookup(syncer::BOOKMARKS, "testtag")); EXPECT_FALSE(wnode.GetIsFolder()); EXPECT_EQ(wnode.GetTitle(), test_title); @@ -393,7 +391,7 @@ TEST_F(SyncApiTest, TestDeleteBehavior) { ReadTransaction trans(FROM_HERE, test_user_share_.user_share()); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_FAILED_ENTRY_IS_DEL, - node.InitByClientTagLookup(syncable::BOOKMARKS, + node.InitByClientTagLookup(syncer::BOOKMARKS, "testtag")); // Note that for proper function of this API this doesn't need to be // filled, we're checking just to make sure the DB worked in this test. @@ -408,7 +406,7 @@ TEST_F(SyncApiTest, TestDeleteBehavior) { WriteNode wnode(&trans); // This will undelete the tag. syncer::WriteNode::InitUniqueByCreationResult result = - wnode.InitUniqueByCreation(syncable::BOOKMARKS, folder_node, "testtag"); + wnode.InitUniqueByCreation(syncer::BOOKMARKS, folder_node, "testtag"); EXPECT_EQ(syncer::WriteNode::INIT_SUCCESS, result); EXPECT_EQ(wnode.GetIsFolder(), false); EXPECT_EQ(wnode.GetParentId(), folder_node.GetId()); @@ -422,10 +420,10 @@ TEST_F(SyncApiTest, TestDeleteBehavior) { ReadTransaction trans(FROM_HERE, test_user_share_.user_share()); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, + node.InitByClientTagLookup(syncer::BOOKMARKS, "testtag")); EXPECT_EQ(node.GetTitle(), test_title); - EXPECT_EQ(node.GetModelType(), syncable::BOOKMARKS); + EXPECT_EQ(node.GetModelType(), syncer::BOOKMARKS); } } @@ -442,7 +440,7 @@ TEST_F(SyncApiTest, WriteAndReadPassword) { WriteNode password_node(&trans); syncer::WriteNode::InitUniqueByCreationResult result = - password_node.InitUniqueByCreation(syncable::PASSWORDS, + password_node.InitUniqueByCreation(syncer::PASSWORDS, root_node, "foo"); EXPECT_EQ(syncer::WriteNode::INIT_SUCCESS, result); sync_pb::PasswordSpecificsData data; @@ -456,7 +454,7 @@ TEST_F(SyncApiTest, WriteAndReadPassword) { ReadNode password_node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - password_node.InitByClientTagLookup(syncable::PASSWORDS, + password_node.InitByClientTagLookup(syncer::PASSWORDS, "foo")); const sync_pb::PasswordSpecificsData& data = password_node.GetPasswordSpecifics(); @@ -478,14 +476,14 @@ TEST_F(SyncApiTest, WriteEncryptedTitle) { WriteNode bookmark_node(&trans); syncer::WriteNode::InitUniqueByCreationResult result = - bookmark_node.InitUniqueByCreation(syncable::BOOKMARKS, + bookmark_node.InitUniqueByCreation(syncer::BOOKMARKS, root_node, "foo"); EXPECT_EQ(syncer::WriteNode::INIT_SUCCESS, result); bookmark_node.SetTitle(UTF8ToWide("foo")); WriteNode pref_node(&trans); result = - pref_node.InitUniqueByCreation(syncable::PREFERENCES, root_node, "bar"); + pref_node.InitUniqueByCreation(syncer::PREFERENCES, root_node, "bar"); EXPECT_EQ(syncer::WriteNode::INIT_SUCCESS, result); pref_node.SetTitle(UTF8ToWide("bar")); } @@ -496,7 +494,7 @@ TEST_F(SyncApiTest, WriteEncryptedTitle) { ReadNode bookmark_node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - bookmark_node.InitByClientTagLookup(syncable::BOOKMARKS, + bookmark_node.InitByClientTagLookup(syncer::BOOKMARKS, "foo")); EXPECT_EQ("foo", bookmark_node.GetTitle()); EXPECT_EQ(kEncryptedString, @@ -504,7 +502,7 @@ TEST_F(SyncApiTest, WriteEncryptedTitle) { ReadNode pref_node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - pref_node.InitByClientTagLookup(syncable::PREFERENCES, + pref_node.InitByClientTagLookup(syncer::PREFERENCES, "bar")); EXPECT_EQ(kEncryptedString, pref_node.GetTitle()); } @@ -512,7 +510,7 @@ TEST_F(SyncApiTest, WriteEncryptedTitle) { TEST_F(SyncApiTest, BaseNodeSetSpecifics) { int64 child_id = MakeNode(test_user_share_.user_share(), - syncable::BOOKMARKS, "testtag"); + syncer::BOOKMARKS, "testtag"); WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(child_id)); @@ -529,7 +527,7 @@ TEST_F(SyncApiTest, BaseNodeSetSpecifics) { TEST_F(SyncApiTest, BaseNodeSetSpecificsPreservesUnknownFields) { int64 child_id = MakeNode(test_user_share_.user_share(), - syncable::BOOKMARKS, "testtag"); + syncer::BOOKMARKS, "testtag"); WriteTransaction trans(FROM_HERE, test_user_share_.user_share()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(child_id)); @@ -561,13 +559,12 @@ void CheckNodeValue(const BaseNode& node, const DictionaryValue& value, ModelType expected_model_type = node.GetModelType(); std::string type_str; EXPECT_TRUE(value.GetString("type", &type_str)); - if (expected_model_type >= syncable::FIRST_REAL_MODEL_TYPE) { - ModelType model_type = - syncable::ModelTypeFromString(type_str); + if (expected_model_type >= syncer::FIRST_REAL_MODEL_TYPE) { + ModelType model_type = syncer::ModelTypeFromString(type_str); EXPECT_EQ(expected_model_type, model_type); - } else if (expected_model_type == syncable::TOP_LEVEL_FOLDER) { + } else if (expected_model_type == syncer::TOP_LEVEL_FOLDER) { EXPECT_EQ("Top-level folder", type_str); - } else if (expected_model_type == syncable::UNSPECIFIED) { + } else if (expected_model_type == syncer::UNSPECIFIED) { EXPECT_EQ("Unspecified", type_str); } else { ADD_FAILURE(); @@ -625,7 +622,7 @@ TEST_F(SyncApiTest, EmptyTags) { WriteNode node(&trans); std::string empty_tag; syncer::WriteNode::InitUniqueByCreationResult result = - node.InitUniqueByCreation(syncable::TYPED_URLS, root_node, empty_tag); + node.InitUniqueByCreation(syncer::TYPED_URLS, root_node, empty_tag); EXPECT_NE(syncer::WriteNode::INIT_SUCCESS, result); EXPECT_EQ(BaseNode::INIT_FAILED_PRECONDITION, node.InitByTagLookup(empty_tag)); @@ -700,8 +697,8 @@ class SyncNotifierMock : public syncer::SyncNotifier { MOCK_METHOD2(UpdateCredentials, void(const std::string&, const std::string&)); MOCK_METHOD1(UpdateEnabledTypes, - void(syncable::ModelTypeSet)); - MOCK_METHOD1(SendNotification, void(syncable::ModelTypeSet)); + void(syncer::ModelTypeSet)); + MOCK_METHOD1(SendNotification, void(syncer::ModelTypeSet)); }; } // namespace @@ -798,29 +795,29 @@ class SyncManagerTest : public testing::Test, } void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) { - (*out)[syncable::NIGORI] = syncer::GROUP_PASSIVE; - (*out)[syncable::BOOKMARKS] = syncer::GROUP_PASSIVE; - (*out)[syncable::THEMES] = syncer::GROUP_PASSIVE; - (*out)[syncable::SESSIONS] = syncer::GROUP_PASSIVE; - (*out)[syncable::PASSWORDS] = syncer::GROUP_PASSIVE; - (*out)[syncable::PREFERENCES] = syncer::GROUP_PASSIVE; + (*out)[syncer::NIGORI] = syncer::GROUP_PASSIVE; + (*out)[syncer::BOOKMARKS] = syncer::GROUP_PASSIVE; + (*out)[syncer::THEMES] = syncer::GROUP_PASSIVE; + (*out)[syncer::SESSIONS] = syncer::GROUP_PASSIVE; + (*out)[syncer::PASSWORDS] = syncer::GROUP_PASSIVE; + (*out)[syncer::PREFERENCES] = syncer::GROUP_PASSIVE; } virtual void OnChangesApplied( - syncable::ModelType model_type, + syncer::ModelType model_type, const BaseTransaction* trans, const ImmutableChangeRecordList& changes) OVERRIDE {} - virtual void OnChangesComplete(syncable::ModelType model_type) OVERRIDE {} + virtual void OnChangesComplete(syncer::ModelType model_type) OVERRIDE {} // Helper methods. bool SetUpEncryption(NigoriStatus nigori_status, EncryptionStatus encryption_status) { UserShare* share = sync_manager_.GetUserShare(); - share->directory->set_initial_sync_ended_for_type(syncable::NIGORI, true); + share->directory->set_initial_sync_ended_for_type(syncer::NIGORI, true); // We need to create the nigori node as if it were an applied server update. - int64 nigori_id = GetIdForDataType(syncable::NIGORI); + int64 nigori_id = GetIdForDataType(syncer::NIGORI); if (nigori_id == kInvalidId) return false; @@ -866,11 +863,10 @@ class SyncManagerTest : public testing::Test, sync_notifier_observer_ = NULL; } - void SyncNotifierUpdateEnabledTypes(syncable::ModelTypeSet types) { + void SyncNotifierUpdateEnabledTypes(syncer::ModelTypeSet types) { ModelSafeRoutingInfo routes; GetModelSafeRoutingInfo(&routes); - const syncable::ModelTypeSet expected_types = - GetRoutingInfoTypes(routes); + const syncer::ModelTypeSet expected_types = GetRoutingInfoTypes(routes); EXPECT_TRUE(types.Equals(expected_types)); ++update_enabled_types_call_count_; } @@ -895,7 +891,7 @@ class SyncManagerTest : public testing::Test, // Looks up an entry by client tag and resets IS_UNSYNCED value to false. // Returns true if entry was previously unsynced, false if IS_UNSYNCED was // already false. - bool ResetUnsyncedEntry(syncable::ModelType type, + bool ResetUnsyncedEntry(syncer::ModelType type, const std::string& client_tag) { UserShare* share = sync_manager_.GetUserShare(); syncable::WriteTransaction trans( @@ -935,8 +931,7 @@ TEST_F(SyncManagerTest, UpdateEnabledTypes) { ModelSafeRoutingInfo routes; GetModelSafeRoutingInfo(&routes); - const syncable::ModelTypeSet enabled_types = - GetRoutingInfoTypes(routes); + const syncer::ModelTypeSet enabled_types = GetRoutingInfoTypes(routes); sync_manager_.UpdateEnabledTypes(enabled_types); EXPECT_EQ(1, update_enabled_types_call_count_); @@ -1018,8 +1013,7 @@ class SyncManagerGetNodesByIdTest : public SyncManagerTest { } int64 child_id = - MakeNode(sync_manager_.GetUserShare(), - syncable::BOOKMARKS, "testtag"); + MakeNode(sync_manager_.GetUserShare(), syncer::BOOKMARKS, "testtag"); StrictMock<MockJsReplyHandler> reply_handler; @@ -1269,9 +1263,9 @@ TEST_F(SyncManagerTest, OnNotificationStateChange) { TEST_F(SyncManagerTest, OnIncomingNotification) { StrictMock<MockJsEventHandler> event_handler; - const syncable::ModelTypeSet empty_model_types; - const syncable::ModelTypeSet model_types( - syncable::BOOKMARKS, syncable::THEMES); + const syncer::ModelTypeSet empty_model_types; + const syncer::ModelTypeSet model_types( + syncer::BOOKMARKS, syncer::THEMES); // Build expected_args to have a single argument with the string // equivalents of model_types. @@ -1280,11 +1274,10 @@ TEST_F(SyncManagerTest, OnIncomingNotification) { ListValue* model_type_list = new ListValue(); expected_details.SetString("source", "REMOTE_NOTIFICATION"); expected_details.Set("changedTypes", model_type_list); - for (syncable::ModelTypeSet::Iterator it = model_types.First(); + for (syncer::ModelTypeSet::Iterator it = model_types.First(); it.Good(); it.Inc()) { model_type_list->Append( - Value::CreateStringValue( - syncable::ModelTypeToString(it.Get()))); + Value::CreateStringValue(syncer::ModelTypeToString(it.Get()))); } } @@ -1313,15 +1306,15 @@ TEST_F(SyncManagerTest, RefreshEncryptionReady) { sync_manager_.RefreshNigori(kTestChromeVersion, base::Bind(&DoNothing)); PumpLoop(); - const syncable::ModelTypeSet encrypted_types = + const syncer::ModelTypeSet encrypted_types = sync_manager_.GetEncryptedDataTypesForTest(); - EXPECT_TRUE(encrypted_types.Has(syncable::PASSWORDS)); + EXPECT_TRUE(encrypted_types.Has(syncer::PASSWORDS)); EXPECT_FALSE(sync_manager_.EncryptEverythingEnabledForTest()); { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByIdLookup(GetIdForDataType(syncable::NIGORI))); + node.InitByIdLookup(GetIdForDataType(syncer::NIGORI))); sync_pb::NigoriSpecifics nigori = node.GetNigoriSpecifics(); EXPECT_TRUE(nigori.has_encrypted()); Cryptographer* cryptographer = trans.GetCryptographer(); @@ -1338,9 +1331,9 @@ TEST_F(SyncManagerTest, RefreshEncryptionNotReady) { sync_manager_.RefreshNigori(kTestChromeVersion, base::Bind(&DoNothing)); PumpLoop(); - const syncable::ModelTypeSet encrypted_types = + const syncer::ModelTypeSet encrypted_types = sync_manager_.GetEncryptedDataTypesForTest(); - EXPECT_TRUE(encrypted_types.Has(syncable::PASSWORDS)); // Hardcoded. + EXPECT_TRUE(encrypted_types.Has(syncer::PASSWORDS)); // Hardcoded. EXPECT_FALSE(sync_manager_.EncryptEverythingEnabledForTest()); } @@ -1353,15 +1346,15 @@ TEST_F(SyncManagerTest, RefreshEncryptionEmptyNigori) { sync_manager_.RefreshNigori(kTestChromeVersion, base::Bind(&DoNothing)); PumpLoop(); - const syncable::ModelTypeSet encrypted_types = + const syncer::ModelTypeSet encrypted_types = sync_manager_.GetEncryptedDataTypesForTest(); - EXPECT_TRUE(encrypted_types.Has(syncable::PASSWORDS)); // Hardcoded. + EXPECT_TRUE(encrypted_types.Has(syncer::PASSWORDS)); // Hardcoded. EXPECT_FALSE(sync_manager_.EncryptEverythingEnabledForTest()); { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByIdLookup(GetIdForDataType(syncable::NIGORI))); + node.InitByIdLookup(GetIdForDataType(syncer::NIGORI))); sync_pb::NigoriSpecifics nigori = node.GetNigoriSpecifics(); EXPECT_TRUE(nigori.has_encrypted()); Cryptographer* cryptographer = trans.GetCryptographer(); @@ -1374,7 +1367,7 @@ TEST_F(SyncManagerTest, EncryptDataTypesWithNoData) { EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, DEFAULT_ENCRYPTION)); EXPECT_CALL(observer_, OnEncryptedTypesChanged( - HasModelTypes(syncable::ModelTypeSet::All()), true)); + HasModelTypes(syncer::ModelTypeSet::All()), true)); EXPECT_CALL(observer_, OnEncryptionComplete()); sync_manager_.EnableEncryptEverything(); EXPECT_TRUE(sync_manager_.EncryptEverythingEnabledForTest()); @@ -1386,26 +1379,26 @@ TEST_F(SyncManagerTest, EncryptDataTypesWithData) { // Create some unencrypted unsynced data. int64 folder = MakeFolderWithParent(sync_manager_.GetUserShare(), - syncable::BOOKMARKS, - GetIdForDataType(syncable::BOOKMARKS), + syncer::BOOKMARKS, + GetIdForDataType(syncer::BOOKMARKS), NULL); // First batch_size nodes are children of folder. size_t i; for (i = 0; i < batch_size; ++i) { - MakeNodeWithParent(sync_manager_.GetUserShare(), syncable::BOOKMARKS, + MakeNodeWithParent(sync_manager_.GetUserShare(), syncer::BOOKMARKS, base::StringPrintf("%"PRIuS"", i), folder); } // Next batch_size nodes are a different type and on their own. for (; i < 2*batch_size; ++i) { - MakeNodeWithParent(sync_manager_.GetUserShare(), syncable::SESSIONS, + MakeNodeWithParent(sync_manager_.GetUserShare(), syncer::SESSIONS, base::StringPrintf("%"PRIuS"", i), - GetIdForDataType(syncable::SESSIONS)); + GetIdForDataType(syncer::SESSIONS)); } // Last batch_size nodes are a third type that will not need encryption. for (; i < 3*batch_size; ++i) { - MakeNodeWithParent(sync_manager_.GetUserShare(), syncable::THEMES, + MakeNodeWithParent(sync_manager_.GetUserShare(), syncer::THEMES, base::StringPrintf("%"PRIuS"", i), - GetIdForDataType(syncable::THEMES)); + GetIdForDataType(syncer::THEMES)); } { @@ -1415,44 +1408,44 @@ TEST_F(SyncManagerTest, EncryptDataTypesWithData) { EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest( trans.GetWrappedTrans(), trans.GetCryptographer(), - syncable::BOOKMARKS, + syncer::BOOKMARKS, false /* not encrypted */)); EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest( trans.GetWrappedTrans(), trans.GetCryptographer(), - syncable::SESSIONS, + syncer::SESSIONS, false /* not encrypted */)); EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest( trans.GetWrappedTrans(), trans.GetCryptographer(), - syncable::THEMES, + syncer::THEMES, false /* not encrypted */)); } EXPECT_CALL(observer_, OnEncryptedTypesChanged( - HasModelTypes(syncable::ModelTypeSet::All()), true)); + HasModelTypes(syncer::ModelTypeSet::All()), true)); EXPECT_CALL(observer_, OnEncryptionComplete()); sync_manager_.EnableEncryptEverything(); EXPECT_TRUE(sync_manager_.EncryptEverythingEnabledForTest()); { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); EXPECT_TRUE(GetEncryptedTypes(&trans).Equals( - syncable::ModelTypeSet::All())); + syncer::ModelTypeSet::All())); EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest( trans.GetWrappedTrans(), trans.GetCryptographer(), - syncable::BOOKMARKS, + syncer::BOOKMARKS, true /* is encrypted */)); EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest( trans.GetWrappedTrans(), trans.GetCryptographer(), - syncable::SESSIONS, + syncer::SESSIONS, true /* is encrypted */)); EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest( trans.GetWrappedTrans(), trans.GetCryptographer(), - syncable::THEMES, + syncer::THEMES, true /* is encrypted */)); } @@ -1465,22 +1458,21 @@ TEST_F(SyncManagerTest, EncryptDataTypesWithData) { EXPECT_TRUE(sync_manager_.EncryptEverythingEnabledForTest()); { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); - EXPECT_TRUE(GetEncryptedTypes(&trans).Equals( - syncable::ModelTypeSet::All())); + EXPECT_TRUE(GetEncryptedTypes(&trans).Equals(syncer::ModelTypeSet::All())); EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest( trans.GetWrappedTrans(), trans.GetCryptographer(), - syncable::BOOKMARKS, + syncer::BOOKMARKS, true /* is encrypted */)); EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest( trans.GetWrappedTrans(), trans.GetCryptographer(), - syncable::SESSIONS, + syncer::SESSIONS, true /* is encrypted */)); EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest( trans.GetWrappedTrans(), trans.GetCryptographer(), - syncable::THEMES, + syncer::THEMES, true /* is encrypted */)); } // Calling EncryptDataTypes with an empty encrypted types should not trigger @@ -1562,7 +1554,7 @@ TEST_F(SyncManagerTest, SetPassphraseWithPassword) { WriteNode password_node(&trans); syncer::WriteNode::InitUniqueByCreationResult result = - password_node.InitUniqueByCreation(syncable::PASSWORDS, + password_node.InitUniqueByCreation(syncer::PASSWORDS, root_node, "foo"); EXPECT_EQ(syncer::WriteNode::INIT_SUCCESS, result); sync_pb::PasswordSpecificsData data; @@ -1585,7 +1577,7 @@ TEST_F(SyncManagerTest, SetPassphraseWithPassword) { ReadNode password_node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - password_node.InitByClientTagLookup(syncable::PASSWORDS, + password_node.InitByClientTagLookup(syncer::PASSWORDS, "foo")); const sync_pb::PasswordSpecificsData& data = password_node.GetPasswordSpecifics(); @@ -1796,7 +1788,7 @@ TEST_F(SyncManagerTest, SetPassphraseWithEmptyPasswordNode) { WriteNode password_node(&trans); syncer::WriteNode::InitUniqueByCreationResult result = - password_node.InitUniqueByCreation(syncable::PASSWORDS, root_node, tag); + password_node.InitUniqueByCreation(syncer::PASSWORDS, root_node, tag); EXPECT_EQ(syncer::WriteNode::INIT_SUCCESS, result); node_id = password_node.GetId(); } @@ -1809,7 +1801,7 @@ TEST_F(SyncManagerTest, SetPassphraseWithEmptyPasswordNode) { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); ReadNode password_node(&trans); EXPECT_EQ(BaseNode::INIT_FAILED_DECRYPT_IF_NECESSARY, - password_node.InitByClientTagLookup(syncable::PASSWORDS, + password_node.InitByClientTagLookup(syncer::PASSWORDS, tag)); } { @@ -1821,15 +1813,15 @@ TEST_F(SyncManagerTest, SetPassphraseWithEmptyPasswordNode) { } TEST_F(SyncManagerTest, NudgeDelayTest) { - EXPECT_EQ(sync_manager_.GetNudgeDelayTimeDelta(syncable::BOOKMARKS), + EXPECT_EQ(sync_manager_.GetNudgeDelayTimeDelta(syncer::BOOKMARKS), base::TimeDelta::FromMilliseconds( SyncManager::kDefaultNudgeDelayMilliseconds)); - EXPECT_EQ(sync_manager_.GetNudgeDelayTimeDelta(syncable::AUTOFILL), + EXPECT_EQ(sync_manager_.GetNudgeDelayTimeDelta(syncer::AUTOFILL), base::TimeDelta::FromSeconds( syncer::kDefaultShortPollIntervalSeconds)); - EXPECT_EQ(sync_manager_.GetNudgeDelayTimeDelta(syncable::PREFERENCES), + EXPECT_EQ(sync_manager_.GetNudgeDelayTimeDelta(syncer::PREFERENCES), base::TimeDelta::FromMilliseconds( SyncManager::kPreferencesNudgeDelayMilliseconds)); } @@ -1847,10 +1839,10 @@ TEST_F(SyncManagerTest, EncryptBookmarksWithLegacyData) { // Create a bookmark using the legacy format. int64 node_id1 = MakeNode(sync_manager_.GetUserShare(), - syncable::BOOKMARKS, + syncer::BOOKMARKS, "testtag"); int64 node_id2 = MakeNode(sync_manager_.GetUserShare(), - syncable::BOOKMARKS, + syncer::BOOKMARKS, "testtag2"); { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); @@ -1881,14 +1873,14 @@ TEST_F(SyncManagerTest, EncryptBookmarksWithLegacyData) { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(node_id1)); - EXPECT_EQ(syncable::BOOKMARKS, node.GetModelType()); + EXPECT_EQ(syncer::BOOKMARKS, node.GetModelType()); EXPECT_EQ(title, node.GetTitle()); EXPECT_EQ(title, node.GetBookmarkSpecifics().title()); EXPECT_EQ(url, node.GetBookmarkSpecifics().url()); ReadNode node2(&trans); EXPECT_EQ(BaseNode::INIT_OK, node2.InitByIdLookup(node_id2)); - EXPECT_EQ(syncable::BOOKMARKS, node2.GetModelType()); + EXPECT_EQ(syncer::BOOKMARKS, node2.GetModelType()); // We should de-canonicalize the title in GetTitle(), but the title in the // specifics should be stored in the server legal form. EXPECT_EQ(raw_title2, node2.GetTitle()); @@ -1901,37 +1893,36 @@ TEST_F(SyncManagerTest, EncryptBookmarksWithLegacyData) { EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest( trans.GetWrappedTrans(), trans.GetCryptographer(), - syncable::BOOKMARKS, + syncer::BOOKMARKS, false /* not encrypted */)); } EXPECT_CALL(observer_, OnEncryptedTypesChanged( - HasModelTypes(syncable::ModelTypeSet::All()), true)); + HasModelTypes(syncer::ModelTypeSet::All()), true)); EXPECT_CALL(observer_, OnEncryptionComplete()); sync_manager_.EnableEncryptEverything(); EXPECT_TRUE(sync_manager_.EncryptEverythingEnabledForTest()); { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); - EXPECT_TRUE(GetEncryptedTypes(&trans).Equals( - syncable::ModelTypeSet::All())); + EXPECT_TRUE(GetEncryptedTypes(&trans).Equals(syncer::ModelTypeSet::All())); EXPECT_TRUE(syncable::VerifyDataTypeEncryptionForTest( trans.GetWrappedTrans(), trans.GetCryptographer(), - syncable::BOOKMARKS, + syncer::BOOKMARKS, true /* is encrypted */)); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, node.InitByIdLookup(node_id1)); - EXPECT_EQ(syncable::BOOKMARKS, node.GetModelType()); + EXPECT_EQ(syncer::BOOKMARKS, node.GetModelType()); EXPECT_EQ(title, node.GetTitle()); EXPECT_EQ(title, node.GetBookmarkSpecifics().title()); EXPECT_EQ(url, node.GetBookmarkSpecifics().url()); ReadNode node2(&trans); EXPECT_EQ(BaseNode::INIT_OK, node2.InitByIdLookup(node_id2)); - EXPECT_EQ(syncable::BOOKMARKS, node2.GetModelType()); + EXPECT_EQ(syncer::BOOKMARKS, node2.GetModelType()); // We should de-canonicalize the title in GetTitle(), but the title in the // specifics should be stored in the server legal form. EXPECT_EQ(raw_title2, node2.GetTitle()); @@ -1951,7 +1942,7 @@ TEST_F(SyncManagerTest, CreateLocalBookmark) { ReadNode root_node(&trans); root_node.InitByRootLookup(); WriteNode node(&trans); - ASSERT_TRUE(node.InitByCreation(syncable::BOOKMARKS, root_node, NULL)); + ASSERT_TRUE(node.InitByCreation(syncer::BOOKMARKS, root_node, NULL)); node.SetIsFolder(false); node.SetTitle(UTF8ToWide(title)); node.SetURL(url); @@ -1977,26 +1968,26 @@ TEST_F(SyncManagerTest, UpdateEntryWithEncryption) { sync_pb::EntitySpecifics entity_specifics; entity_specifics.mutable_bookmark()->set_url("url"); entity_specifics.mutable_bookmark()->set_title("title"); - MakeServerNode(sync_manager_.GetUserShare(), syncable::BOOKMARKS, client_tag, - BaseNode::GenerateSyncableHash(syncable::BOOKMARKS, + MakeServerNode(sync_manager_.GetUserShare(), syncer::BOOKMARKS, client_tag, + BaseNode::GenerateSyncableHash(syncer::BOOKMARKS, client_tag), entity_specifics); // New node shouldn't start off unsynced. - EXPECT_FALSE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); // Manually change to the same data. Should not set is_unsynced. { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); node.SetEntitySpecifics(entity_specifics); } - EXPECT_FALSE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); // Encrypt the datatatype, should set is_unsynced. EXPECT_CALL(observer_, OnEncryptedTypesChanged( - HasModelTypes(syncable::ModelTypeSet::All()), true)); + HasModelTypes(syncer::ModelTypeSet::All()), true)); EXPECT_CALL(observer_, OnEncryptionComplete()); EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, FULL_ENCRYPTION)); @@ -2006,7 +1997,7 @@ TEST_F(SyncManagerTest, UpdateEntryWithEncryption) { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); EXPECT_TRUE(specifics.has_encrypted()); @@ -2016,7 +2007,7 @@ TEST_F(SyncManagerTest, UpdateEntryWithEncryption) { EXPECT_TRUE(cryptographer->CanDecryptUsingDefaultKey( specifics.encrypted())); } - EXPECT_TRUE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_TRUE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); // Set a new passphrase. Should set is_unsynced. testing::Mock::VerifyAndClearExpectations(&observer_); @@ -2028,7 +2019,7 @@ TEST_F(SyncManagerTest, UpdateEntryWithEncryption) { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); EXPECT_TRUE(specifics.has_encrypted()); @@ -2038,7 +2029,7 @@ TEST_F(SyncManagerTest, UpdateEntryWithEncryption) { EXPECT_TRUE(cryptographer->CanDecryptUsingDefaultKey( specifics.encrypted())); } - EXPECT_TRUE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_TRUE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); // Force a re-encrypt everything. Should not set is_unsynced. testing::Mock::VerifyAndClearExpectations(&observer_); @@ -2051,7 +2042,7 @@ TEST_F(SyncManagerTest, UpdateEntryWithEncryption) { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); EXPECT_TRUE(specifics.has_encrypted()); @@ -2060,14 +2051,14 @@ TEST_F(SyncManagerTest, UpdateEntryWithEncryption) { EXPECT_TRUE(cryptographer->CanDecryptUsingDefaultKey( specifics.encrypted())); } - EXPECT_FALSE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); // Manually change to the same data. Should not set is_unsynced. { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); node.SetEntitySpecifics(entity_specifics); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); @@ -2078,7 +2069,7 @@ TEST_F(SyncManagerTest, UpdateEntryWithEncryption) { EXPECT_TRUE(cryptographer->CanDecryptUsingDefaultKey( specifics.encrypted())); } - EXPECT_FALSE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); // Manually change to different data. Should set is_unsynced. { @@ -2087,7 +2078,7 @@ TEST_F(SyncManagerTest, UpdateEntryWithEncryption) { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); node.SetEntitySpecifics(entity_specifics); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); @@ -2116,12 +2107,12 @@ TEST_F(SyncManagerTest, UpdatePasswordSetEntitySpecificsNoChange) { entity_specifics.mutable_password()-> mutable_encrypted()); } - MakeServerNode(sync_manager_.GetUserShare(), syncable::PASSWORDS, client_tag, - BaseNode::GenerateSyncableHash(syncable::PASSWORDS, + MakeServerNode(sync_manager_.GetUserShare(), syncer::PASSWORDS, client_tag, + BaseNode::GenerateSyncableHash(syncer::PASSWORDS, client_tag), entity_specifics); // New node shouldn't start off unsynced. - EXPECT_FALSE(ResetUnsyncedEntry(syncable::PASSWORDS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::PASSWORDS, client_tag)); // Manually change to the same data via SetEntitySpecifics. Should not set // is_unsynced. @@ -2129,10 +2120,10 @@ TEST_F(SyncManagerTest, UpdatePasswordSetEntitySpecificsNoChange) { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::PASSWORDS, client_tag)); + node.InitByClientTagLookup(syncer::PASSWORDS, client_tag)); node.SetEntitySpecifics(entity_specifics); } - EXPECT_FALSE(ResetUnsyncedEntry(syncable::PASSWORDS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::PASSWORDS, client_tag)); } // Passwords have their own handling for encryption. Verify it does not result @@ -2151,12 +2142,12 @@ TEST_F(SyncManagerTest, UpdatePasswordSetPasswordSpecifics) { entity_specifics.mutable_password()-> mutable_encrypted()); } - MakeServerNode(sync_manager_.GetUserShare(), syncable::PASSWORDS, client_tag, - BaseNode::GenerateSyncableHash(syncable::PASSWORDS, + MakeServerNode(sync_manager_.GetUserShare(), syncer::PASSWORDS, client_tag, + BaseNode::GenerateSyncableHash(syncer::PASSWORDS, client_tag), entity_specifics); // New node shouldn't start off unsynced. - EXPECT_FALSE(ResetUnsyncedEntry(syncable::PASSWORDS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::PASSWORDS, client_tag)); // Manually change to the same data via SetPasswordSpecifics. Should not set // is_unsynced. @@ -2164,17 +2155,17 @@ TEST_F(SyncManagerTest, UpdatePasswordSetPasswordSpecifics) { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::PASSWORDS, client_tag)); + node.InitByClientTagLookup(syncer::PASSWORDS, client_tag)); node.SetPasswordSpecifics(node.GetPasswordSpecifics()); } - EXPECT_FALSE(ResetUnsyncedEntry(syncable::PASSWORDS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::PASSWORDS, client_tag)); // Manually change to different data. Should set is_unsynced. { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::PASSWORDS, client_tag)); + node.InitByClientTagLookup(syncer::PASSWORDS, client_tag)); Cryptographer* cryptographer = trans.GetCryptographer(); sync_pb::PasswordSpecificsData data; data.set_password_value("secret2"); @@ -2202,12 +2193,12 @@ TEST_F(SyncManagerTest, UpdatePasswordNewPassphrase) { data, entity_specifics.mutable_password()->mutable_encrypted()); } - MakeServerNode(sync_manager_.GetUserShare(), syncable::PASSWORDS, client_tag, - BaseNode::GenerateSyncableHash(syncable::PASSWORDS, + MakeServerNode(sync_manager_.GetUserShare(), syncer::PASSWORDS, client_tag, + BaseNode::GenerateSyncableHash(syncer::PASSWORDS, client_tag), entity_specifics); // New node shouldn't start off unsynced. - EXPECT_FALSE(ResetUnsyncedEntry(syncable::PASSWORDS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::PASSWORDS, client_tag)); // Set a new passphrase. Should set is_unsynced. testing::Mock::VerifyAndClearExpectations(&observer_); @@ -2215,7 +2206,7 @@ TEST_F(SyncManagerTest, UpdatePasswordNewPassphrase) { EXPECT_CALL(observer_, OnPassphraseAccepted()); EXPECT_CALL(observer_, OnEncryptionComplete()); sync_manager_.SetEncryptionPassphrase("new_passphrase", true); - EXPECT_TRUE(ResetUnsyncedEntry(syncable::PASSWORDS, client_tag)); + EXPECT_TRUE(ResetUnsyncedEntry(syncer::PASSWORDS, client_tag)); } // Passwords have their own handling for encryption. Verify it does not result @@ -2233,19 +2224,19 @@ TEST_F(SyncManagerTest, UpdatePasswordReencryptEverything) { data, entity_specifics.mutable_password()->mutable_encrypted()); } - MakeServerNode(sync_manager_.GetUserShare(), syncable::PASSWORDS, client_tag, - BaseNode::GenerateSyncableHash(syncable::PASSWORDS, + MakeServerNode(sync_manager_.GetUserShare(), syncer::PASSWORDS, client_tag, + BaseNode::GenerateSyncableHash(syncer::PASSWORDS, client_tag), entity_specifics); // New node shouldn't start off unsynced. - EXPECT_FALSE(ResetUnsyncedEntry(syncable::PASSWORDS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::PASSWORDS, client_tag)); // Force a re-encrypt everything. Should not set is_unsynced. testing::Mock::VerifyAndClearExpectations(&observer_); EXPECT_CALL(observer_, OnEncryptionComplete()); sync_manager_.RefreshNigori(kTestChromeVersion, base::Bind(&DoNothing)); PumpLoop(); - EXPECT_FALSE(ResetUnsyncedEntry(syncable::PASSWORDS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::PASSWORDS, client_tag)); } // Verify SetTitle(..) doesn't unnecessarily set IS_UNSYNCED for bookmarks @@ -2255,32 +2246,32 @@ TEST_F(SyncManagerTest, SetBookmarkTitle) { sync_pb::EntitySpecifics entity_specifics; entity_specifics.mutable_bookmark()->set_url("url"); entity_specifics.mutable_bookmark()->set_title("title"); - MakeServerNode(sync_manager_.GetUserShare(), syncable::BOOKMARKS, client_tag, - BaseNode::GenerateSyncableHash(syncable::BOOKMARKS, + MakeServerNode(sync_manager_.GetUserShare(), syncer::BOOKMARKS, client_tag, + BaseNode::GenerateSyncableHash(syncer::BOOKMARKS, client_tag), entity_specifics); // New node shouldn't start off unsynced. - EXPECT_FALSE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); // Manually change to the same title. Should not set is_unsynced. { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); node.SetTitle(UTF8ToWide(client_tag)); } - EXPECT_FALSE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); // Manually change to new title. Should set is_unsynced. { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); node.SetTitle(UTF8ToWide("title2")); } - EXPECT_TRUE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_TRUE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); } // Verify SetTitle(..) doesn't unnecessarily set IS_UNSYNCED for encrypted @@ -2291,22 +2282,22 @@ TEST_F(SyncManagerTest, SetBookmarkTitleWithEncryption) { sync_pb::EntitySpecifics entity_specifics; entity_specifics.mutable_bookmark()->set_url("url"); entity_specifics.mutable_bookmark()->set_title("title"); - MakeServerNode(sync_manager_.GetUserShare(), syncable::BOOKMARKS, client_tag, - BaseNode::GenerateSyncableHash(syncable::BOOKMARKS, + MakeServerNode(sync_manager_.GetUserShare(), syncer::BOOKMARKS, client_tag, + BaseNode::GenerateSyncableHash(syncer::BOOKMARKS, client_tag), entity_specifics); // New node shouldn't start off unsynced. - EXPECT_FALSE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); // Encrypt the datatatype, should set is_unsynced. EXPECT_CALL(observer_, OnEncryptedTypesChanged( - HasModelTypes(syncable::ModelTypeSet::All()), true)); + HasModelTypes(syncer::ModelTypeSet::All()), true)); EXPECT_CALL(observer_, OnEncryptionComplete()); EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, FULL_ENCRYPTION)); sync_manager_.RefreshNigori(kTestChromeVersion, base::Bind(&DoNothing)); PumpLoop(); - EXPECT_TRUE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_TRUE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); // Manually change to the same title. Should not set is_unsynced. // NON_UNIQUE_NAME should be kEncryptedString. @@ -2314,14 +2305,14 @@ TEST_F(SyncManagerTest, SetBookmarkTitleWithEncryption) { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); node.SetTitle(UTF8ToWide(client_tag)); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); EXPECT_TRUE(specifics.has_encrypted()); EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); } - EXPECT_FALSE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); // Manually change to new title. Should set is_unsynced. NON_UNIQUE_NAME // should still be kEncryptedString. @@ -2329,14 +2320,14 @@ TEST_F(SyncManagerTest, SetBookmarkTitleWithEncryption) { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); node.SetTitle(UTF8ToWide("title2")); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); EXPECT_TRUE(specifics.has_encrypted()); EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); } - EXPECT_TRUE(ResetUnsyncedEntry(syncable::BOOKMARKS, client_tag)); + EXPECT_TRUE(ResetUnsyncedEntry(syncer::BOOKMARKS, client_tag)); } // Verify SetTitle(..) doesn't unnecessarily set IS_UNSYNCED for non-bookmarks @@ -2347,33 +2338,33 @@ TEST_F(SyncManagerTest, SetNonBookmarkTitle) { entity_specifics.mutable_preference()->set_name("name"); entity_specifics.mutable_preference()->set_value("value"); MakeServerNode(sync_manager_.GetUserShare(), - syncable::PREFERENCES, + syncer::PREFERENCES, client_tag, - BaseNode::GenerateSyncableHash(syncable::PREFERENCES, + BaseNode::GenerateSyncableHash(syncer::PREFERENCES, client_tag), entity_specifics); // New node shouldn't start off unsynced. - EXPECT_FALSE(ResetUnsyncedEntry(syncable::PREFERENCES, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::PREFERENCES, client_tag)); // Manually change to the same title. Should not set is_unsynced. { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::PREFERENCES, client_tag)); + node.InitByClientTagLookup(syncer::PREFERENCES, client_tag)); node.SetTitle(UTF8ToWide(client_tag)); } - EXPECT_FALSE(ResetUnsyncedEntry(syncable::PREFERENCES, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::PREFERENCES, client_tag)); // Manually change to new title. Should set is_unsynced. { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::PREFERENCES, client_tag)); + node.InitByClientTagLookup(syncer::PREFERENCES, client_tag)); node.SetTitle(UTF8ToWide("title2")); } - EXPECT_TRUE(ResetUnsyncedEntry(syncable::PREFERENCES, client_tag)); + EXPECT_TRUE(ResetUnsyncedEntry(syncer::PREFERENCES, client_tag)); } // Verify SetTitle(..) doesn't unnecessarily set IS_UNSYNCED for encrypted @@ -2385,23 +2376,23 @@ TEST_F(SyncManagerTest, SetNonBookmarkTitleWithEncryption) { entity_specifics.mutable_preference()->set_name("name"); entity_specifics.mutable_preference()->set_value("value"); MakeServerNode(sync_manager_.GetUserShare(), - syncable::PREFERENCES, + syncer::PREFERENCES, client_tag, - BaseNode::GenerateSyncableHash(syncable::PREFERENCES, + BaseNode::GenerateSyncableHash(syncer::PREFERENCES, client_tag), entity_specifics); // New node shouldn't start off unsynced. - EXPECT_FALSE(ResetUnsyncedEntry(syncable::PREFERENCES, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::PREFERENCES, client_tag)); // Encrypt the datatatype, should set is_unsynced. EXPECT_CALL(observer_, OnEncryptedTypesChanged( - HasModelTypes(syncable::ModelTypeSet::All()), true)); + HasModelTypes(syncer::ModelTypeSet::All()), true)); EXPECT_CALL(observer_, OnEncryptionComplete()); EXPECT_TRUE(SetUpEncryption(WRITE_TO_NIGORI, FULL_ENCRYPTION)); sync_manager_.RefreshNigori(kTestChromeVersion, base::Bind(&DoNothing)); PumpLoop(); - EXPECT_TRUE(ResetUnsyncedEntry(syncable::PREFERENCES, client_tag)); + EXPECT_TRUE(ResetUnsyncedEntry(syncer::PREFERENCES, client_tag)); // Manually change to the same title. Should not set is_unsynced. // NON_UNIQUE_NAME should be kEncryptedString. @@ -2409,14 +2400,14 @@ TEST_F(SyncManagerTest, SetNonBookmarkTitleWithEncryption) { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::PREFERENCES, client_tag)); + node.InitByClientTagLookup(syncer::PREFERENCES, client_tag)); node.SetTitle(UTF8ToWide(client_tag)); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); EXPECT_TRUE(specifics.has_encrypted()); EXPECT_EQ(kEncryptedString, node_entry->Get(NON_UNIQUE_NAME)); } - EXPECT_FALSE(ResetUnsyncedEntry(syncable::PREFERENCES, client_tag)); + EXPECT_FALSE(ResetUnsyncedEntry(syncer::PREFERENCES, client_tag)); // Manually change to new title. Should not set is_unsynced because the // NON_UNIQUE_NAME should still be kEncryptedString. @@ -2424,7 +2415,7 @@ TEST_F(SyncManagerTest, SetNonBookmarkTitleWithEncryption) { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::PREFERENCES, client_tag)); + node.InitByClientTagLookup(syncer::PREFERENCES, client_tag)); node.SetTitle(UTF8ToWide("title2")); const syncable::Entry* node_entry = node.GetEntry(); const sync_pb::EntitySpecifics& specifics = node_entry->Get(SPECIFICS); @@ -2453,10 +2444,10 @@ TEST_F(SyncManagerTest, SetPreviouslyEncryptedSpecifics) { sync_pb::EncryptedData encrypted; crypto->Encrypt(bm_specifics, &encrypted); entity_specifics.mutable_encrypted()->CopyFrom(encrypted); - syncable::AddDefaultFieldValue(syncable::BOOKMARKS, &entity_specifics); + syncer::AddDefaultFieldValue(syncer::BOOKMARKS, &entity_specifics); } - MakeServerNode(sync_manager_.GetUserShare(), syncable::BOOKMARKS, client_tag, - BaseNode::GenerateSyncableHash(syncable::BOOKMARKS, + MakeServerNode(sync_manager_.GetUserShare(), syncer::BOOKMARKS, client_tag, + BaseNode::GenerateSyncableHash(syncer::BOOKMARKS, client_tag), entity_specifics); @@ -2465,7 +2456,7 @@ TEST_F(SyncManagerTest, SetPreviouslyEncryptedSpecifics) { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); EXPECT_EQ(title, node.GetTitle()); EXPECT_EQ(GURL(url), node.GetURL()); } @@ -2475,7 +2466,7 @@ TEST_F(SyncManagerTest, SetPreviouslyEncryptedSpecifics) { WriteTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); WriteNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); node.SetURL(GURL(url2)); } @@ -2484,7 +2475,7 @@ TEST_F(SyncManagerTest, SetPreviouslyEncryptedSpecifics) { ReadTransaction trans(FROM_HERE, sync_manager_.GetUserShare()); ReadNode node(&trans); EXPECT_EQ(BaseNode::INIT_OK, - node.InitByClientTagLookup(syncable::BOOKMARKS, client_tag)); + node.InitByClientTagLookup(syncer::BOOKMARKS, client_tag)); EXPECT_EQ(title, node.GetTitle()); EXPECT_EQ(GURL(url2), node.GetURL()); const syncable::Entry* node_entry = node.GetEntry(); diff --git a/sync/internal_api/test/test_entry_factory.cc b/sync/internal_api/test/test_entry_factory.cc index bccb432..5527c1f 100644 --- a/sync/internal_api/test/test_entry_factory.cc +++ b/sync/internal_api/test/test_entry_factory.cc @@ -65,7 +65,7 @@ void TestEntryFactory::CreateUnsyncedItem( 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; @@ -82,7 +82,7 @@ void TestEntryFactory::CreateUnsyncedItem( entry.Put(syncable::PARENT_ID, parent_id); CHECK(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); @@ -96,7 +96,7 @@ void TestEntryFactory::CreateUnsyncedItem( int64 TestEntryFactory::CreateUnappliedAndUnsyncedItem( const string& name, - syncable::ModelType model_type) { + syncer::ModelType model_type) { int64 metahandle = 0; CreateUnsyncedItem( TestIdFactory::MakeServer(name), TestIdFactory::root(), @@ -116,7 +116,7 @@ int64 TestEntryFactory::CreateUnappliedAndUnsyncedItem( } int64 TestEntryFactory::CreateSyncedItem( - const std::string& name, syncable::ModelType + const std::string& name, syncer::ModelType model_type, bool is_folder) { WriteTransaction trans(FROM_HERE, UNITTEST, directory_); @@ -125,7 +125,7 @@ int64 TestEntryFactory::CreateSyncedItem( int64 version = GetNextRevision(); sync_pb::EntitySpecifics default_specifics; - syncable::AddDefaultFieldValue(model_type, &default_specifics); + syncer::AddDefaultFieldValue(model_type, &default_specifics); MutableEntry entry(&trans, syncable::CREATE, parent_id, name); if (!entry.good()) { diff --git a/sync/internal_api/write_node.cc b/sync/internal_api/write_node.cc index 9e6e403..7eb4ff7 100644 --- a/sync/internal_api/write_node.cc +++ b/sync/internal_api/write_node.cc @@ -40,8 +40,8 @@ void WriteNode::SetIsFolder(bool folder) { } void WriteNode::SetTitle(const std::wstring& title) { - DCHECK_NE(GetModelType(), syncable::UNSPECIFIED); - syncable::ModelType type = GetModelType(); + DCHECK_NE(GetModelType(), syncer::UNSPECIFIED); + syncer::ModelType type = GetModelType(); Cryptographer* cryptographer = GetTransaction()->GetCryptographer(); // It's possible the nigori lost the set of encrypted types. If the current // specifics are already encrypted, we want to ensure we continue encrypting. @@ -53,14 +53,14 @@ void WriteNode::SetTitle(const std::wstring& title) { // NON_UNIQUE_NAME will still be kEncryptedString, but we store the real title // into the specifics. All strings compared are server legal strings. std::string new_legal_title; - if (type != syncable::BOOKMARKS && needs_encryption) { + if (type != syncer::BOOKMARKS && needs_encryption) { new_legal_title = kEncryptedString; } else { SyncAPINameToServerName(WideToUTF8(title), &new_legal_title); } std::string current_legal_title; - if (syncable::BOOKMARKS == type && + if (syncer::BOOKMARKS == type && entry_->Get(syncable::SPECIFICS).has_encrypted()) { // Encrypted bookmarks only have their title in the unencrypted specifics. current_legal_title = GetBookmarkSpecifics().title(); @@ -84,7 +84,7 @@ void WriteNode::SetTitle(const std::wstring& title) { // For bookmarks, we also set the title field in the specifics. // TODO(zea): refactor bookmarks to not need this functionality. - if (GetModelType() == syncable::BOOKMARKS) { + if (GetModelType() == syncer::BOOKMARKS) { sync_pb::EntitySpecifics specifics = GetEntitySpecifics(); specifics.mutable_bookmark()->set_title(new_legal_title); SetEntitySpecifics(specifics); // Does it's own encryption checking. @@ -100,7 +100,7 @@ void WriteNode::SetTitle(const std::wstring& title) { entry_->Put(syncable::NON_UNIQUE_NAME, new_legal_title); DVLOG(1) << "Overwriting title of type " - << syncable::ModelTypeToString(type) + << syncer::ModelTypeToString(type) << " and marking for syncing."; MarkForSyncing(); } @@ -149,7 +149,7 @@ void WriteNode::SetNigoriSpecifics( void WriteNode::SetPasswordSpecifics( const sync_pb::PasswordSpecificsData& data) { - DCHECK_EQ(syncable::PASSWORDS, GetModelType()); + DCHECK_EQ(syncer::PASSWORDS, GetModelType()); Cryptographer* cryptographer = GetTransaction()->GetCryptographer(); @@ -159,12 +159,10 @@ void WriteNode::SetPasswordSpecifics( const sync_pb::EntitySpecifics& old_specifics = GetEntry()->Get(SPECIFICS); sync_pb::EntitySpecifics entity_specifics; // Copy over the old specifics if they exist. - if (syncable::GetModelTypeFromSpecifics(old_specifics) == - syncable::PASSWORDS) { + if (syncer::GetModelTypeFromSpecifics(old_specifics) == syncer::PASSWORDS) { entity_specifics.CopyFrom(old_specifics); } else { - syncable::AddDefaultFieldValue(syncable::PASSWORDS, - &entity_specifics); + syncer::AddDefaultFieldValue(syncer::PASSWORDS, &entity_specifics); } sync_pb::PasswordSpecifics* password_specifics = entity_specifics.mutable_password(); @@ -194,15 +192,15 @@ void WriteNode::SetSessionSpecifics( void WriteNode::SetEntitySpecifics( const sync_pb::EntitySpecifics& new_value) { - syncable::ModelType new_specifics_type = - syncable::GetModelTypeFromSpecifics(new_value); - DCHECK_NE(new_specifics_type, syncable::UNSPECIFIED); + syncer::ModelType new_specifics_type = + syncer::GetModelTypeFromSpecifics(new_value); + DCHECK_NE(new_specifics_type, syncer::UNSPECIFIED); DVLOG(1) << "Writing entity specifics of type " - << syncable::ModelTypeToString(new_specifics_type); + << syncer::ModelTypeToString(new_specifics_type); // GetModelType() can be unspecified if this is the first time this // node is being initialized (see PutModelType()). Otherwise, it // should match |new_specifics_type|. - if (GetModelType() != syncable::UNSPECIFIED) { + if (GetModelType() != syncer::UNSPECIFIED) { DCHECK_EQ(new_specifics_type, GetModelType()); } syncer::Cryptographer* cryptographer = @@ -281,7 +279,7 @@ BaseNode::InitByLookupResult WriteNode::InitByIdLookup(int64 id) { // Return true if the write node was found, and was not deleted. // Undeleting a deleted node is possible by ClientTag. BaseNode::InitByLookupResult WriteNode::InitByClientTagLookup( - syncable::ModelType model_type, + syncer::ModelType model_type, const std::string& tag) { DCHECK(!entry_) << "Init called twice"; if (tag.empty()) @@ -309,25 +307,25 @@ BaseNode::InitByLookupResult WriteNode::InitByTagLookup( return INIT_FAILED_ENTRY_NOT_GOOD; if (entry_->Get(syncable::IS_DEL)) return INIT_FAILED_ENTRY_IS_DEL; - syncable::ModelType model_type = GetModelType(); - DCHECK_EQ(syncable::NIGORI, model_type); + syncer::ModelType model_type = GetModelType(); + DCHECK_EQ(syncer::NIGORI, model_type); return INIT_OK; } -void WriteNode::PutModelType(syncable::ModelType model_type) { +void WriteNode::PutModelType(syncer::ModelType model_type) { // Set an empty specifics of the appropriate datatype. The presence // of the specific field will identify the model type. DCHECK(GetModelType() == model_type || - GetModelType() == syncable::UNSPECIFIED); // Immutable once set. + GetModelType() == syncer::UNSPECIFIED); // Immutable once set. sync_pb::EntitySpecifics specifics; - syncable::AddDefaultFieldValue(model_type, &specifics); + syncer::AddDefaultFieldValue(model_type, &specifics); SetEntitySpecifics(specifics); } // Create a new node with default properties, and bind this WriteNode to it. // Return true on success. -bool WriteNode::InitByCreation(syncable::ModelType model_type, +bool WriteNode::InitByCreation(syncer::ModelType model_type, const BaseNode& parent, const BaseNode* predecessor) { DCHECK(!entry_) << "Init called twice"; @@ -365,7 +363,7 @@ bool WriteNode::InitByCreation(syncable::ModelType model_type, // TODO(chron): Code datatype into hash tag. // TODO(chron): Is model type ever lost? WriteNode::InitUniqueByCreationResult WriteNode::InitUniqueByCreation( - syncable::ModelType model_type, + syncer::ModelType model_type, const BaseNode& parent, const std::string& tag) { // This DCHECK will only fail if init is called twice. diff --git a/sync/notifier/invalidation_notifier.cc b/sync/notifier/invalidation_notifier.cc index f373d18..58ef89a0b 100644 --- a/sync/notifier/invalidation_notifier.cc +++ b/sync/notifier/invalidation_notifier.cc @@ -87,11 +87,11 @@ void InvalidationNotifier::UpdateCredentials( } void InvalidationNotifier::UpdateEnabledTypes( - syncable::ModelTypeSet enabled_types) { + syncer::ModelTypeSet enabled_types) { DCHECK(CalledOnValidThread()); CHECK(!invalidation_client_id_.empty()); ObjectIdSet ids; - for (syncable::ModelTypeSet::Iterator it = enabled_types.First(); it.Good(); + for (syncer::ModelTypeSet::Iterator it = enabled_types.First(); it.Good(); it.Inc()) { invalidation::ObjectId id; if (!RealModelTypeToObjectId(it.Get(), &id)) { @@ -104,7 +104,7 @@ void InvalidationNotifier::UpdateEnabledTypes( } void InvalidationNotifier::SendNotification( - syncable::ModelTypeSet changed_types) { + syncer::ModelTypeSet changed_types) { DCHECK(CalledOnValidThread()); // Do nothing. } @@ -112,10 +112,10 @@ void InvalidationNotifier::SendNotification( void InvalidationNotifier::OnInvalidate(const ObjectIdPayloadMap& id_payloads) { DCHECK(CalledOnValidThread()); // TODO(dcheng): This should probably be a utility function somewhere... - syncable::ModelTypePayloadMap type_payloads; + syncer::ModelTypePayloadMap type_payloads; for (ObjectIdPayloadMap::const_iterator it = id_payloads.begin(); it != id_payloads.end(); ++it) { - syncable::ModelType model_type; + syncer::ModelType model_type; if (!ObjectIdToRealModelType(it->first, &model_type)) { DLOG(WARNING) << "Invalid object ID: " << ObjectIdToString(it->first); continue; diff --git a/sync/notifier/invalidation_notifier.h b/sync/notifier/invalidation_notifier.h index d579427..e00a524 100644 --- a/sync/notifier/invalidation_notifier.h +++ b/sync/notifier/invalidation_notifier.h @@ -57,9 +57,9 @@ class InvalidationNotifier virtual void UpdateCredentials( const std::string& email, const std::string& token) OVERRIDE; virtual void UpdateEnabledTypes( - syncable::ModelTypeSet enabled_types) OVERRIDE; + syncer::ModelTypeSet enabled_types) OVERRIDE; virtual void SendNotification( - syncable::ModelTypeSet changed_types) OVERRIDE; + syncer::ModelTypeSet changed_types) OVERRIDE; // ChromeInvalidationClient::Listener implementation. virtual void OnInvalidate(const ObjectIdPayloadMap& id_payloads) OVERRIDE; diff --git a/sync/notifier/invalidation_notifier_unittest.cc b/sync/notifier/invalidation_notifier_unittest.cc index ab82414..0329ad9 100644 --- a/sync/notifier/invalidation_notifier_unittest.cc +++ b/sync/notifier/invalidation_notifier_unittest.cc @@ -75,10 +75,10 @@ TEST_F(InvalidationNotifierTest, Basic) { CreateAndObserveNotifier("fake_state"); InSequence dummy; - syncable::ModelTypePayloadMap type_payloads; - type_payloads[syncable::PREFERENCES] = "payload"; - type_payloads[syncable::BOOKMARKS] = "payload"; - type_payloads[syncable::AUTOFILL] = "payload"; + syncer::ModelTypePayloadMap type_payloads; + type_payloads[syncer::PREFERENCES] = "payload"; + type_payloads[syncer::BOOKMARKS] = "payload"; + type_payloads[syncer::AUTOFILL] = "payload"; EXPECT_CALL(mock_observer_, OnNotificationsEnabled()); EXPECT_CALL(mock_observer_, @@ -100,7 +100,7 @@ TEST_F(InvalidationNotifierTest, Basic) { invalidation_notifier_->OnNotificationsEnabled(); ObjectIdPayloadMap id_payloads; - for (syncable::ModelTypePayloadMap::const_iterator it = type_payloads.begin(); + for (syncer::ModelTypePayloadMap::const_iterator it = type_payloads.begin(); it != type_payloads.end(); ++it) { invalidation::ObjectId id; ASSERT_TRUE(RealModelTypeToObjectId(it->first, &id)); diff --git a/sync/notifier/invalidation_util.cc b/sync/notifier/invalidation_util.cc index 0973b7d..5574a8c 100644 --- a/sync/notifier/invalidation_util.cc +++ b/sync/notifier/invalidation_util.cc @@ -17,10 +17,10 @@ bool ObjectIdLessThan::operator()(const invalidation::ObjectId& lhs, (lhs.source() == rhs.source() && lhs.name() < rhs.name()); } -bool RealModelTypeToObjectId(syncable::ModelType model_type, +bool RealModelTypeToObjectId(syncer::ModelType model_type, invalidation::ObjectId* object_id) { std::string notification_type; - if (!syncable::RealModelTypeToNotificationType( + if (!syncer::RealModelTypeToNotificationType( model_type, ¬ification_type)) { return false; } @@ -30,9 +30,9 @@ bool RealModelTypeToObjectId(syncable::ModelType model_type, } bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id, - syncable::ModelType* model_type) { + syncer::ModelType* model_type) { return - syncable::NotificationTypeToRealModelType( + syncer::NotificationTypeToRealModelType( object_id.name(), model_type); } diff --git a/sync/notifier/invalidation_util.h b/sync/notifier/invalidation_util.h index 1ec1235..bf5388f 100644 --- a/sync/notifier/invalidation_util.h +++ b/sync/notifier/invalidation_util.h @@ -29,11 +29,11 @@ struct ObjectIdLessThan { typedef std::set<invalidation::ObjectId, ObjectIdLessThan> ObjectIdSet; -bool RealModelTypeToObjectId(syncable::ModelType model_type, +bool RealModelTypeToObjectId(syncer::ModelType model_type, invalidation::ObjectId* object_id); bool ObjectIdToRealModelType(const invalidation::ObjectId& object_id, - syncable::ModelType* model_type); + syncer::ModelType* model_type); std::string ObjectIdToString(const invalidation::ObjectId& object_id); diff --git a/sync/notifier/mock_sync_notifier_observer.h b/sync/notifier/mock_sync_notifier_observer.h index 315d104..a49b66b 100644 --- a/sync/notifier/mock_sync_notifier_observer.h +++ b/sync/notifier/mock_sync_notifier_observer.h @@ -21,7 +21,7 @@ class MockSyncNotifierObserver : public SyncNotifierObserver { MOCK_METHOD0(OnNotificationsEnabled, void()); MOCK_METHOD1(OnNotificationsDisabled, void(NotificationsDisabledReason)); MOCK_METHOD2(OnIncomingNotification, - void(const syncable::ModelTypePayloadMap&, + void(const syncer::ModelTypePayloadMap&, IncomingNotificationSource)); }; diff --git a/sync/notifier/non_blocking_invalidation_notifier.cc b/sync/notifier/non_blocking_invalidation_notifier.cc index 083fcb3..cf5e51a 100644 --- a/sync/notifier/non_blocking_invalidation_notifier.cc +++ b/sync/notifier/non_blocking_invalidation_notifier.cc @@ -38,7 +38,7 @@ class NonBlockingInvalidationNotifier::Core void SetUniqueId(const std::string& unique_id); void SetStateDeprecated(const std::string& state); void UpdateCredentials(const std::string& email, const std::string& token); - void UpdateEnabledTypes(syncable::ModelTypeSet enabled_types); + void UpdateEnabledTypes(syncer::ModelTypeSet enabled_types); // SyncNotifierObserver implementation (all called on I/O thread by // InvalidationNotifier). @@ -46,7 +46,7 @@ class NonBlockingInvalidationNotifier::Core virtual void OnNotificationsDisabled( NotificationsDisabledReason reason) OVERRIDE; virtual void OnIncomingNotification( - const syncable::ModelTypePayloadMap& type_payloads, + const syncer::ModelTypePayloadMap& type_payloads, IncomingNotificationSource source) OVERRIDE; private: @@ -123,7 +123,7 @@ void NonBlockingInvalidationNotifier::Core::UpdateCredentials( } void NonBlockingInvalidationNotifier::Core::UpdateEnabledTypes( - syncable::ModelTypeSet enabled_types) { + syncer::ModelTypeSet enabled_types) { DCHECK(network_task_runner_->BelongsToCurrentThread()); invalidation_notifier_->UpdateEnabledTypes(enabled_types); } @@ -142,7 +142,7 @@ void NonBlockingInvalidationNotifier::Core::OnNotificationsDisabled( } void NonBlockingInvalidationNotifier::Core::OnIncomingNotification( - const syncable::ModelTypePayloadMap& type_payloads, + const syncer::ModelTypePayloadMap& type_payloads, IncomingNotificationSource source) { DCHECK(network_task_runner_->BelongsToCurrentThread()); delegate_observer_.Call(FROM_HERE, @@ -237,7 +237,7 @@ void NonBlockingInvalidationNotifier::UpdateCredentials( } void NonBlockingInvalidationNotifier::UpdateEnabledTypes( - syncable::ModelTypeSet enabled_types) { + syncer::ModelTypeSet enabled_types) { DCHECK(parent_task_runner_->BelongsToCurrentThread()); if (!network_task_runner_->PostTask( FROM_HERE, @@ -248,7 +248,7 @@ void NonBlockingInvalidationNotifier::UpdateEnabledTypes( } void NonBlockingInvalidationNotifier::SendNotification( - syncable::ModelTypeSet changed_types) { + syncer::ModelTypeSet changed_types) { DCHECK(parent_task_runner_->BelongsToCurrentThread()); // InvalidationClient doesn't implement SendNotification(), so no // need to forward on the call. @@ -268,7 +268,7 @@ void NonBlockingInvalidationNotifier::OnNotificationsDisabled( } void NonBlockingInvalidationNotifier::OnIncomingNotification( - const syncable::ModelTypePayloadMap& type_payloads, + const syncer::ModelTypePayloadMap& type_payloads, IncomingNotificationSource source) { DCHECK(parent_task_runner_->BelongsToCurrentThread()); FOR_EACH_OBSERVER(SyncNotifierObserver, observers_, diff --git a/sync/notifier/non_blocking_invalidation_notifier.h b/sync/notifier/non_blocking_invalidation_notifier.h index e953c3c..8c2cfaf 100644 --- a/sync/notifier/non_blocking_invalidation_notifier.h +++ b/sync/notifier/non_blocking_invalidation_notifier.h @@ -52,16 +52,16 @@ class NonBlockingInvalidationNotifier virtual void UpdateCredentials( const std::string& email, const std::string& token) OVERRIDE; virtual void UpdateEnabledTypes( - syncable::ModelTypeSet enabled_types) OVERRIDE; + syncer::ModelTypeSet enabled_types) OVERRIDE; virtual void SendNotification( - syncable::ModelTypeSet changed_types) OVERRIDE; + syncer::ModelTypeSet changed_types) OVERRIDE; // SyncNotifierObserver implementation. virtual void OnNotificationsEnabled() OVERRIDE; virtual void OnNotificationsDisabled( NotificationsDisabledReason reason) OVERRIDE; virtual void OnIncomingNotification( - const syncable::ModelTypePayloadMap& type_payloads, + const syncer::ModelTypePayloadMap& type_payloads, IncomingNotificationSource source) OVERRIDE; private: diff --git a/sync/notifier/non_blocking_invalidation_notifier_unittest.cc b/sync/notifier/non_blocking_invalidation_notifier_unittest.cc index 18153b5..bd8cceb 100644 --- a/sync/notifier/non_blocking_invalidation_notifier_unittest.cc +++ b/sync/notifier/non_blocking_invalidation_notifier_unittest.cc @@ -68,10 +68,10 @@ class NonBlockingInvalidationNotifierTest : public testing::Test { TEST_F(NonBlockingInvalidationNotifierTest, Basic) { InSequence dummy; - syncable::ModelTypePayloadMap type_payloads; - type_payloads[syncable::PREFERENCES] = "payload"; - type_payloads[syncable::BOOKMARKS] = ""; - type_payloads[syncable::AUTOFILL] = ""; + syncer::ModelTypePayloadMap type_payloads; + type_payloads[syncer::PREFERENCES] = "payload"; + type_payloads[syncer::BOOKMARKS] = ""; + type_payloads[syncer::AUTOFILL] = ""; EXPECT_CALL(mock_observer_, OnNotificationsEnabled()); EXPECT_CALL(mock_observer_, diff --git a/sync/notifier/p2p_notifier.cc b/sync/notifier/p2p_notifier.cc index b02d604..c72895e 100644 --- a/sync/notifier/p2p_notifier.cc +++ b/sync/notifier/p2p_notifier.cc @@ -64,7 +64,7 @@ P2PNotificationData::P2PNotificationData() : target_(NOTIFY_SELF) {} P2PNotificationData::P2PNotificationData( const std::string& sender_id, P2PNotificationTarget target, - syncable::ModelTypeSet changed_types) + syncer::ModelTypeSet changed_types) : sender_id_(sender_id), target_(target), changed_types_(changed_types) {} @@ -85,7 +85,7 @@ bool P2PNotificationData::IsTargeted(const std::string& id) const { } } -syncable::ModelTypeSet P2PNotificationData::GetChangedTypes() const { +syncer::ModelTypeSet P2PNotificationData::GetChangedTypes() const { return changed_types_; } @@ -101,7 +101,7 @@ std::string P2PNotificationData::ToString() const { dict->SetString(kSenderIdKey, sender_id_); dict->SetString(kNotificationTypeKey, P2PNotificationTargetToString(target_)); - dict->Set(kChangedTypesKey, syncable::ModelTypeSetToValue(changed_types_)); + dict->Set(kChangedTypesKey, syncer::ModelTypeSetToValue(changed_types_)); std::string json; base::JSONWriter::Write(dict.get(), &json); return json; @@ -136,7 +136,7 @@ bool P2PNotificationData::ResetFromString(const std::string& str) { << kChangedTypesKey; return false; } - changed_types_ = syncable::ModelTypeSetFromValue(*changed_types_list); + changed_types_ = syncer::ModelTypeSetFromValue(*changed_types_list); return true; } @@ -194,9 +194,9 @@ void P2PNotifier::UpdateCredentials( } void P2PNotifier::UpdateEnabledTypes( - syncable::ModelTypeSet enabled_types) { + syncer::ModelTypeSet enabled_types) { DCHECK(thread_checker_.CalledOnValidThread()); - const syncable::ModelTypeSet new_enabled_types = + const syncer::ModelTypeSet new_enabled_types = Difference(enabled_types, enabled_types_); enabled_types_ = enabled_types; const P2PNotificationData notification_data( @@ -205,7 +205,7 @@ void P2PNotifier::UpdateEnabledTypes( } void P2PNotifier::SendNotification( - syncable::ModelTypeSet changed_types) { + syncer::ModelTypeSet changed_types) { DCHECK(thread_checker_.CalledOnValidThread()); const P2PNotificationData notification_data( unique_id_, send_notification_target_, changed_types); @@ -266,8 +266,8 @@ void P2PNotifier::OnIncomingNotification( DVLOG(1) << "No changed types -- not emitting notification"; return; } - const syncable::ModelTypePayloadMap& type_payloads = - syncable::ModelTypePayloadMapFromEnumSet( + const syncer::ModelTypePayloadMap& type_payloads = + syncer::ModelTypePayloadMapFromEnumSet( notification_data.GetChangedTypes(), std::string()); FOR_EACH_OBSERVER(SyncNotifierObserver, observer_list_, OnIncomingNotification(type_payloads, REMOTE_NOTIFICATION)); diff --git a/sync/notifier/p2p_notifier.h b/sync/notifier/p2p_notifier.h index 3b91283..83ce595 100644 --- a/sync/notifier/p2p_notifier.h +++ b/sync/notifier/p2p_notifier.h @@ -55,14 +55,14 @@ class P2PNotificationData { P2PNotificationData(); P2PNotificationData(const std::string& sender_id, P2PNotificationTarget target, - syncable::ModelTypeSet changed_types); + syncer::ModelTypeSet changed_types); ~P2PNotificationData(); // Returns true if the given ID is targeted by this notification. bool IsTargeted(const std::string& id) const; - syncable::ModelTypeSet GetChangedTypes() const; + syncer::ModelTypeSet GetChangedTypes() const; bool Equals(const P2PNotificationData& other) const; @@ -78,7 +78,7 @@ class P2PNotificationData { // The intendent recipient(s) of the notification. P2PNotificationTarget target_; // The types the notification is for. - syncable::ModelTypeSet changed_types_; + syncer::ModelTypeSet changed_types_; }; class P2PNotifier @@ -103,9 +103,9 @@ class P2PNotifier virtual void UpdateCredentials( const std::string& email, const std::string& token) OVERRIDE; virtual void UpdateEnabledTypes( - syncable::ModelTypeSet enabled_types) OVERRIDE; + syncer::ModelTypeSet enabled_types) OVERRIDE; virtual void SendNotification( - syncable::ModelTypeSet changed_types) OVERRIDE; + syncer::ModelTypeSet changed_types) OVERRIDE; // PushClientObserver implementation. virtual void OnNotificationsEnabled() OVERRIDE; @@ -134,7 +134,7 @@ class P2PNotifier // Which set of clients should be sent notifications. P2PNotificationTarget send_notification_target_; - syncable::ModelTypeSet enabled_types_; + syncer::ModelTypeSet enabled_types_; }; } // namespace syncer diff --git a/sync/notifier/p2p_notifier_unittest.cc b/sync/notifier/p2p_notifier_unittest.cc index c8bf0d7..a219824 100644 --- a/sync/notifier/p2p_notifier_unittest.cc +++ b/sync/notifier/p2p_notifier_unittest.cc @@ -34,9 +34,8 @@ class P2PNotifierTest : public testing::Test { p2p_notifier_.RemoveObserver(&mock_observer_); } - syncable::ModelTypePayloadMap MakePayloadMap( - syncable::ModelTypeSet types) { - return syncable::ModelTypePayloadMapFromEnumSet(types, ""); + syncer::ModelTypePayloadMap MakePayloadMap(syncer::ModelTypeSet types) { + return syncer::ModelTypePayloadMapFromEnumSet(types, ""); } // Simulate receiving all the notifications we sent out since last @@ -76,21 +75,21 @@ TEST_F(P2PNotifierTest, P2PNotificationTarget) { TEST_F(P2PNotifierTest, P2PNotificationDataIsTargeted) { { const P2PNotificationData notification_data( - "sender", NOTIFY_SELF, syncable::ModelTypeSet()); + "sender", NOTIFY_SELF, syncer::ModelTypeSet()); EXPECT_TRUE(notification_data.IsTargeted("sender")); EXPECT_FALSE(notification_data.IsTargeted("other1")); EXPECT_FALSE(notification_data.IsTargeted("other2")); } { const P2PNotificationData notification_data( - "sender", NOTIFY_OTHERS, syncable::ModelTypeSet()); + "sender", NOTIFY_OTHERS, syncer::ModelTypeSet()); EXPECT_FALSE(notification_data.IsTargeted("sender")); EXPECT_TRUE(notification_data.IsTargeted("other1")); EXPECT_TRUE(notification_data.IsTargeted("other2")); } { const P2PNotificationData notification_data( - "sender", NOTIFY_ALL, syncable::ModelTypeSet()); + "sender", NOTIFY_ALL, syncer::ModelTypeSet()); EXPECT_TRUE(notification_data.IsTargeted("sender")); EXPECT_TRUE(notification_data.IsTargeted("other1")); EXPECT_TRUE(notification_data.IsTargeted("other2")); @@ -118,8 +117,7 @@ TEST_F(P2PNotifierTest, P2PNotificationDataDefault) { // Make sure the P2PNotificationData <-> string conversions work for a // non-default-constructed P2PNotificationData. TEST_F(P2PNotifierTest, P2PNotificationDataNonDefault) { - const syncable::ModelTypeSet changed_types( - syncable::BOOKMARKS, syncable::THEMES); + const syncer::ModelTypeSet changed_types(syncer::BOOKMARKS, syncer::THEMES); const P2PNotificationData notification_data( "sender", NOTIFY_ALL, changed_types); EXPECT_TRUE(notification_data.IsTargeted("sender")); @@ -142,8 +140,7 @@ TEST_F(P2PNotifierTest, P2PNotificationDataNonDefault) { // observer should receive only a notification from the call to // UpdateEnabledTypes(). TEST_F(P2PNotifierTest, NotificationsBasic) { - syncable::ModelTypeSet enabled_types( - syncable::BOOKMARKS, syncable::PREFERENCES); + syncer::ModelTypeSet enabled_types(syncer::BOOKMARKS, syncer::PREFERENCES); EXPECT_CALL(mock_observer_, OnNotificationsEnabled()); EXPECT_CALL(mock_observer_, @@ -174,8 +171,7 @@ TEST_F(P2PNotifierTest, NotificationsBasic) { // Sent with target NOTIFY_OTHERS so should not be propagated to // |mock_observer_|. { - syncable::ModelTypeSet changed_types( - syncable::THEMES, syncable::APPS); + syncer::ModelTypeSet changed_types(syncer::THEMES, syncer::APPS); p2p_notifier_.SendNotification(changed_types); } @@ -186,13 +182,11 @@ TEST_F(P2PNotifierTest, NotificationsBasic) { // target settings. The notifications received by the observer should // be consistent with the target settings. TEST_F(P2PNotifierTest, SendNotificationData) { - syncable::ModelTypeSet enabled_types( - syncable::BOOKMARKS, syncable::PREFERENCES); + syncer::ModelTypeSet enabled_types(syncer::BOOKMARKS, syncer::PREFERENCES); - syncable::ModelTypeSet changed_types( - syncable::THEMES, syncable::APPS); + syncer::ModelTypeSet changed_types(syncer::THEMES, syncer::APPS); - const syncable::ModelTypePayloadMap& changed_payload_map = + const syncer::ModelTypePayloadMap& changed_payload_map = MakePayloadMap(changed_types); EXPECT_CALL(mock_observer_, OnNotificationsEnabled()); @@ -234,7 +228,7 @@ TEST_F(P2PNotifierTest, SendNotificationData) { // Should be dropped. Mock::VerifyAndClearExpectations(&mock_observer_); p2p_notifier_.SendNotificationDataForTest( - P2PNotificationData("sender", NOTIFY_SELF, syncable::ModelTypeSet())); + P2PNotificationData("sender", NOTIFY_SELF, syncer::ModelTypeSet())); ReflectSentNotifications(); @@ -256,7 +250,7 @@ TEST_F(P2PNotifierTest, SendNotificationData) { // Should be dropped. Mock::VerifyAndClearExpectations(&mock_observer_); p2p_notifier_.SendNotificationDataForTest( - P2PNotificationData("sender2", NOTIFY_OTHERS, syncable::ModelTypeSet())); + P2PNotificationData("sender2", NOTIFY_OTHERS, syncer::ModelTypeSet())); ReflectSentNotifications(); @@ -281,7 +275,7 @@ TEST_F(P2PNotifierTest, SendNotificationData) { // Should be dropped. Mock::VerifyAndClearExpectations(&mock_observer_); p2p_notifier_.SendNotificationDataForTest( - P2PNotificationData("sender2", NOTIFY_ALL, syncable::ModelTypeSet())); + P2PNotificationData("sender2", NOTIFY_ALL, syncer::ModelTypeSet())); ReflectSentNotifications(); } diff --git a/sync/notifier/sync_notifier.h b/sync/notifier/sync_notifier.h index c171baa..24c59a0 100644 --- a/sync/notifier/sync_notifier.h +++ b/sync/notifier/sync_notifier.h @@ -40,15 +40,13 @@ class SyncNotifier { virtual void UpdateCredentials( const std::string& email, const std::string& token) = 0; - virtual void UpdateEnabledTypes( - syncable::ModelTypeSet enabled_types) = 0; + virtual void UpdateEnabledTypes(syncer::ModelTypeSet enabled_types) = 0; // This is here only to support the old p2p notification implementation, // which is still used by sync integration tests. // TODO(akalin): Remove this once we move the integration tests off p2p // notifications. - virtual void SendNotification( - syncable::ModelTypeSet changed_types) = 0; + virtual void SendNotification(syncer::ModelTypeSet changed_types) = 0; }; } // namespace syncer diff --git a/sync/notifier/sync_notifier_observer.h b/sync/notifier/sync_notifier_observer.h index 24496d5..c4ac9ca 100644 --- a/sync/notifier/sync_notifier_observer.h +++ b/sync/notifier/sync_notifier_observer.h @@ -31,7 +31,7 @@ class SyncNotifierObserver { // Called when a notification is received. The per-type payloads // are in |type_payloads| and the source is in |source|. virtual void OnIncomingNotification( - const syncable::ModelTypePayloadMap& type_payloads, + const syncer::ModelTypePayloadMap& type_payloads, IncomingNotificationSource source) = 0; protected: diff --git a/sync/protocol/proto_value_conversions_unittest.cc b/sync/protocol/proto_value_conversions_unittest.cc index 173a1c0..096ec0f 100644 --- a/sync/protocol/proto_value_conversions_unittest.cc +++ b/sync/protocol/proto_value_conversions_unittest.cc @@ -47,7 +47,7 @@ TEST_F(ProtoValueConversionsTest, ProtoChangeCheck) { // If this number changes, that means we added or removed a data // type. Don't forget to add a unit test for {New // type}SpecificsToValue below. - EXPECT_EQ(17, syncable::MODEL_TYPE_COUNT); + EXPECT_EQ(17, syncer::MODEL_TYPE_COUNT); // We'd also like to check if we changed any field in our messages. // However, that's hard to do: sizeof could work, but it's @@ -183,7 +183,7 @@ TEST_F(ProtoValueConversionsTest, EntitySpecificsToValue) { #undef SET_FIELD scoped_ptr<DictionaryValue> value(EntitySpecificsToValue(specifics)); - EXPECT_EQ(syncable::MODEL_TYPE_COUNT - syncable::FIRST_REAL_MODEL_TYPE, + EXPECT_EQ(syncer::MODEL_TYPE_COUNT - syncer::FIRST_REAL_MODEL_TYPE, static_cast<int>(value->size())); } diff --git a/sync/protocol/sync_protocol_error.h b/sync/protocol/sync_protocol_error.h index 29b7f19..359df59 100644 --- a/sync/protocol/sync_protocol_error.h +++ b/sync/protocol/sync_protocol_error.h @@ -68,7 +68,7 @@ struct SyncProtocolError { std::string error_description; std::string url; ClientAction action; - syncable::ModelTypeSet error_data_types; + syncer::ModelTypeSet error_data_types; SyncProtocolError(); ~SyncProtocolError(); DictionaryValue* ToValue() const; diff --git a/sync/sessions/ordered_commit_set.cc b/sync/sessions/ordered_commit_set.cc index 1d13c09..06a5988 100644 --- a/sync/sessions/ordered_commit_set.cc +++ b/sync/sessions/ordered_commit_set.cc @@ -20,7 +20,7 @@ OrderedCommitSet::~OrderedCommitSet() {} void OrderedCommitSet::AddCommitItem(const int64 metahandle, const syncable::Id& commit_id, - syncable::ModelType type) { + syncer::ModelType type) { if (!HaveCommitItem(metahandle)) { inserted_metahandles_.insert(metahandle); metahandle_order_.push_back(metahandle); @@ -100,7 +100,7 @@ OrderedCommitSet::CommitItem OrderedCommitSet::GetCommitItemAt( bool OrderedCommitSet::HasBookmarkCommitId() const { ModelSafeRoutingInfo::const_iterator group - = routes_.find(syncable::BOOKMARKS); + = routes_.find(syncer::BOOKMARKS); if (group == routes_.end()) return false; Projections::const_iterator proj = projections_.find(group->second); @@ -108,7 +108,7 @@ bool OrderedCommitSet::HasBookmarkCommitId() const { return false; DCHECK_LE(proj->second.size(), types_.size()); for (size_t i = 0; i < proj->second.size(); i++) { - if (types_[proj->second[i]] == syncable::BOOKMARKS) + if (types_[proj->second[i]] == syncer::BOOKMARKS) return true; } return false; diff --git a/sync/sessions/ordered_commit_set.h b/sync/sessions/ordered_commit_set.h index ed606bc..e2d2450 100644 --- a/sync/sessions/ordered_commit_set.h +++ b/sync/sessions/ordered_commit_set.h @@ -38,7 +38,7 @@ class OrderedCommitSet { } void AddCommitItem(const int64 metahandle, const syncable::Id& commit_id, - syncable::ModelType type); + syncer::ModelType type); const std::vector<syncable::Id>& GetAllCommitIds() const { return commit_ids_; @@ -56,7 +56,7 @@ class OrderedCommitSet { } // Same as above, but for ModelType of the item. - syncable::ModelType GetModelTypeAt(const size_t position) const { + syncer::ModelType GetModelTypeAt(const size_t position) const { return types_[position]; } @@ -95,7 +95,7 @@ class OrderedCommitSet { struct CommitItem { int64 meta; syncable::Id id; - syncable::ModelType group; + syncer::ModelType group; }; CommitItem GetCommitItemAt(const size_t position) const; @@ -113,7 +113,7 @@ class OrderedCommitSet { // projection. We could store it in commit_ids_, but sometimes we want // to just return the vector of Ids, so this is more straightforward // and shouldn't take up too much extra space since commit lists are small. - std::vector<syncable::ModelType> types_; + std::vector<syncer::ModelType> types_; syncer::ModelSafeRoutingInfo routes_; }; diff --git a/sync/sessions/ordered_commit_set_unittest.cc b/sync/sessions/ordered_commit_set_unittest.cc index 8bf420a..9be2992 100644 --- a/sync/sessions/ordered_commit_set_unittest.cc +++ b/sync/sessions/ordered_commit_set_unittest.cc @@ -15,10 +15,10 @@ namespace { class OrderedCommitSetTest : public testing::Test { public: OrderedCommitSetTest() { - routes_[syncable::BOOKMARKS] = syncer::GROUP_UI; - routes_[syncable::PREFERENCES] = syncer::GROUP_UI; - routes_[syncable::AUTOFILL] = syncer::GROUP_DB; - routes_[syncable::TOP_LEVEL_FOLDER] = syncer::GROUP_PASSIVE; + routes_[syncer::BOOKMARKS] = syncer::GROUP_UI; + routes_[syncer::PREFERENCES] = syncer::GROUP_UI; + routes_[syncer::AUTOFILL] = syncer::GROUP_DB; + routes_[syncer::TOP_LEVEL_FOLDER] = syncer::GROUP_PASSIVE; } protected: syncer::TestIdFactory ids_; @@ -31,18 +31,18 @@ TEST_F(OrderedCommitSetTest, Projections) { expected.push_back(ids_.NewLocalId()); OrderedCommitSet commit_set1(routes_), commit_set2(routes_); - commit_set1.AddCommitItem(0, expected[0], syncable::BOOKMARKS); - commit_set1.AddCommitItem(1, expected[1], syncable::BOOKMARKS); - commit_set1.AddCommitItem(2, expected[2], syncable::PREFERENCES); + commit_set1.AddCommitItem(0, expected[0], syncer::BOOKMARKS); + commit_set1.AddCommitItem(1, expected[1], syncer::BOOKMARKS); + commit_set1.AddCommitItem(2, expected[2], syncer::PREFERENCES); // Duplicates should be dropped. - commit_set1.AddCommitItem(2, expected[2], syncable::PREFERENCES); - commit_set1.AddCommitItem(3, expected[3], syncable::TOP_LEVEL_FOLDER); - commit_set1.AddCommitItem(4, expected[4], syncable::TOP_LEVEL_FOLDER); - commit_set2.AddCommitItem(7, expected[7], syncable::AUTOFILL); - commit_set2.AddCommitItem(6, expected[6], syncable::AUTOFILL); - commit_set2.AddCommitItem(5, expected[5], syncable::AUTOFILL); + commit_set1.AddCommitItem(2, expected[2], syncer::PREFERENCES); + commit_set1.AddCommitItem(3, expected[3], syncer::TOP_LEVEL_FOLDER); + commit_set1.AddCommitItem(4, expected[4], syncer::TOP_LEVEL_FOLDER); + commit_set2.AddCommitItem(7, expected[7], syncer::AUTOFILL); + commit_set2.AddCommitItem(6, expected[6], syncer::AUTOFILL); + commit_set2.AddCommitItem(5, expected[5], syncer::AUTOFILL); // Add something in set1 to set2, which should get dropped by AppendReverse. - commit_set2.AddCommitItem(0, expected[0], syncable::BOOKMARKS); + commit_set2.AddCommitItem(0, expected[0], syncer::BOOKMARKS); commit_set1.AppendReverse(commit_set2); // First, we should verify the projections are correct. Second, we want to @@ -101,15 +101,15 @@ TEST_F(OrderedCommitSetTest, Projections) { TEST_F(OrderedCommitSetTest, HasBookmarkCommitId) { OrderedCommitSet commit_set(routes_); - commit_set.AddCommitItem(0, ids_.NewLocalId(), syncable::AUTOFILL); - commit_set.AddCommitItem(1, ids_.NewLocalId(), syncable::TOP_LEVEL_FOLDER); + commit_set.AddCommitItem(0, ids_.NewLocalId(), syncer::AUTOFILL); + commit_set.AddCommitItem(1, ids_.NewLocalId(), syncer::TOP_LEVEL_FOLDER); EXPECT_FALSE(commit_set.HasBookmarkCommitId()); - commit_set.AddCommitItem(2, ids_.NewLocalId(), syncable::PREFERENCES); - commit_set.AddCommitItem(3, ids_.NewLocalId(), syncable::PREFERENCES); + commit_set.AddCommitItem(2, ids_.NewLocalId(), syncer::PREFERENCES); + commit_set.AddCommitItem(3, ids_.NewLocalId(), syncer::PREFERENCES); EXPECT_FALSE(commit_set.HasBookmarkCommitId()); - commit_set.AddCommitItem(4, ids_.NewLocalId(), syncable::BOOKMARKS); + commit_set.AddCommitItem(4, ids_.NewLocalId(), syncer::BOOKMARKS); EXPECT_TRUE(commit_set.HasBookmarkCommitId()); commit_set.Truncate(4); @@ -121,7 +121,7 @@ TEST_F(OrderedCommitSetTest, AddAndRemoveEntries) { ASSERT_TRUE(commit_set.Empty()); - commit_set.AddCommitItem(0, ids_.NewLocalId(), syncable::AUTOFILL); + commit_set.AddCommitItem(0, ids_.NewLocalId(), syncer::AUTOFILL); ASSERT_EQ(static_cast<size_t>(1), commit_set.Size()); commit_set.Clear(); diff --git a/sync/sessions/session_state_unittest.cc b/sync/sessions/session_state_unittest.cc index 3d1b07c..b227ac7 100644 --- a/sync/sessions/session_state_unittest.cc +++ b/sync/sessions/session_state_unittest.cc @@ -30,11 +30,11 @@ class SessionStateTest : public testing::Test {}; TEST_F(SessionStateTest, SyncSourceInfoToValue) { sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source = sync_pb::GetUpdatesCallerInfo::PERIODIC; - syncable::ModelTypePayloadMap types; - types[syncable::PREFERENCES] = "preferencespayload"; - types[syncable::EXTENSIONS] = ""; + syncer::ModelTypePayloadMap types; + types[syncer::PREFERENCES] = "preferencespayload"; + types[syncer::EXTENSIONS] = ""; scoped_ptr<DictionaryValue> expected_types_value( - syncable::ModelTypePayloadMapToValue(types)); + syncer::ModelTypePayloadMapToValue(types)); SyncSourceInfo source_info(updates_source, types); @@ -57,16 +57,16 @@ TEST_F(SessionStateTest, SyncSessionSnapshotToValue) { const bool kIsShareUsable = true; - const syncable::ModelTypeSet initial_sync_ended( - syncable::BOOKMARKS, syncable::PREFERENCES); + const syncer::ModelTypeSet initial_sync_ended( + syncer::BOOKMARKS, syncer::PREFERENCES); scoped_ptr<ListValue> expected_initial_sync_ended_value( - syncable::ModelTypeSetToValue(initial_sync_ended)); + syncer::ModelTypeSetToValue(initial_sync_ended)); - syncable::ModelTypePayloadMap download_progress_markers; - download_progress_markers[syncable::BOOKMARKS] = "test"; - download_progress_markers[syncable::APPS] = "apps"; + syncer::ModelTypePayloadMap download_progress_markers; + download_progress_markers[syncer::BOOKMARKS] = "test"; + download_progress_markers[syncer::APPS] = "apps"; scoped_ptr<DictionaryValue> expected_download_progress_markers_value( - syncable::ModelTypePayloadMapToValue(download_progress_markers)); + syncer::ModelTypePayloadMapToValue(download_progress_markers)); const bool kHasMoreToSync = false; const bool kIsSilenced = true; diff --git a/sync/sessions/status_controller.cc b/sync/sessions/status_controller.cc index 7ca043e..64fbb856 100644 --- a/sync/sessions/status_controller.cc +++ b/sync/sessions/status_controller.cc @@ -13,9 +13,6 @@ namespace syncer { namespace sessions { -using syncable::FIRST_REAL_MODEL_TYPE; -using syncable::MODEL_TYPE_COUNT; - StatusController::StatusController(const ModelSafeRoutingInfo& routes) : per_model_group_deleter_(&per_model_group_), group_restriction_in_effect_(false), @@ -98,7 +95,7 @@ void StatusController::increment_num_updates_downloaded_by(int value) { } void StatusController::set_types_needing_local_migration( - syncable::ModelTypeSet types) { + syncer::ModelTypeSet types) { model_neutral_.types_needing_local_migration = types; } diff --git a/sync/sessions/status_controller.h b/sync/sessions/status_controller.h index 0780a93..85f3815 100644 --- a/sync/sessions/status_controller.h +++ b/sync/sessions/status_controller.h @@ -68,10 +68,10 @@ class StatusController { ModelSafeGroup group); // ClientToServer messages. - const syncable::ModelTypeSet updates_request_types() const { + const syncer::ModelTypeSet updates_request_types() const { return model_neutral_.updates_request_types; } - void set_updates_request_types(syncable::ModelTypeSet value) { + void set_updates_request_types(syncer::ModelTypeSet value) { model_neutral_.updates_request_types = value; } const ClientToServerResponse& updates_response() const { @@ -143,7 +143,7 @@ class StatusController { } bool HasBookmarkCommitActivity() const { - return ActiveGroupRestrictionIncludesModel(syncable::BOOKMARKS); + return ActiveGroupRestrictionIncludesModel(syncer::BOOKMARKS); } const ModelNeutralState& model_neutral_state() const { @@ -158,7 +158,7 @@ class StatusController { void increment_num_updates_downloaded_by(int value); void increment_num_tombstone_updates_downloaded_by(int value); void increment_num_reflected_updates_downloaded_by(int value); - void set_types_needing_local_migration(syncable::ModelTypeSet types); + void set_types_needing_local_migration(syncer::ModelTypeSet types); void increment_num_local_overwrites(); void increment_num_server_overwrites(); void set_sync_protocol_error(const SyncProtocolError& error); @@ -179,7 +179,7 @@ class StatusController { // Check whether a particular model is included by the active group // restriction. - bool ActiveGroupRestrictionIncludesModel(syncable::ModelType model) const { + bool ActiveGroupRestrictionIncludesModel(syncer::ModelType model) const { if (!group_restriction_in_effect_) return true; ModelSafeRoutingInfo::const_iterator it = routing_info_.find(model); diff --git a/sync/sessions/status_controller_unittest.cc b/sync/sessions/status_controller_unittest.cc index b88ea26..055ba6d 100644 --- a/sync/sessions/status_controller_unittest.cc +++ b/sync/sessions/status_controller_unittest.cc @@ -12,7 +12,7 @@ namespace sessions { class StatusControllerTest : public testing::Test { public: virtual void SetUp() { - routes_[syncable::BOOKMARKS] = GROUP_UI; + routes_[syncer::BOOKMARKS] = GROUP_UI; } protected: ModelSafeRoutingInfo routes_; diff --git a/sync/sessions/sync_session.cc b/sync/sessions/sync_session.cc index 19a643d..0281dcd 100644 --- a/sync/sessions/sync_session.cc +++ b/sync/sessions/sync_session.cc @@ -48,17 +48,17 @@ std::set<ModelSafeGroup> ComputeEnabledGroups( return enabled_groups; } -void PurgeStalePayload(syncable::ModelTypePayloadMap* original, +void PurgeStalePayload(syncer::ModelTypePayloadMap* original, const ModelSafeRoutingInfo& routing_info) { - std::vector<syncable::ModelTypePayloadMap::iterator> iterators_to_delete; - for (syncable::ModelTypePayloadMap::iterator i = original->begin(); + std::vector<syncer::ModelTypePayloadMap::iterator> iterators_to_delete; + for (syncer::ModelTypePayloadMap::iterator i = original->begin(); i != original->end(); ++i) { if (routing_info.end() == routing_info.find(i->first)) { iterators_to_delete.push_back(i); } } - for (std::vector<syncable::ModelTypePayloadMap::iterator>::iterator + for (std::vector<syncer::ModelTypePayloadMap::iterator>::iterator it = iterators_to_delete.begin(); it != iterators_to_delete.end(); ++it) { original->erase(*it); @@ -156,11 +156,11 @@ SyncSessionSnapshot SyncSession::TakeSnapshot() const { syncable::Directory* dir = context_->directory(); bool is_share_useable = true; - syncable::ModelTypeSet initial_sync_ended; - syncable::ModelTypePayloadMap download_progress_markers; - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i < syncable::MODEL_TYPE_COUNT; ++i) { - syncable::ModelType type(syncable::ModelTypeFromInt(i)); + syncer::ModelTypeSet initial_sync_ended; + syncer::ModelTypePayloadMap download_progress_markers; + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i < syncer::MODEL_TYPE_COUNT; ++i) { + syncer::ModelType type(syncer::ModelTypeFromInt(i)); if (routing_info_.count(type) != 0) { if (dir->initial_sync_ended_for_type(type)) initial_sync_ended.Put(type); diff --git a/sync/sessions/sync_session_unittest.cc b/sync/sessions/sync_session_unittest.cc index 45e2a08..6fe3bb0 100644 --- a/sync/sessions/sync_session_unittest.cc +++ b/sync/sessions/sync_session_unittest.cc @@ -53,8 +53,8 @@ class SyncSessionTest : public testing::Test, throttled_data_type_tracker_.get(), std::vector<SyncEngineEventListener*>(), NULL, NULL)); routes_.clear(); - routes_[syncable::BOOKMARKS] = GROUP_UI; - routes_[syncable::AUTOFILL] = GROUP_DB; + routes_[syncer::BOOKMARKS] = GROUP_UI; + routes_[syncer::AUTOFILL] = GROUP_DB; scoped_refptr<ModelSafeWorker> passive_worker( new FakeModelWorker(GROUP_PASSIVE)); scoped_refptr<ModelSafeWorker> ui_worker( @@ -118,14 +118,13 @@ class SyncSessionTest : public testing::Test, FAIL() << msg; } - syncable::ModelTypeSet ParamsMeaningAllEnabledTypes() { - syncable::ModelTypeSet request_params( - syncable::BOOKMARKS, syncable::AUTOFILL); + syncer::ModelTypeSet ParamsMeaningAllEnabledTypes() { + syncer::ModelTypeSet request_params(syncer::BOOKMARKS, syncer::AUTOFILL); return request_params; } - syncable::ModelTypeSet ParamsMeaningJustOneEnabledType() { - return syncable::ModelTypeSet(syncable::AUTOFILL); + syncer::ModelTypeSet ParamsMeaningJustOneEnabledType() { + return syncer::ModelTypeSet(syncer::AUTOFILL); } MessageLoop message_loop_; @@ -267,12 +266,12 @@ TEST_F(SyncSessionTest, ResetTransientState) { TEST_F(SyncSessionTest, Coalesce) { std::vector<ModelSafeWorker*> workers_one, workers_two; ModelSafeRoutingInfo routes_one, routes_two; - syncable::ModelTypePayloadMap one_type = - syncable::ModelTypePayloadMapFromEnumSet( + syncer::ModelTypePayloadMap one_type = + syncer::ModelTypePayloadMapFromEnumSet( ParamsMeaningJustOneEnabledType(), std::string()); - syncable::ModelTypePayloadMap all_types = - syncable::ModelTypePayloadMapFromEnumSet( + syncer::ModelTypePayloadMap all_types = + syncer::ModelTypePayloadMapFromEnumSet( ParamsMeaningAllEnabledTypes(), std::string()); SyncSourceInfo source_one(sync_pb::GetUpdatesCallerInfo::PERIODIC, one_type); @@ -287,9 +286,9 @@ TEST_F(SyncSessionTest, Coalesce) { workers_two.push_back(passive_worker); workers_two.push_back(db_worker); workers_two.push_back(ui_worker); - routes_one[syncable::AUTOFILL] = GROUP_DB; - routes_two[syncable::AUTOFILL] = GROUP_DB; - routes_two[syncable::BOOKMARKS] = GROUP_UI; + routes_one[syncer::AUTOFILL] = GROUP_DB; + routes_two[syncer::AUTOFILL] = GROUP_DB; + routes_two[syncer::BOOKMARKS] = GROUP_UI; SyncSession one(context_.get(), this, source_one, routes_one, workers_one); SyncSession two(context_.get(), this, source_two, routes_two, workers_two); @@ -324,12 +323,12 @@ TEST_F(SyncSessionTest, Coalesce) { TEST_F(SyncSessionTest, RebaseRoutingInfoWithLatestRemoveOneType) { std::vector<ModelSafeWorker*> workers_one, workers_two; ModelSafeRoutingInfo routes_one, routes_two; - syncable::ModelTypePayloadMap one_type = - syncable::ModelTypePayloadMapFromEnumSet( + syncer::ModelTypePayloadMap one_type = + syncer::ModelTypePayloadMapFromEnumSet( ParamsMeaningJustOneEnabledType(), std::string()); - syncable::ModelTypePayloadMap all_types = - syncable::ModelTypePayloadMapFromEnumSet( + syncer::ModelTypePayloadMap all_types = + syncer::ModelTypePayloadMapFromEnumSet( ParamsMeaningAllEnabledTypes(), std::string()); SyncSourceInfo source_one(sync_pb::GetUpdatesCallerInfo::PERIODIC, one_type); @@ -344,9 +343,9 @@ TEST_F(SyncSessionTest, RebaseRoutingInfoWithLatestRemoveOneType) { workers_two.push_back(passive_worker); workers_two.push_back(db_worker); workers_two.push_back(ui_worker); - routes_one[syncable::AUTOFILL] = GROUP_DB; - routes_two[syncable::AUTOFILL] = GROUP_DB; - routes_two[syncable::BOOKMARKS] = GROUP_UI; + routes_one[syncer::AUTOFILL] = GROUP_DB; + routes_two[syncer::AUTOFILL] = GROUP_DB; + routes_two[syncer::BOOKMARKS] = GROUP_UI; SyncSession one(context_.get(), this, source_one, routes_one, workers_one); SyncSession two(context_.get(), this, source_two, routes_two, workers_two); @@ -385,7 +384,7 @@ TEST_F(SyncSessionTest, RebaseRoutingInfoWithLatestRemoveOneType) { // Make sure the model safe routing info is reduced to one type. ModelSafeRoutingInfo::const_iterator it = - two.routing_info().find(syncable::AUTOFILL); + two.routing_info().find(syncer::AUTOFILL); // Note that attempting to use EXPECT_NE would fail for an Android build due // to seeming incompatibility with gtest and stlport. EXPECT_TRUE(it != two.routing_info().end()); @@ -396,8 +395,8 @@ TEST_F(SyncSessionTest, RebaseRoutingInfoWithLatestRemoveOneType) { TEST_F(SyncSessionTest, RebaseRoutingInfoWithLatestWithSameType) { std::vector<ModelSafeWorker*> workers_first, workers_second; ModelSafeRoutingInfo routes_first, routes_second; - syncable::ModelTypePayloadMap all_types = - syncable::ModelTypePayloadMapFromEnumSet( + syncer::ModelTypePayloadMap all_types = + syncer::ModelTypePayloadMapFromEnumSet( ParamsMeaningAllEnabledTypes(), std::string()); SyncSourceInfo source_first(sync_pb::GetUpdatesCallerInfo::PERIODIC, @@ -415,10 +414,10 @@ TEST_F(SyncSessionTest, RebaseRoutingInfoWithLatestWithSameType) { workers_second.push_back(passive_worker); workers_second.push_back(db_worker); workers_second.push_back(ui_worker); - routes_first[syncable::AUTOFILL] = GROUP_DB; - routes_first[syncable::BOOKMARKS] = GROUP_UI; - routes_second[syncable::AUTOFILL] = GROUP_DB; - routes_second[syncable::BOOKMARKS] = GROUP_UI; + routes_first[syncer::AUTOFILL] = GROUP_DB; + routes_first[syncer::BOOKMARKS] = GROUP_UI; + routes_second[syncer::AUTOFILL] = GROUP_DB; + routes_second[syncer::BOOKMARKS] = GROUP_UI; SyncSession first(context_.get(), this, source_first, routes_first, workers_first); SyncSession second(context_.get(), this, source_second, routes_second, @@ -459,9 +458,9 @@ TEST_F(SyncSessionTest, RebaseRoutingInfoWithLatestWithSameType) { // Make sure the model safe routing info is reduced to first type. ModelSafeRoutingInfo::const_iterator it1 = - second.routing_info().find(syncable::AUTOFILL); + second.routing_info().find(syncer::AUTOFILL); ModelSafeRoutingInfo::const_iterator it2 = - second.routing_info().find(syncable::BOOKMARKS); + second.routing_info().find(syncer::BOOKMARKS); // Note that attempting to use EXPECT_NE would fail for an Android build due // to seeming incompatibility with gtest and stlport. @@ -477,23 +476,23 @@ TEST_F(SyncSessionTest, RebaseRoutingInfoWithLatestWithSameType) { TEST_F(SyncSessionTest, MakeTypePayloadMapFromBitSet) { - syncable::ModelTypeSet types; + syncer::ModelTypeSet types; std::string payload = "test"; - syncable::ModelTypePayloadMap types_with_payloads = - syncable::ModelTypePayloadMapFromEnumSet(types, payload); + syncer::ModelTypePayloadMap types_with_payloads = + syncer::ModelTypePayloadMapFromEnumSet(types, payload); EXPECT_TRUE(types_with_payloads.empty()); - types.Put(syncable::BOOKMARKS); - types.Put(syncable::PASSWORDS); - types.Put(syncable::AUTOFILL); + types.Put(syncer::BOOKMARKS); + types.Put(syncer::PASSWORDS); + types.Put(syncer::AUTOFILL); payload = "test2"; types_with_payloads = - syncable::ModelTypePayloadMapFromEnumSet(types, payload); + syncer::ModelTypePayloadMapFromEnumSet(types, payload); ASSERT_EQ(3U, types_with_payloads.size()); - EXPECT_EQ(types_with_payloads[syncable::BOOKMARKS], payload); - EXPECT_EQ(types_with_payloads[syncable::PASSWORDS], payload); - EXPECT_EQ(types_with_payloads[syncable::AUTOFILL], payload); + EXPECT_EQ(types_with_payloads[syncer::BOOKMARKS], payload); + EXPECT_EQ(types_with_payloads[syncer::PASSWORDS], payload); + EXPECT_EQ(types_with_payloads[syncer::AUTOFILL], payload); } } // namespace diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc index e88b57d..da5449d 100644 --- a/sync/syncable/directory.cc +++ b/sync/syncable/directory.cc @@ -623,7 +623,7 @@ void Directory::PurgeEntriesWithTypeIn(ModelTypeSet types) { } // Ensure meta tracking for these data types reflects the deleted state. - for (syncable::ModelTypeSet::Iterator it = types.First(); + for (syncer::ModelTypeSet::Iterator it = types.First(); it.Good(); it.Inc()) { set_initial_sync_ended_for_type_unsafe(it.Get(), false); kernel_->persisted_info.reset_download_progress(it.Get()); @@ -798,7 +798,7 @@ int64 Directory::unsynced_entity_count() const { FullModelTypeSet Directory::GetServerTypesWithUnappliedUpdates( BaseTransaction* trans) const { - syncable::FullModelTypeSet server_types; + syncer::FullModelTypeSet server_types; ScopedKernelLock lock(this); for (int i = UNSPECIFIED; i < MODEL_TYPE_COUNT; ++i) { const ModelType type = ModelTypeFromInt(i); diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc index 033ec8f..293a444 100644 --- a/sync/syncable/directory_backing_store.cc +++ b/sync/syncable/directory_backing_store.cc @@ -544,14 +544,14 @@ ModelType DirectoryBackingStore::ModelIdToModelTypeEnum( const void* data, int size) { sync_pb::EntitySpecifics specifics; if (!specifics.ParseFromArray(data, size)) - return syncable::UNSPECIFIED; - return syncable::GetModelTypeFromSpecifics(specifics); + return syncer::UNSPECIFIED; + return syncer::GetModelTypeFromSpecifics(specifics); } // static string DirectoryBackingStore::ModelTypeEnumToModelId(ModelType model_type) { sync_pb::EntitySpecifics specifics; - syncable::AddDefaultFieldValue(model_type, &specifics); + syncer::AddDefaultFieldValue(model_type, &specifics); return specifics.SerializeAsString(); } diff --git a/sync/syncable/directory_backing_store.h b/sync/syncable/directory_backing_store.h index bfc6c4c..f519a32 100644 --- a/sync/syncable/directory_backing_store.h +++ b/sync/syncable/directory_backing_store.h @@ -113,7 +113,7 @@ class DirectoryBackingStore : public base::NonThreadSafe { // Drop all tables in preparation for reinitialization. void DropAllTables(); - // Serialization helpers for syncable::ModelType. These convert between + // Serialization helpers for syncer::ModelType. These convert between // the ModelType enum and the values we persist in the database to identify // a model. We persist a default instance of the specifics protobuf as the // ID, rather than the enum value. diff --git a/sync/syncable/directory_backing_store_unittest.cc b/sync/syncable/directory_backing_store_unittest.cc index aefdc43..1728da0 100644 --- a/sync/syncable/directory_backing_store_unittest.cc +++ b/sync/syncable/directory_backing_store_unittest.cc @@ -1952,25 +1952,25 @@ TEST_P(MigrationTest, ToCurrentVersion) { // Check download_progress state (v75 migration) ASSERT_EQ(694, - dir_info.kernel_info.download_progress[syncable::BOOKMARKS] + dir_info.kernel_info.download_progress[syncer::BOOKMARKS] .timestamp_token_for_migration()); ASSERT_FALSE( - dir_info.kernel_info.download_progress[syncable::BOOKMARKS] + dir_info.kernel_info.download_progress[syncer::BOOKMARKS] .has_token()); ASSERT_EQ(32904, - dir_info.kernel_info.download_progress[syncable::BOOKMARKS] + dir_info.kernel_info.download_progress[syncer::BOOKMARKS] .data_type_id()); ASSERT_FALSE( - dir_info.kernel_info.download_progress[syncable::THEMES] + dir_info.kernel_info.download_progress[syncer::THEMES] .has_timestamp_token_for_migration()); ASSERT_TRUE( - dir_info.kernel_info.download_progress[syncable::THEMES] + dir_info.kernel_info.download_progress[syncer::THEMES] .has_token()); ASSERT_TRUE( - dir_info.kernel_info.download_progress[syncable::THEMES] + dir_info.kernel_info.download_progress[syncer::THEMES] .token().empty()); ASSERT_EQ(41210, - dir_info.kernel_info.download_progress[syncable::THEMES] + dir_info.kernel_info.download_progress[syncer::THEMES] .data_type_id()); // Check metas diff --git a/sync/syncable/entry.cc b/sync/syncable/entry.cc index 170924e..948a0fc 100644 --- a/sync/syncable/entry.cc +++ b/sync/syncable/entry.cc @@ -64,7 +64,7 @@ const string& Entry::Get(StringField field) const { return kernel_->ref(field); } -syncable::ModelType Entry::GetServerModelType() const { +syncer::ModelType Entry::GetServerModelType() const { ModelType specifics_type = kernel_->GetServerModelType(); if (specifics_type != UNSPECIFIED) return specifics_type; @@ -81,7 +81,7 @@ syncable::ModelType Entry::GetServerModelType() const { return UNSPECIFIED; } -syncable::ModelType Entry::GetModelType() const { +syncer::ModelType Entry::GetModelType() const { ModelType specifics_type = GetModelTypeFromSpecifics(Get(SPECIFICS)); if (specifics_type != UNSPECIFIED) return specifics_type; diff --git a/sync/syncable/entry_kernel.cc b/sync/syncable/entry_kernel.cc index 28b6b0f..9308bcf 100644 --- a/sync/syncable/entry_kernel.cc +++ b/sync/syncable/entry_kernel.cc @@ -20,7 +20,7 @@ EntryKernel::EntryKernel() : dirty_(false) { EntryKernel::~EntryKernel() {} -syncable::ModelType EntryKernel::GetServerModelType() const { +syncer::ModelType EntryKernel::GetServerModelType() const { ModelType specifics_type = GetModelTypeFromSpecifics(ref(SERVER_SPECIFICS)); if (specifics_type != UNSPECIFIED) return specifics_type; diff --git a/sync/syncable/entry_kernel.h b/sync/syncable/entry_kernel.h index ac0af15..4efc5b1 100644 --- a/sync/syncable/entry_kernel.h +++ b/sync/syncable/entry_kernel.h @@ -291,7 +291,7 @@ struct EntryKernel { return id_fields[field - ID_FIELDS_BEGIN]; } - syncable::ModelType GetServerModelType() const; + syncer::ModelType GetServerModelType() const; // Dumps all kernel info into a DictionaryValue and returns it. // Transfers ownership of the DictionaryValue to the caller. diff --git a/sync/syncable/model_type.cc b/sync/syncable/model_type.cc index fee2973..1bf1ded 100644 --- a/sync/syncable/model_type.cc +++ b/sync/syncable/model_type.cc @@ -24,10 +24,9 @@ #include "sync/protocol/typed_url_specifics.pb.h" namespace syncer { -namespace syncable { -void AddDefaultFieldValue(syncable::ModelType datatype, - sync_pb::EntitySpecifics* specifics) { +void AddDefaultFieldValue(ModelType datatype, + sync_pb::EntitySpecifics* specifics) { switch (datatype) { case BOOKMARKS: specifics->mutable_bookmark(); @@ -276,11 +275,11 @@ const char* ModelTypeToString(ModelType model_type) { } StringValue* ModelTypeToValue(ModelType model_type) { - if (model_type >= syncable::FIRST_REAL_MODEL_TYPE) { + if (model_type >= FIRST_REAL_MODEL_TYPE) { return Value::CreateStringValue(ModelTypeToString(model_type)); - } else if (model_type == syncable::TOP_LEVEL_FOLDER) { + } else if (model_type == TOP_LEVEL_FOLDER) { return Value::CreateStringValue("Top-level folder"); - } else if (model_type == syncable::UNSPECIFIED) { + } else if (model_type == UNSPECIFIED) { return Value::CreateStringValue("Unspecified"); } NOTREACHED(); @@ -540,5 +539,4 @@ bool IsRealDataType(ModelType model_type) { return model_type >= FIRST_REAL_MODEL_TYPE && model_type < MODEL_TYPE_COUNT; } -} // namespace syncable } // namespace syncer diff --git a/sync/syncable/model_type_unittest.cc b/sync/syncable/model_type_unittest.cc index e846159..c40f899 100644 --- a/sync/syncable/model_type_unittest.cc +++ b/sync/syncable/model_type_unittest.cc @@ -12,14 +12,13 @@ #include "testing/gtest/include/gtest/gtest.h" namespace syncer { -namespace syncable { namespace { class ModelTypeTest : public testing::Test {}; TEST_F(ModelTypeTest, ModelTypeToValue) { - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i < syncable::MODEL_TYPE_COUNT; ++i) { + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i < syncer::MODEL_TYPE_COUNT; ++i) { ModelType model_type = ModelTypeFromInt(i); base::ExpectStringValue(ModelTypeToString(model_type), ModelTypeToValue(model_type)); @@ -31,8 +30,8 @@ TEST_F(ModelTypeTest, ModelTypeToValue) { } TEST_F(ModelTypeTest, ModelTypeFromValue) { - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i < syncable::MODEL_TYPE_COUNT; ++i) { + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i < syncer::MODEL_TYPE_COUNT; ++i) { ModelType model_type = ModelTypeFromInt(i); scoped_ptr<StringValue> value(ModelTypeToValue(model_type)); EXPECT_EQ(model_type, ModelTypeFromValue(*value)); @@ -40,7 +39,7 @@ TEST_F(ModelTypeTest, ModelTypeFromValue) { } TEST_F(ModelTypeTest, ModelTypeSetToValue) { - const ModelTypeSet model_types(syncable::BOOKMARKS, syncable::APPS); + const ModelTypeSet model_types(syncer::BOOKMARKS, syncer::APPS); scoped_ptr<ListValue> value(ModelTypeSetToValue(model_types)); EXPECT_EQ(2u, value->GetSize()); @@ -74,5 +73,4 @@ TEST_F(ModelTypeTest, IsRealDataType) { } } // namespace -} // namespace syncable } // namespace syncer diff --git a/sync/syncable/mutable_entry.cc b/sync/syncable/mutable_entry.cc index 95c021d..c61bcb3 100644 --- a/sync/syncable/mutable_entry.cc +++ b/sync/syncable/mutable_entry.cc @@ -232,7 +232,7 @@ bool MutableEntry::Put(ProtoField field, if (update_unapplied_updates_index) { // Remove ourselves from unapplied_update_metahandles with our // old server type. - const syncable::ModelType old_server_type = + const syncer::ModelType old_server_type = kernel_->GetServerModelType(); const int64 metahandle = kernel_->ref(META_HANDLE); size_t erase_count = @@ -247,7 +247,7 @@ bool MutableEntry::Put(ProtoField field, if (update_unapplied_updates_index) { // Add ourselves back into unapplied_update_metahandles with our // new server type. - const syncable::ModelType new_server_type = + const syncer::ModelType new_server_type = kernel_->GetServerModelType(); const int64 metahandle = kernel_->ref(META_HANDLE); dir()->kernel_->unapplied_update_metahandles[new_server_type] diff --git a/sync/syncable/nigori_util.cc b/sync/syncable/nigori_util.cc index 0228a48..00ddf95 100644 --- a/sync/syncable/nigori_util.cc +++ b/sync/syncable/nigori_util.cc @@ -69,7 +69,7 @@ bool EntryNeedsEncryption(ModelTypeSet encrypted_types, const Entry& entry) { if (!entry.Get(UNIQUE_SERVER_TAG).empty()) return false; // We don't encrypt unique server nodes. - syncable::ModelType type = entry.GetModelType(); + syncer::ModelType type = entry.GetModelType(); if (type == PASSWORDS || type == NIGORI) return false; // Checking NON_UNIQUE_NAME is not necessary for the correctness of encrypting @@ -160,10 +160,10 @@ bool UpdateEntryWithEncryption( syncer::Cryptographer* cryptographer, const sync_pb::EntitySpecifics& new_specifics, syncable::MutableEntry* entry) { - syncable::ModelType type = syncable::GetModelTypeFromSpecifics(new_specifics); - DCHECK_GE(type, syncable::FIRST_REAL_MODEL_TYPE); + syncer::ModelType type = syncer::GetModelTypeFromSpecifics(new_specifics); + DCHECK_GE(type, syncer::FIRST_REAL_MODEL_TYPE); const sync_pb::EntitySpecifics& old_specifics = entry->Get(SPECIFICS); - const syncable::ModelTypeSet encrypted_types = + const syncer::ModelTypeSet encrypted_types = cryptographer->GetEncryptedTypes(); // It's possible the nigori lost the set of encrypted types. If the current // specifics are already encrypted, we want to ensure we continue encrypting. @@ -187,7 +187,7 @@ bool UpdateEntryWithEncryption( base::JSONWriter::OPTIONS_PRETTY_PRINT, &info); DVLOG(2) << "Encrypting specifics of type " - << syncable::ModelTypeToString(type) + << syncer::ModelTypeToString(type) << " with content: " << info; } @@ -195,18 +195,18 @@ bool UpdateEntryWithEncryption( // encrypted. The first time we encrypt a node we start from scratch, hence // removing all the unencrypted data, but from then on we only want to // update the node if the data changes or the encryption key changes. - if (syncable::GetModelTypeFromSpecifics(old_specifics) == type && + if (syncer::GetModelTypeFromSpecifics(old_specifics) == type && was_encrypted) { generated_specifics.CopyFrom(old_specifics); } else { - syncable::AddDefaultFieldValue(type, &generated_specifics); + syncer::AddDefaultFieldValue(type, &generated_specifics); } // Does not change anything if underlying encrypted blob was already up // to date and encrypted with the default key. if (!cryptographer->Encrypt(new_specifics, generated_specifics.mutable_encrypted())) { NOTREACHED() << "Could not encrypt data for node of type " - << syncable::ModelTypeToString(type); + << syncer::ModelTypeToString(type); return false; } } @@ -221,7 +221,7 @@ bool UpdateEntryWithEncryption( if (!encrypted_without_overwriting_name && old_specifics.SerializeAsString() == generated_specifics.SerializeAsString()) { - DVLOG(2) << "Specifics of type " << syncable::ModelTypeToString(type) + DVLOG(2) << "Specifics of type " << syncer::ModelTypeToString(type) << " already match, dropping change."; return true; } @@ -231,7 +231,7 @@ bool UpdateEntryWithEncryption( entry->Put(syncable::NON_UNIQUE_NAME, kEncryptedString); // For bookmarks we actually put bogus data into the unencrypted specifics, // else the server will try to do it for us. - if (type == syncable::BOOKMARKS) { + if (type == syncer::BOOKMARKS) { sync_pb::BookmarkSpecifics* bookmark_specifics = generated_specifics.mutable_bookmark(); if (!entry->Get(syncable::IS_DIR)) @@ -241,7 +241,7 @@ bool UpdateEntryWithEncryption( } entry->Put(syncable::SPECIFICS, generated_specifics); DVLOG(1) << "Overwriting specifics of type " - << syncable::ModelTypeToString(type) + << syncer::ModelTypeToString(type) << " and marking for syncing."; syncable::MarkForSyncing(entry); return true; diff --git a/sync/syncable/syncable_mock.h b/sync/syncable/syncable_mock.h index c742792..977f9b3 100644 --- a/sync/syncable/syncable_mock.h +++ b/sync/syncable/syncable_mock.h @@ -25,12 +25,12 @@ class MockDirectory : public Directory { MOCK_METHOD1(GetEntryByHandle, syncable::EntryKernel*(int64)); - MOCK_METHOD2(set_last_downloadstamp, void(syncable::ModelType, int64)); + MOCK_METHOD2(set_last_downloadstamp, void(syncer::ModelType, int64)); MOCK_METHOD1(GetEntryByClientTag, syncable::EntryKernel*(const std::string&)); - MOCK_METHOD1(PurgeEntriesWithTypeIn, void(syncable::ModelTypeSet)); + MOCK_METHOD1(PurgeEntriesWithTypeIn, void(syncer::ModelTypeSet)); private: syncer::FakeEncryptor encryptor_; diff --git a/sync/syncable/syncable_unittest.cc b/sync/syncable/syncable_unittest.cc index 8649c6c..eb08ddb 100644 --- a/sync/syncable/syncable_unittest.cc +++ b/sync/syncable/syncable_unittest.cc @@ -548,7 +548,7 @@ TEST_F(SyncableDirectoryTest, TakeSnapshotGetsMetahandlesToPurge) { } } - syncable::ModelTypeSet to_purge(BOOKMARKS); + syncer::ModelTypeSet to_purge(BOOKMARKS); dir_->PurgeEntriesWithTypeIn(to_purge); Directory::SaveChangesSnapshot snapshot1; @@ -829,8 +829,7 @@ TEST_F(SyncableDirectoryTest, TestGetUnsynced) { TEST_F(SyncableDirectoryTest, TestGetUnappliedUpdates) { std::vector<int64> handles; int64 handle1, handle2; - const syncable::FullModelTypeSet all_types = - syncable::FullModelTypeSet::All(); + const syncer::FullModelTypeSet all_types = syncer::FullModelTypeSet::All(); { WriteTransaction trans(FROM_HERE, UNITTEST, dir_.get()); @@ -1404,7 +1403,7 @@ TEST_F(OnDiskSyncableDirectoryTest, TestPurgeEntriesWithTypeIn) { dir_->set_initial_sync_ended_for_type(PREFERENCES, true); dir_->set_initial_sync_ended_for_type(AUTOFILL, true); - syncable::ModelTypeSet types_to_purge(PREFERENCES, AUTOFILL); + syncer::ModelTypeSet types_to_purge(PREFERENCES, AUTOFILL); TestIdFactory id_factory; // Create some items for each type. @@ -1696,7 +1695,7 @@ TEST_F(OnDiskSyncableDirectoryTest, TestSaveChangesFailureWithPurge) { SwapInUnsaveableDirectory(); ASSERT_TRUE(dir_->good()); - syncable::ModelTypeSet set(BOOKMARKS); + syncer::ModelTypeSet set(BOOKMARKS); dir_->PurgeEntriesWithTypeIn(set); EXPECT_TRUE(IsInMetahandlesToPurge(handle1)); ASSERT_FALSE(dir_->SaveChanges()); diff --git a/sync/test/engine/mock_connection_manager.cc b/sync/test/engine/mock_connection_manager.cc index 77323c4..cf5ab20e 100644 --- a/sync/test/engine/mock_connection_manager.cc +++ b/sync/test/engine/mock_connection_manager.cc @@ -26,9 +26,6 @@ using sync_pb::SyncEnums; namespace syncer { -using syncable::FIRST_REAL_MODEL_TYPE; -using syncable::MODEL_TYPE_COUNT; -using syncable::ModelType; using syncable::WriteTransaction; static char kValidAuthToken[] = "AuthToken"; @@ -247,8 +244,8 @@ sync_pb::SyncEntity* MockConnectionManager::SetNigori( sync_pb::SyncEntity* ent = GetUpdateResponse()->add_entries(); ent->set_id_string(TestIdFactory::FromNumber(id).GetServerId()); ent->set_parent_id_string(TestIdFactory::FromNumber(0).GetServerId()); - ent->set_server_defined_unique_tag(syncable::ModelTypeToRootTag( - syncable::NIGORI)); + ent->set_server_defined_unique_tag(syncer::ModelTypeToRootTag( + syncer::NIGORI)); ent->set_name("Nigori"); ent->set_non_unique_name("Nigori"); ent->set_version(version); @@ -404,7 +401,7 @@ void MockConnectionManager::ProcessGetUpdates( // Verify that the GetUpdates filter sent by the Syncer matches the test // expectation. for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) { - ModelType model_type = syncable::ModelTypeFromInt(i); + ModelType model_type = syncer::ModelTypeFromInt(i); sync_pb::DataTypeProgressMarker const* progress_marker = GetProgressMarkerForType(gu.from_progress_marker(), model_type); EXPECT_EQ(expected_filter_.Has(model_type), (progress_marker != NULL)) @@ -428,7 +425,7 @@ void MockConnectionManager::ProcessGetUpdates( sync_pb::GetUpdatesResponse* updates = &update_queue_.front(); for (int i = 0; i < updates->entries_size(); ++i) { if (!updates->entries(i).deleted()) { - ModelType entry_type = syncable::GetModelType(updates->entries(i)); + ModelType entry_type = syncer::GetModelType(updates->entries(i)); EXPECT_TRUE( IsModelTypePresentInSpecifics(gu.from_progress_marker(), entry_type)) << "Syncer did not request updates being provided by the test."; @@ -557,8 +554,8 @@ const CommitResponse& MockConnectionManager::last_commit_response() const { bool MockConnectionManager::IsModelTypePresentInSpecifics( const google::protobuf::RepeatedPtrField< sync_pb::DataTypeProgressMarker>& filter, - syncable::ModelType value) { - int data_type_id = syncable::GetSpecificsFieldNumberFromModelType(value); + syncer::ModelType value) { + int data_type_id = syncer::GetSpecificsFieldNumberFromModelType(value); for (int i = 0; i < filter.size(); ++i) { if (filter.Get(i).data_type_id() == data_type_id) { return true; @@ -571,8 +568,8 @@ sync_pb::DataTypeProgressMarker const* MockConnectionManager::GetProgressMarkerForType( const google::protobuf::RepeatedPtrField< sync_pb::DataTypeProgressMarker>& filter, - syncable::ModelType value) { - int data_type_id = syncable::GetSpecificsFieldNumberFromModelType(value); + syncer::ModelType value) { + int data_type_id = syncer::GetSpecificsFieldNumberFromModelType(value); for (int i = 0; i < filter.size(); ++i) { if (filter.Get(i).data_type_id() == data_type_id) { return &(filter.Get(i)); diff --git a/sync/test/engine/mock_connection_manager.h b/sync/test/engine/mock_connection_manager.h index 9790309..fbef583 100644 --- a/sync/test/engine/mock_connection_manager.h +++ b/sync/test/engine/mock_connection_manager.h @@ -184,12 +184,12 @@ class MockConnectionManager : public syncer::ServerConnectionManager { // Expect that GetUpdates will request exactly the types indicated in // the bitset. void ExpectGetUpdatesRequestTypes( - syncable::ModelTypeSet expected_filter) { + syncer::ModelTypeSet expected_filter) { expected_filter_ = expected_filter; } void ExpectGetUpdatesRequestPayloads( - const syncable::ModelTypePayloadMap& payloads) { + const syncer::ModelTypePayloadMap& payloads) { expected_payloads_ = payloads; } @@ -260,12 +260,12 @@ class MockConnectionManager : public syncer::ServerConnectionManager { bool IsModelTypePresentInSpecifics( const google::protobuf::RepeatedPtrField< sync_pb::DataTypeProgressMarker>& filter, - syncable::ModelType value); + syncer::ModelType value); sync_pb::DataTypeProgressMarker const* GetProgressMarkerForType( const google::protobuf::RepeatedPtrField< sync_pb::DataTypeProgressMarker>& filter, - syncable::ModelType value); + syncer::ModelType value); // When false, we pretend to have network connectivity issues. bool server_reachable_; @@ -337,9 +337,9 @@ class MockConnectionManager : public syncer::ServerConnectionManager { // use the older sync_pb::SyncEntity_BookmarkData-style protocol. bool use_legacy_bookmarks_protocol_; - syncable::ModelTypeSet expected_filter_; + syncer::ModelTypeSet expected_filter_; - syncable::ModelTypePayloadMap expected_payloads_; + syncer::ModelTypePayloadMap expected_payloads_; int num_get_updates_requests_; diff --git a/sync/test/engine/syncer_command_test.h b/sync/test/engine/syncer_command_test.h index 58b034f..18d04cd 100644 --- a/sync/test/engine/syncer_command_test.h +++ b/sync/test/engine/syncer_command_test.h @@ -101,7 +101,7 @@ class SyncerCommandTestBase : public testing::Test, // Lazily create a session requesting all datatypes with no payload. sessions::SyncSession* session() { - syncable::ModelTypePayloadMap types = + syncer::ModelTypePayloadMap types = ModelSafeRoutingInfoToPayloadMap(routing_info_, std::string()); return session(sessions::SyncSourceInfo(types)); } diff --git a/sync/tools/sync_client.cc b/sync/tools/sync_client.cc index 8d98646..d9fd4c5 100644 --- a/sync/tools/sync_client.cc +++ b/sync/tools/sync_client.cc @@ -155,11 +155,11 @@ class LoggingChangeDelegate : public syncer::SyncManager::ChangeDelegate { virtual ~LoggingChangeDelegate() {} virtual void OnChangesApplied( - syncable::ModelType model_type, + syncer::ModelType model_type, const syncer::BaseTransaction* trans, const syncer::ImmutableChangeRecordList& changes) OVERRIDE { LOG(INFO) << "Changes applied for " - << syncable::ModelTypeToString(model_type); + << syncer::ModelTypeToString(model_type); size_t i = 1; size_t change_count = changes.Get().size(); for (syncer::ChangeRecordList::const_iterator it = @@ -177,9 +177,9 @@ class LoggingChangeDelegate : public syncer::SyncManager::ChangeDelegate { } } - virtual void OnChangesComplete(syncable::ModelType model_type) OVERRIDE { + virtual void OnChangesComplete(syncer::ModelType model_type) OVERRIDE { LOG(INFO) << "Changes complete for " - << syncable::ModelTypeToString(model_type); + << syncer::ModelTypeToString(model_type); } }; @@ -314,9 +314,9 @@ int main(int argc, char* argv[]) { CHECK(database_dir.CreateUniqueTempDir()); // Set up model type parameters. - const syncable::ModelTypeSet model_types = syncable::ModelTypeSet::All(); + const syncer::ModelTypeSet model_types = syncer::ModelTypeSet::All(); syncer::ModelSafeRoutingInfo routing_info; - for (syncable::ModelTypeSet::Iterator it = model_types.First(); + for (syncer::ModelTypeSet::Iterator it = model_types.First(); it.Good(); it.Inc()) { routing_info[it.Get()] = syncer::GROUP_PASSIVE; } diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc index 29d6edc..cab1cd6 100644 --- a/sync/tools/sync_listen_notifications.cc +++ b/sync/tools/sync_listen_notifications.cc @@ -62,14 +62,14 @@ class NotificationPrinter : public syncer::SyncNotifierObserver { } virtual void OnIncomingNotification( - const syncable::ModelTypePayloadMap& type_payloads, + const syncer::ModelTypePayloadMap& type_payloads, syncer::IncomingNotificationSource source) OVERRIDE { - for (syncable::ModelTypePayloadMap::const_iterator it = + for (syncer::ModelTypePayloadMap::const_iterator it = type_payloads.begin(); it != type_payloads.end(); ++it) { LOG(INFO) << (source == syncer::REMOTE_NOTIFICATION ? "Remote" : "Local") << " Notification: type = " - << syncable::ModelTypeToString(it->first) + << syncer::ModelTypeToString(it->first) << ", payload = " << it->second; } } @@ -242,7 +242,7 @@ int main(int argc, char* argv[]) { sync_notifier->SetUniqueId(kUniqueId); sync_notifier->UpdateCredentials(email, token); // Listen for notifications for all known types. - sync_notifier->UpdateEnabledTypes(syncable::ModelTypeSet::All()); + sync_notifier->UpdateEnabledTypes(syncer::ModelTypeSet::All()); ui_loop.Run(); diff --git a/sync/util/cryptographer.cc b/sync/util/cryptographer.cc index 6cb7fab..59e8a1a 100644 --- a/sync/util/cryptographer.cc +++ b/sync/util/cryptographer.cc @@ -309,12 +309,12 @@ Cryptographer::UpdateResult Cryptographer::Update( } // Static -syncable::ModelTypeSet Cryptographer::SensitiveTypes() { +syncer::ModelTypeSet Cryptographer::SensitiveTypes() { // Both of these have their own encryption schemes, but we include them // anyways. - syncable::ModelTypeSet types; - types.Put(syncable::PASSWORDS); - types.Put(syncable::NIGORI); + syncer::ModelTypeSet types; + types.Put(syncer::PASSWORDS); + types.Put(syncer::NIGORI); return types; } @@ -325,33 +325,33 @@ void Cryptographer::UpdateEncryptedTypesFromNigori( return; } - syncable::ModelTypeSet encrypted_types(SensitiveTypes()); + syncer::ModelTypeSet encrypted_types(SensitiveTypes()); if (nigori.encrypt_bookmarks()) - encrypted_types.Put(syncable::BOOKMARKS); + encrypted_types.Put(syncer::BOOKMARKS); if (nigori.encrypt_preferences()) - encrypted_types.Put(syncable::PREFERENCES); + encrypted_types.Put(syncer::PREFERENCES); if (nigori.encrypt_autofill_profile()) - encrypted_types.Put(syncable::AUTOFILL_PROFILE); + encrypted_types.Put(syncer::AUTOFILL_PROFILE); if (nigori.encrypt_autofill()) - encrypted_types.Put(syncable::AUTOFILL); + encrypted_types.Put(syncer::AUTOFILL); if (nigori.encrypt_themes()) - encrypted_types.Put(syncable::THEMES); + encrypted_types.Put(syncer::THEMES); if (nigori.encrypt_typed_urls()) - encrypted_types.Put(syncable::TYPED_URLS); + encrypted_types.Put(syncer::TYPED_URLS); if (nigori.encrypt_extension_settings()) - encrypted_types.Put(syncable::EXTENSION_SETTINGS); + encrypted_types.Put(syncer::EXTENSION_SETTINGS); if (nigori.encrypt_extensions()) - encrypted_types.Put(syncable::EXTENSIONS); + encrypted_types.Put(syncer::EXTENSIONS); if (nigori.encrypt_search_engines()) - encrypted_types.Put(syncable::SEARCH_ENGINES); + encrypted_types.Put(syncer::SEARCH_ENGINES); if (nigori.encrypt_sessions()) - encrypted_types.Put(syncable::SESSIONS); + encrypted_types.Put(syncer::SESSIONS); if (nigori.encrypt_app_settings()) - encrypted_types.Put(syncable::APP_SETTINGS); + encrypted_types.Put(syncer::APP_SETTINGS); if (nigori.encrypt_apps()) - encrypted_types.Put(syncable::APPS); + encrypted_types.Put(syncer::APPS); if (nigori.encrypt_app_notifications()) - encrypted_types.Put(syncable::APP_NOTIFICATIONS); + encrypted_types.Put(syncer::APP_NOTIFICATIONS); // Note: the initial version with encryption did not support the // encrypt_everything field. If anything more than the sensitive types were @@ -369,38 +369,38 @@ void Cryptographer::UpdateNigoriFromEncryptedTypes( sync_pb::NigoriSpecifics* nigori) const { nigori->set_encrypt_everything(encrypt_everything_); nigori->set_encrypt_bookmarks( - encrypted_types_.Has(syncable::BOOKMARKS)); + encrypted_types_.Has(syncer::BOOKMARKS)); nigori->set_encrypt_preferences( - encrypted_types_.Has(syncable::PREFERENCES)); + encrypted_types_.Has(syncer::PREFERENCES)); nigori->set_encrypt_autofill_profile( - encrypted_types_.Has(syncable::AUTOFILL_PROFILE)); - nigori->set_encrypt_autofill(encrypted_types_.Has(syncable::AUTOFILL)); - nigori->set_encrypt_themes(encrypted_types_.Has(syncable::THEMES)); + encrypted_types_.Has(syncer::AUTOFILL_PROFILE)); + nigori->set_encrypt_autofill(encrypted_types_.Has(syncer::AUTOFILL)); + nigori->set_encrypt_themes(encrypted_types_.Has(syncer::THEMES)); nigori->set_encrypt_typed_urls( - encrypted_types_.Has(syncable::TYPED_URLS)); + encrypted_types_.Has(syncer::TYPED_URLS)); nigori->set_encrypt_extension_settings( - encrypted_types_.Has(syncable::EXTENSION_SETTINGS)); + encrypted_types_.Has(syncer::EXTENSION_SETTINGS)); nigori->set_encrypt_extensions( - encrypted_types_.Has(syncable::EXTENSIONS)); + encrypted_types_.Has(syncer::EXTENSIONS)); nigori->set_encrypt_search_engines( - encrypted_types_.Has(syncable::SEARCH_ENGINES)); - nigori->set_encrypt_sessions(encrypted_types_.Has(syncable::SESSIONS)); + encrypted_types_.Has(syncer::SEARCH_ENGINES)); + nigori->set_encrypt_sessions(encrypted_types_.Has(syncer::SESSIONS)); nigori->set_encrypt_app_settings( - encrypted_types_.Has(syncable::APP_SETTINGS)); - nigori->set_encrypt_apps(encrypted_types_.Has(syncable::APPS)); + encrypted_types_.Has(syncer::APP_SETTINGS)); + nigori->set_encrypt_apps(encrypted_types_.Has(syncer::APPS)); nigori->set_encrypt_app_notifications( - encrypted_types_.Has(syncable::APP_NOTIFICATIONS)); + encrypted_types_.Has(syncer::APP_NOTIFICATIONS)); } void Cryptographer::set_encrypt_everything() { if (encrypt_everything_) { - DCHECK(encrypted_types_.Equals(syncable::ModelTypeSet::All())); + DCHECK(encrypted_types_.Equals(syncer::ModelTypeSet::All())); return; } encrypt_everything_ = true; // Change |encrypted_types_| directly to avoid sending more than one // notification. - encrypted_types_ = syncable::ModelTypeSet::All(); + encrypted_types_ = syncer::ModelTypeSet::All(); EmitEncryptedTypesChangedNotification(); } @@ -408,17 +408,17 @@ bool Cryptographer::encrypt_everything() const { return encrypt_everything_; } -syncable::ModelTypeSet Cryptographer::GetEncryptedTypes() const { +syncer::ModelTypeSet Cryptographer::GetEncryptedTypes() const { return encrypted_types_; } void Cryptographer::MergeEncryptedTypesForTest( - syncable::ModelTypeSet encrypted_types) { + syncer::ModelTypeSet encrypted_types) { MergeEncryptedTypes(encrypted_types); } void Cryptographer::MergeEncryptedTypes( - syncable::ModelTypeSet encrypted_types) { + syncer::ModelTypeSet encrypted_types) { if (encrypted_types_.HasAll(encrypted_types)) { return; } diff --git a/sync/util/cryptographer.h b/sync/util/cryptographer.h index f68655d..c234952 100644 --- a/sync/util/cryptographer.h +++ b/sync/util/cryptographer.h @@ -65,7 +65,7 @@ class Cryptographer { // set of encrypted types is SensitiveTypes() and that the encrypt // everything flag is false. virtual void OnEncryptedTypesChanged( - syncable::ModelTypeSet encrypted_types, + syncer::ModelTypeSet encrypted_types, bool encrypt_everything) = 0; protected: @@ -181,7 +181,7 @@ class Cryptographer { UpdateResult Update(const sync_pb::NigoriSpecifics& nigori); // The set of types that are always encrypted. - static syncable::ModelTypeSet SensitiveTypes(); + static syncer::ModelTypeSet SensitiveTypes(); // Reset our set of encrypted types based on the contents of the nigori // specifics. @@ -198,11 +198,10 @@ class Cryptographer { bool encrypt_everything() const; // Return the set of encrypted types. - syncable::ModelTypeSet GetEncryptedTypes() const; + syncer::ModelTypeSet GetEncryptedTypes() const; // Forwards to MergeEncryptedTypes. - void MergeEncryptedTypesForTest( - syncable::ModelTypeSet encrypted_types); + void MergeEncryptedTypesForTest(syncer::ModelTypeSet encrypted_types); private: FRIEND_TEST_ALL_PREFIXES(SyncCryptographerTest, PackUnpack); @@ -210,7 +209,7 @@ class Cryptographer { // Merges the given set of encrypted types with the existing set and emits a // notification if necessary. - void MergeEncryptedTypes(syncable::ModelTypeSet encrypted_types); + void MergeEncryptedTypes(syncer::ModelTypeSet encrypted_types); void EmitEncryptedTypesChangedNotification(); @@ -242,7 +241,7 @@ class Cryptographer { scoped_ptr<sync_pb::EncryptedData> pending_keys_; - syncable::ModelTypeSet encrypted_types_; + syncer::ModelTypeSet encrypted_types_; bool encrypt_everything_; DISALLOW_COPY_AND_ASSIGN(Cryptographer); diff --git a/sync/util/cryptographer_unittest.cc b/sync/util/cryptographer_unittest.cc index d493b20..fe0798d 100644 --- a/sync/util/cryptographer_unittest.cc +++ b/sync/util/cryptographer_unittest.cc @@ -22,12 +22,11 @@ namespace { using ::testing::_; using ::testing::Mock; using ::testing::StrictMock; -using syncable::ModelTypeSet; class MockObserver : public Cryptographer::Observer { public: MOCK_METHOD2(OnEncryptedTypesChanged, - void(syncable::ModelTypeSet, bool)); + void(syncer::ModelTypeSet, bool)); }; } // namespace @@ -245,15 +244,15 @@ TEST_F(SyncCryptographerTest, NigoriEncryptionTypes) { EXPECT_CALL(observer, OnEncryptedTypesChanged( - HasModelTypes(syncable::ModelTypeSet::All()), + HasModelTypes(syncer::ModelTypeSet::All()), false)); EXPECT_CALL(observer2, OnEncryptedTypesChanged( - HasModelTypes(syncable::ModelTypeSet::All()), + HasModelTypes(syncer::ModelTypeSet::All()), false)); // Set all encrypted types - encrypted_types = syncable::ModelTypeSet::All(); + encrypted_types = syncer::ModelTypeSet::All(); cryptographer_.MergeEncryptedTypesForTest(encrypted_types); cryptographer_.UpdateNigoriFromEncryptedTypes(&nigori); cryptographer2.UpdateEncryptedTypesFromNigori(nigori); @@ -269,7 +268,7 @@ TEST_F(SyncCryptographerTest, NigoriEncryptionTypes) { } TEST_F(SyncCryptographerTest, EncryptEverythingExplicit) { - ModelTypeSet real_types = syncable::ModelTypeSet::All(); + ModelTypeSet real_types = syncer::ModelTypeSet::All(); sync_pb::NigoriSpecifics specifics; specifics.set_encrypt_everything(true); @@ -278,13 +277,13 @@ TEST_F(SyncCryptographerTest, EncryptEverythingExplicit) { EXPECT_CALL(observer, OnEncryptedTypesChanged( - HasModelTypes(syncable::ModelTypeSet::All()), true)); + HasModelTypes(syncer::ModelTypeSet::All()), true)); EXPECT_FALSE(cryptographer_.encrypt_everything()); ModelTypeSet encrypted_types = cryptographer_.GetEncryptedTypes(); for (ModelTypeSet::Iterator iter = real_types.First(); iter.Good(); iter.Inc()) { - if (iter.Get() == syncable::PASSWORDS || iter.Get() == syncable::NIGORI) + if (iter.Get() == syncer::PASSWORDS || iter.Get() == syncer::NIGORI) EXPECT_TRUE(encrypted_types.Has(iter.Get())); else EXPECT_FALSE(encrypted_types.Has(iter.Get())); @@ -306,7 +305,7 @@ TEST_F(SyncCryptographerTest, EncryptEverythingExplicit) { } TEST_F(SyncCryptographerTest, EncryptEverythingImplicit) { - ModelTypeSet real_types = syncable::ModelTypeSet::All(); + ModelTypeSet real_types = syncer::ModelTypeSet::All(); sync_pb::NigoriSpecifics specifics; specifics.set_encrypt_bookmarks(true); // Non-passwords = encrypt everything @@ -315,13 +314,13 @@ TEST_F(SyncCryptographerTest, EncryptEverythingImplicit) { EXPECT_CALL(observer, OnEncryptedTypesChanged( - HasModelTypes(syncable::ModelTypeSet::All()), true)); + HasModelTypes(syncer::ModelTypeSet::All()), true)); EXPECT_FALSE(cryptographer_.encrypt_everything()); ModelTypeSet encrypted_types = cryptographer_.GetEncryptedTypes(); for (ModelTypeSet::Iterator iter = real_types.First(); iter.Good(); iter.Inc()) { - if (iter.Get() == syncable::PASSWORDS || iter.Get() == syncable::NIGORI) + if (iter.Get() == syncer::PASSWORDS || iter.Get() == syncer::NIGORI) EXPECT_TRUE(encrypted_types.Has(iter.Get())); else EXPECT_FALSE(encrypted_types.Has(iter.Get())); @@ -343,7 +342,7 @@ TEST_F(SyncCryptographerTest, EncryptEverythingImplicit) { } TEST_F(SyncCryptographerTest, UnknownSensitiveTypes) { - ModelTypeSet real_types = syncable::ModelTypeSet::All(); + ModelTypeSet real_types = syncer::ModelTypeSet::All(); sync_pb::NigoriSpecifics specifics; // Explicitly setting encrypt everything should override logic for implicit // encrypt everything. @@ -353,9 +352,9 @@ TEST_F(SyncCryptographerTest, UnknownSensitiveTypes) { StrictMock<MockObserver> observer; cryptographer_.AddObserver(&observer); - syncable::ModelTypeSet expected_encrypted_types = + syncer::ModelTypeSet expected_encrypted_types = Cryptographer::SensitiveTypes(); - expected_encrypted_types.Put(syncable::BOOKMARKS); + expected_encrypted_types.Put(syncer::BOOKMARKS); EXPECT_CALL(observer, OnEncryptedTypesChanged( @@ -365,7 +364,7 @@ TEST_F(SyncCryptographerTest, UnknownSensitiveTypes) { ModelTypeSet encrypted_types = cryptographer_.GetEncryptedTypes(); for (ModelTypeSet::Iterator iter = real_types.First(); iter.Good(); iter.Inc()) { - if (iter.Get() == syncable::PASSWORDS || iter.Get() == syncable::NIGORI) + if (iter.Get() == syncer::PASSWORDS || iter.Get() == syncer::NIGORI) EXPECT_TRUE(encrypted_types.Has(iter.Get())); else EXPECT_FALSE(encrypted_types.Has(iter.Get())); @@ -377,9 +376,9 @@ TEST_F(SyncCryptographerTest, UnknownSensitiveTypes) { encrypted_types = cryptographer_.GetEncryptedTypes(); for (ModelTypeSet::Iterator iter = real_types.First(); iter.Good(); iter.Inc()) { - if (iter.Get() == syncable::PASSWORDS || - iter.Get() == syncable::NIGORI || - iter.Get() == syncable::BOOKMARKS) + if (iter.Get() == syncer::PASSWORDS || + iter.Get() == syncer::NIGORI || + iter.Get() == syncer::BOOKMARKS) EXPECT_TRUE(encrypted_types.Has(iter.Get())); else EXPECT_FALSE(encrypted_types.Has(iter.Get())); diff --git a/sync/util/data_type_histogram.h b/sync/util/data_type_histogram.h index ed66bb7..6a1b9c36 100644 --- a/sync/util/data_type_histogram.h +++ b/sync/util/data_type_histogram.h @@ -21,7 +21,7 @@ // version of the datatype. // // Example usage (ignoring newlines necessary for multiline macro): -// std::vector<syncable::ModelType> types = GetEntryTypes(); +// std::vector<syncer::ModelType> types = GetEntryTypes(); // for (int i = 0; i < types.size(); ++i) { // #define PER_DATA_TYPE_MACRO(type_str) // UMA_HISTOGRAM_ENUMERATION("Sync." type_str "StartFailures", @@ -37,54 +37,54 @@ #define SYNC_DATA_TYPE_HISTOGRAM(datatype) \ do { \ switch (datatype) { \ - case syncable::BOOKMARKS: \ + case syncer::BOOKMARKS: \ PER_DATA_TYPE_MACRO("Bookmarks"); \ break; \ - case syncable::PREFERENCES: \ + case syncer::PREFERENCES: \ PER_DATA_TYPE_MACRO("Preferences"); \ break; \ - case syncable::PASSWORDS: \ + case syncer::PASSWORDS: \ PER_DATA_TYPE_MACRO("Passwords"); \ break; \ - case syncable::AUTOFILL: \ + case syncer::AUTOFILL: \ PER_DATA_TYPE_MACRO("Autofill"); \ break; \ - case syncable::AUTOFILL_PROFILE: \ + case syncer::AUTOFILL_PROFILE: \ PER_DATA_TYPE_MACRO("AutofillProfiles"); \ break; \ - case syncable::THEMES: \ + case syncer::THEMES: \ PER_DATA_TYPE_MACRO("Themes"); \ break; \ - case syncable::TYPED_URLS: \ + case syncer::TYPED_URLS: \ PER_DATA_TYPE_MACRO("TypedUrls"); \ break; \ - case syncable::EXTENSIONS: \ + case syncer::EXTENSIONS: \ PER_DATA_TYPE_MACRO("Extensions"); \ break; \ - case syncable::NIGORI: \ + case syncer::NIGORI: \ PER_DATA_TYPE_MACRO("Nigori"); \ break; \ - case syncable::SEARCH_ENGINES: \ + case syncer::SEARCH_ENGINES: \ PER_DATA_TYPE_MACRO("SearchEngines"); \ break; \ - case syncable::SESSIONS: \ + case syncer::SESSIONS: \ PER_DATA_TYPE_MACRO("Sessions"); \ break; \ - case syncable::APPS: \ + case syncer::APPS: \ PER_DATA_TYPE_MACRO("Apps"); \ break; \ - case syncable::APP_SETTINGS: \ + case syncer::APP_SETTINGS: \ PER_DATA_TYPE_MACRO("AppSettings"); \ break; \ - case syncable::EXTENSION_SETTINGS: \ + case syncer::EXTENSION_SETTINGS: \ PER_DATA_TYPE_MACRO("ExtensionSettings"); \ break; \ - case syncable::APP_NOTIFICATIONS: \ + case syncer::APP_NOTIFICATIONS: \ PER_DATA_TYPE_MACRO("AppNotifications"); \ break; \ default: \ NOTREACHED() << "Unknown datatype " \ - << syncable::ModelTypeToString(datatype); \ + << syncer::ModelTypeToString(datatype); \ } \ } while (0) diff --git a/sync/util/data_type_histogram_unittest.cc b/sync/util/data_type_histogram_unittest.cc index 0601d31..f43a19b 100644 --- a/sync/util/data_type_histogram_unittest.cc +++ b/sync/util/data_type_histogram_unittest.cc @@ -16,9 +16,9 @@ class DataTypeHistogramTest : public testing::Test { // Create a histogram of type HISTOGRAM_COUNTS for each model type. Nothing // should break. TEST(DataTypeHistogramTest, BasicCount) { - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i <= syncable::LAST_REAL_MODEL_TYPE; ++i) { - syncable::ModelType type = syncable::ModelTypeFromInt(i); + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i <= syncer::LAST_REAL_MODEL_TYPE; ++i) { + syncer::ModelType type = syncer::ModelTypeFromInt(i); #define PER_DATA_TYPE_MACRO(type_str) \ HISTOGRAM_COUNTS("Prefix" type_str "Suffix", 1); SYNC_DATA_TYPE_HISTOGRAM(type); @@ -29,9 +29,9 @@ TEST(DataTypeHistogramTest, BasicCount) { // Create a histogram of type SYNC_FREQ_HISTOGRAM for each model type. Nothing // should break. TEST(DataTypeHistogramTest, BasicFreq) { - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i <= syncable::LAST_REAL_MODEL_TYPE; ++i) { - syncable::ModelType type = syncable::ModelTypeFromInt(i); + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i <= syncer::LAST_REAL_MODEL_TYPE; ++i) { + syncer::ModelType type = syncer::ModelTypeFromInt(i); #define PER_DATA_TYPE_MACRO(type_str) \ SYNC_FREQ_HISTOGRAM("Prefix" type_str "Suffix", \ base::TimeDelta::FromSeconds(1)); @@ -48,9 +48,9 @@ TEST(DataTypeHistogramTest, BasicEnum) { TYPE_2, TYPE_COUNT, }; - for (int i = syncable::FIRST_REAL_MODEL_TYPE; - i <= syncable::LAST_REAL_MODEL_TYPE; ++i) { - syncable::ModelType type = syncable::ModelTypeFromInt(i); + for (int i = syncer::FIRST_REAL_MODEL_TYPE; + i <= syncer::LAST_REAL_MODEL_TYPE; ++i) { + syncer::ModelType type = syncer::ModelTypeFromInt(i); #define PER_DATA_TYPE_MACRO(type_str) \ UMA_HISTOGRAM_ENUMERATION("Prefix" type_str "Suffix", \ (i % 2 ? TYPE_1 : TYPE_2), TYPE_COUNT); |