Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(682)

Unified Diff: chrome/browser/sync/glue/autofill_model_associator.cc

Issue 6375007: [Sync] Refactored ProfileSyncService and remove its backend() function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add comment Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/glue/autofill_model_associator.cc
diff --git a/chrome/browser/sync/glue/autofill_model_associator.cc b/chrome/browser/sync/glue/autofill_model_associator.cc
index 14b9f2bd46a994690a99d16b52455abe5885ff6a..60c92d2f93568822fc0fda990ef324f3f5c0c763 100644
--- a/chrome/browser/sync/glue/autofill_model_associator.cc
+++ b/chrome/browser/sync/glue/autofill_model_associator.cc
@@ -151,8 +151,7 @@ bool AutofillModelAssociator::AssociateModels() {
DataBundle bundle;
{
- sync_api::WriteTransaction trans(
- sync_service_->backend()->GetUserShareHandle());
+ sync_api::WriteTransaction trans(sync_service_->GetUserShare());
sync_api::ReadNode autofill_root(&trans);
if (!autofill_root.InitByTagLookup(kAutofillTag)) {
@@ -185,12 +184,12 @@ bool AutofillModelAssociator::AssociateModels() {
return false;
}
- if (sync_service_->backend()->GetAutofillMigrationState() !=
+ if (sync_service_->GetAutofillMigrationState() !=
syncable::MIGRATED) {
syncable::AutofillMigrationDebugInfo debug_info;
debug_info.autofill_entries_added_during_migration =
number_of_entries_created_;
- sync_service_->backend()->SetAutofillMigrationDebugInfo(
+ sync_service_->SetAutofillMigrationDebugInfo(
syncable::AutofillMigrationDebugInfo::ENTRIES_ADDED,
debug_info);
}
@@ -383,8 +382,7 @@ bool AutofillModelAssociator::SyncModelHasUserCreatedNodes(bool* has_nodes) {
<< "might be running against an out-of-date server.";
return false;
}
- sync_api::ReadTransaction trans(
- sync_service_->backend()->GetUserShareHandle());
+ sync_api::ReadTransaction trans(sync_service_->GetUserShare());
sync_api::ReadNode autofill_node(&trans);
if (!autofill_node.InitByIdLookup(autofill_sync_id)) {
@@ -444,8 +442,7 @@ void AutofillModelAssociator::Disassociate(int64 sync_id) {
bool AutofillModelAssociator::GetSyncIdForTaggedNode(const std::string& tag,
int64* sync_id) {
- sync_api::ReadTransaction trans(
- sync_service_->backend()->GetUserShareHandle());
+ sync_api::ReadTransaction trans(sync_service_->GetUserShare());
sync_api::ReadNode sync_node(&trans);
if (!sync_node.InitByTagLookup(tag.c_str()))
return false;
@@ -533,7 +530,7 @@ bool AutofillModelAssociator::HasNotMigratedYet(
// Now read the current value from the directory.
syncable::AutofillMigrationState autofill_migration_state =
- sync_service()->backend()->GetAutofillMigrationState();
+ sync_service_->GetAutofillMigrationState();
DCHECK_NE(autofill_migration_state, syncable::NOT_DETERMINED);
@@ -555,7 +552,7 @@ bool AutofillModelAssociator::HasNotMigratedYet(
browser_sync::kAutofillProfileTag) ||
autofill_profile_root_node.GetFirstChildId()==
static_cast<int64>(0)) {
- sync_service()->backend()->SetAutofillMigrationState(
+ sync_service_->SetAutofillMigrationState(
syncable::NOT_MIGRATED);
VLOG(1) << "[AUTOFILL MIGRATION]"
@@ -565,7 +562,7 @@ bool AutofillModelAssociator::HasNotMigratedYet(
return true;
}
- sync_service()->backend()->SetAutofillMigrationState(syncable::MIGRATED);
+ sync_service_->SetAutofillMigrationState(syncable::MIGRATED);
VLOG(1) << "[AUTOFILL MIGRATION]"
<< "Current autofill migration state is migrated.";
« no previous file with comments | « chrome/browser/sync/glue/autofill_model_associator.h ('k') | chrome/browser/sync/glue/autofill_profile_model_associator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698