Commit 684fe296 authored by Oscar Johansson's avatar Oscar Johansson Committed by Commit Bot

Make function names unique (components/autofill)

When building using jumbo, files gets merged and
functions with the same name may end up in the
same namespace and conflict. This happens for
functions in:
components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc
components/autofill/core/browser/webdata/autofill_sync_bridge_util.cc

The functions are very similar but not identical. Therefore,
the functions in
components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc
are renamed to be something more file specific.

Bug: 869381
Change-Id: I8b26857cfa9fd80b42d9ff79de4b49753c824b54
Reviewed-on: https://chromium-review.googlesource.com/1169018Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#581867}
parent c7806c5d
...@@ -33,7 +33,7 @@ void* AutofillWalletSyncableServiceUserDataKey() { ...@@ -33,7 +33,7 @@ void* AutofillWalletSyncableServiceUserDataKey() {
return reinterpret_cast<void*>(&user_data_key); return reinterpret_cast<void*>(&user_data_key);
} }
const char* CardNetworkFromWalletCardType( const char* CardNetworkFromAutofillWalletCardType(
sync_pb::WalletMaskedCreditCard::WalletCardType type) { sync_pb::WalletMaskedCreditCard::WalletCardType type) {
switch (type) { switch (type) {
case sync_pb::WalletMaskedCreditCard::AMEX: case sync_pb::WalletMaskedCreditCard::AMEX:
...@@ -58,7 +58,7 @@ const char* CardNetworkFromWalletCardType( ...@@ -58,7 +58,7 @@ const char* CardNetworkFromWalletCardType(
} }
} }
CreditCard::CardType CardTypeFromWalletCardClass( CreditCard::CardType CardTypeFromAutofillWalletCardClass(
sync_pb::WalletMaskedCreditCard::WalletCardClass card_class) { sync_pb::WalletMaskedCreditCard::WalletCardClass card_class) {
switch (card_class) { switch (card_class) {
case sync_pb::WalletMaskedCreditCard::CREDIT: case sync_pb::WalletMaskedCreditCard::CREDIT:
...@@ -72,7 +72,7 @@ CreditCard::CardType CardTypeFromWalletCardClass( ...@@ -72,7 +72,7 @@ CreditCard::CardType CardTypeFromWalletCardClass(
} }
} }
CreditCard::ServerStatus ServerToLocalStatus( CreditCard::ServerStatus ServerToLocalWalletCardStatus(
sync_pb::WalletMaskedCreditCard::WalletCardStatus status) { sync_pb::WalletMaskedCreditCard::WalletCardStatus status) {
switch (status) { switch (status) {
case sync_pb::WalletMaskedCreditCard::VALID: case sync_pb::WalletMaskedCreditCard::VALID:
...@@ -84,12 +84,14 @@ CreditCard::ServerStatus ServerToLocalStatus( ...@@ -84,12 +84,14 @@ CreditCard::ServerStatus ServerToLocalStatus(
} }
} }
CreditCard CardFromSpecifics(const sync_pb::WalletMaskedCreditCard& card) { CreditCard CardFromWalletCardSpecifics(
const sync_pb::WalletMaskedCreditCard& card) {
CreditCard result(CreditCard::MASKED_SERVER_CARD, card.id()); CreditCard result(CreditCard::MASKED_SERVER_CARD, card.id());
result.SetNumber(base::UTF8ToUTF16(card.last_four())); result.SetNumber(base::UTF8ToUTF16(card.last_four()));
result.SetServerStatus(ServerToLocalStatus(card.status())); result.SetServerStatus(ServerToLocalWalletCardStatus(card.status()));
result.SetNetworkForMaskedCard(CardNetworkFromWalletCardType(card.type())); result.SetNetworkForMaskedCard(
result.set_card_type(CardTypeFromWalletCardClass(card.card_class())); CardNetworkFromAutofillWalletCardType(card.type()));
result.set_card_type(CardTypeFromAutofillWalletCardClass(card.card_class()));
result.SetRawInfo(CREDIT_CARD_NAME_FULL, result.SetRawInfo(CREDIT_CARD_NAME_FULL,
base::UTF8ToUTF16(card.name_on_card())); base::UTF8ToUTF16(card.name_on_card()));
result.SetExpirationMonth(card.exp_month()); result.SetExpirationMonth(card.exp_month());
...@@ -99,7 +101,7 @@ CreditCard CardFromSpecifics(const sync_pb::WalletMaskedCreditCard& card) { ...@@ -99,7 +101,7 @@ CreditCard CardFromSpecifics(const sync_pb::WalletMaskedCreditCard& card) {
return result; return result;
} }
AutofillProfile ProfileFromSpecifics( AutofillProfile ProfileFromWalletCardSpecifics(
const sync_pb::WalletPostalAddress& address) { const sync_pb::WalletPostalAddress& address) {
AutofillProfile profile(AutofillProfile::SERVER_PROFILE, std::string()); AutofillProfile profile(AutofillProfile::SERVER_PROFILE, std::string());
...@@ -275,11 +277,11 @@ void AutofillWalletSyncableService::PopulateWalletCardsAndAddresses( ...@@ -275,11 +277,11 @@ void AutofillWalletSyncableService::PopulateWalletCardsAndAddresses(
switch (autofill_specifics.type()) { switch (autofill_specifics.type()) {
case sync_pb::AutofillWalletSpecifics::MASKED_CREDIT_CARD: case sync_pb::AutofillWalletSpecifics::MASKED_CREDIT_CARD:
wallet_cards->push_back( wallet_cards->push_back(
CardFromSpecifics(autofill_specifics.masked_card())); CardFromWalletCardSpecifics(autofill_specifics.masked_card()));
break; break;
case sync_pb::AutofillWalletSpecifics::POSTAL_ADDRESS: case sync_pb::AutofillWalletSpecifics::POSTAL_ADDRESS:
wallet_addresses->push_back( wallet_addresses->push_back(
ProfileFromSpecifics(autofill_specifics.address())); ProfileFromWalletCardSpecifics(autofill_specifics.address()));
// Map the sync billing address id to the profile's id. // Map the sync billing address id to the profile's id.
ids[autofill_specifics.address().id()] = ids[autofill_specifics.address().id()] =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment