| Index: components/autofill/browser/personal_data_manager.cc
|
| diff --git a/components/autofill/browser/personal_data_manager.cc b/components/autofill/browser/personal_data_manager.cc
|
| index 34f00efc9ef1c94af0a94d9fbf6405af09c76b93..82d93d1915440e9b7b907735cafcb8bf8d10e4d8 100644
|
| --- a/components/autofill/browser/personal_data_manager.cc
|
| +++ b/components/autofill/browser/personal_data_manager.cc
|
| @@ -494,8 +494,9 @@ void PersonalDataManager::RemoveByGUID(const std::string& guid) {
|
| }
|
|
|
| CreditCard* PersonalDataManager::GetCreditCardByGUID(const std::string& guid) {
|
| - for (std::vector<CreditCard*>::iterator iter = credit_cards_.begin();
|
| - iter != credit_cards_.end(); ++iter) {
|
| + const std::vector<CreditCard*>& credit_cards = GetCreditCards();
|
| + for (std::vector<CreditCard*>::const_iterator iter = credit_cards.begin();
|
| + iter != credit_cards.end(); ++iter) {
|
| if ((*iter)->guid() == guid)
|
| return *iter;
|
| }
|
| @@ -541,7 +542,7 @@ const std::vector<AutofillProfile*>& PersonalDataManager::web_profiles() const {
|
| return web_profiles_.get();
|
| }
|
|
|
| -const std::vector<CreditCard*>& PersonalDataManager::credit_cards() const {
|
| +const std::vector<CreditCard*>& PersonalDataManager::GetCreditCards() const {
|
| return credit_cards_.get();
|
| }
|
|
|
| @@ -643,8 +644,9 @@ void PersonalDataManager::GetCreditCardSuggestions(
|
| icons->clear();
|
| guid_pairs->clear();
|
|
|
| - for (std::vector<CreditCard*>::const_iterator iter = credit_cards().begin();
|
| - iter != credit_cards().end(); ++iter) {
|
| + const std::vector<CreditCard*>& credit_cards = GetCreditCards();
|
| + for (std::vector<CreditCard*>::const_iterator iter = credit_cards.begin();
|
| + iter != credit_cards.end(); ++iter) {
|
| CreditCard* credit_card = *iter;
|
|
|
| // The value of the stored data for this field type in the |credit_card|.
|
|
|