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

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

Issue 6673079: Reduce boxing and unboxing of AutofillFieldType (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 9 years, 9 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_profile_model_associator.cc
diff --git a/chrome/browser/sync/glue/autofill_profile_model_associator.cc b/chrome/browser/sync/glue/autofill_profile_model_associator.cc
index d6b0cb94e2e031682edaf729fbc1876d934e294e..c609510469dc8aae6266d266c19819883651bcc4 100644
--- a/chrome/browser/sync/glue/autofill_profile_model_associator.cc
+++ b/chrome/browser/sync/glue/autofill_profile_model_associator.cc
@@ -62,8 +62,8 @@ bool AutofillProfileModelAssociator::TraverseAndAssociateChromeAutofillProfiles(
all_profiles_from_db.begin(); ix != all_profiles_from_db.end(); ++ix) {
AutofillProfile* p = *ix;
VLOG(2) << "[AUTOFILL MIGRATION] "
- << p->GetFieldText(AutofillType(NAME_FIRST))
- << p->GetFieldText(AutofillType(NAME_LAST))
+ << p->GetFieldText(NAME_FIRST)
+ << p->GetFieldText(NAME_LAST)
<< p->guid();
}
}
@@ -90,8 +90,8 @@ bool AutofillProfileModelAssociator::TraverseAndAssociateChromeAutofillProfiles(
current_profiles->find(guid) == current_profiles->end()) {
VLOG(2) << "[AUTOFILL MIGRATION]"
<< " Found in sync db: "
- << (*ix)->GetFieldText(AutofillType(NAME_FIRST))
- << (*ix)->GetFieldText(AutofillType(NAME_LAST))
+ << (*ix)->GetFieldText(NAME_FIRST)
+ << (*ix)->GetFieldText(NAME_LAST)
<< (*ix)->guid()
<< " so associating with node id " << node.GetId();
const sync_pb::AutofillProfileSpecifics& autofill(
@@ -210,9 +210,9 @@ bool AutofillProfileModelAssociator::DisassociateModels() {
bool AutofillProfileModelAssociator::MergeField(FormGroup* f,
AutofillFieldType t,
const std::string& specifics_field) {
- if (UTF16ToUTF8(f->GetFieldText(AutofillType(t))) == specifics_field)
+ if (UTF16ToUTF8(f->GetFieldText(t)) == specifics_field)
return false;
- f->SetInfo(AutofillType(t), UTF8ToUTF16(specifics_field));
+ f->SetInfo(t, UTF8ToUTF16(specifics_field));
return true;
}
bool AutofillProfileModelAssociator::SyncModelHasUserCreatedNodes(
@@ -323,8 +323,8 @@ bool AutofillProfileModelAssociator::MakeNewAutofillProfileSyncNodeIfNeeded(
current_profiles->insert(autofill_specifics.guid());
VLOG(2) << "[AUTOFILL MIGRATION]"
<< "Found in sync db but with a different guid: "
- << UTF16ToUTF8(profile.GetFieldText(AutofillType(NAME_FIRST)))
- << UTF16ToUTF8(profile.GetFieldText(AutofillType(NAME_LAST)))
+ << UTF16ToUTF8(profile.GetFieldText(NAME_FIRST))
+ << UTF16ToUTF8(profile.GetFieldText(NAME_LAST))
<< "New guid " << autofill_specifics.guid() << " sync node id "
<< sync_node_id << " so associating. Profile to be deleted "
<< profile.guid();
@@ -342,8 +342,8 @@ bool AutofillProfileModelAssociator::MakeNewAutofillProfileSyncNodeIfNeeded(
node.SetTitle(UTF8ToWide(profile.guid()));
VLOG(2) << "[AUTOFILL MIGRATION]"
<< "NOT Found in sync db "
- << UTF16ToUTF8(profile.GetFieldText(AutofillType(NAME_FIRST)))
- << UTF16ToUTF8(profile.GetFieldText(AutofillType(NAME_LAST)))
+ << UTF16ToUTF8(profile.GetFieldText(NAME_FIRST))
+ << UTF16ToUTF8(profile.GetFieldText(NAME_LAST))
<< profile.guid()
<< " so creating a new sync node. Sync node id "
<< node.GetId();

Powered by Google App Engine
This is Rietveld 408576698