Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
Pass by reference in autofill API
Browse files Browse the repository at this point in the history
Auditors: @bbondy
  • Loading branch information
darkdh committed Sep 8, 2016
1 parent 3c63fc2 commit 50afdf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions atom/browser/api/atom_api_autofill.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ std::string Autofill::AddProfile(const base::DictionaryValue& profile) {
return personal_data->SaveImportedProfile(autofill_profile);
}

autofill::AutofillProfile* Autofill::GetProfile(std::string guid) {
autofill::AutofillProfile* Autofill::GetProfile(const std::string& guid) {
autofill::PersonalDataManager* personal_data =
autofill::PersonalDataManagerFactory::GetForBrowserContext(
browser_context_);
Expand All @@ -263,7 +263,7 @@ autofill::AutofillProfile* Autofill::GetProfile(std::string guid) {
return personal_data->GetProfileByGUID(guid);
}

bool Autofill::RemoveProfile(const std::string guid) {
bool Autofill::RemoveProfile(const std::string& guid) {
autofill::PersonalDataManager* personal_data =
autofill::PersonalDataManagerFactory::GetForBrowserContext(
browser_context_);
Expand Down Expand Up @@ -317,7 +317,7 @@ std::string Autofill::AddCreditCard(const base::DictionaryValue& card) {
return personal_data->SaveImportedCreditCard(credit_card);
}

autofill::CreditCard* Autofill::GetCreditCard(std::string guid) {
autofill::CreditCard* Autofill::GetCreditCard(const std::string& guid) {
autofill::PersonalDataManager* personal_data =
autofill::PersonalDataManagerFactory::GetForBrowserContext(
browser_context_);
Expand All @@ -328,7 +328,7 @@ autofill::CreditCard* Autofill::GetCreditCard(std::string guid) {
return personal_data->GetCreditCardByGUID(guid);
}

bool Autofill::RemoveCreditCard(const std::string guid) {
bool Autofill::RemoveCreditCard(const std::string& guid) {
autofill::PersonalDataManager* personal_data =
autofill::PersonalDataManagerFactory::GetForBrowserContext(
browser_context_);
Expand Down
8 changes: 4 additions & 4 deletions atom/browser/api/atom_api_autofill.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ class Autofill : public mate::TrackableObject<Autofill> {
~Autofill() override;

std::string AddProfile(const base::DictionaryValue& profile);
autofill::AutofillProfile* GetProfile(std::string guid);
bool RemoveProfile(const std::string guid);
autofill::AutofillProfile* GetProfile(const std::string& guid);
bool RemoveProfile(const std::string& guid);

std::string AddCreditCard(const base::DictionaryValue& card);
autofill::CreditCard* GetCreditCard(std::string guid);
bool RemoveCreditCard(const std::string guid);
autofill::CreditCard* GetCreditCard(const std::string& guid);
bool RemoveCreditCard(const std::string& guid);

brave::BraveBrowserContext* browser_context() {
return static_cast<brave::BraveBrowserContext*>(browser_context_);
Expand Down

1 comment on commit 50afdf1

@bbondy
Copy link
Member

@bbondy bbondy commented on 50afdf1 Sep 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks.

Please sign in to comment.