Commit 89e08521 authored by Oscar Johansson's avatar Oscar Johansson Committed by Commit Bot

Renaming conflicting variables names (components/autofill)

When building using jumbo, files get merged and variables
and functions with the same name may end up in the same
namespace/scope and conflict.

This commit solves the issues in components/autofill
by renaming the conflicting functions and variables to
something more file specific.

Bug: 869381
Change-Id: Ifccae861ca7379346fb0939113ac227b770f9640
Reviewed-on: https://chromium-review.googlesource.com/1158235Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Commit-Queue: Oscar Johansson <oscarj@opera.com>
Cr-Commit-Position: refs/heads/master@{#579768}
parent cdf8699e
...@@ -42,7 +42,7 @@ namespace autofill { ...@@ -42,7 +42,7 @@ namespace autofill {
namespace { namespace {
const size_t kMaxQueryGetSize = 1400; // 1.25KB const size_t kMaxQueryGetSize = 1400; // 1.25KB
const size_t kMaxFormCacheSize = 16; const size_t kAutofillDownloadManagerMaxFormCacheSize = 16;
const size_t kMaxFieldsPerQueryRequest = 100; const size_t kMaxFieldsPerQueryRequest = 100;
const net::BackoffEntry::Policy kAutofillBackoffPolicy = { const net::BackoffEntry::Policy kAutofillBackoffPolicy = {
...@@ -286,7 +286,7 @@ AutofillDownloadManager::AutofillDownloadManager(AutofillDriver* driver, ...@@ -286,7 +286,7 @@ AutofillDownloadManager::AutofillDownloadManager(AutofillDriver* driver,
: driver_(driver), : driver_(driver),
observer_(observer), observer_(observer),
autofill_server_url_(GetAutofillServerURL()), autofill_server_url_(GetAutofillServerURL()),
max_form_cache_size_(kMaxFormCacheSize), max_form_cache_size_(kAutofillDownloadManagerMaxFormCacheSize),
loader_backoff_(&kAutofillBackoffPolicy), loader_backoff_(&kAutofillBackoffPolicy),
weak_factory_(this) { weak_factory_(this) {
DCHECK(observer_); DCHECK(observer_);
......
...@@ -16,7 +16,7 @@ namespace { ...@@ -16,7 +16,7 @@ namespace {
// Set a conservative upper bound on the number of forms we are willing to // Set a conservative upper bound on the number of forms we are willing to
// cache, simply to prevent unbounded memory consumption. // cache, simply to prevent unbounded memory consumption.
const size_t kMaxFormCacheSize = 100; const size_t kAutofillHandlerMaxFormCacheSize = 100;
} // namespace } // namespace
...@@ -172,7 +172,7 @@ bool AutofillHandler::ParseForm(const FormData& form, ...@@ -172,7 +172,7 @@ bool AutofillHandler::ParseForm(const FormData& form,
const FormStructure* cached_form, const FormStructure* cached_form,
FormStructure** parsed_form_structure) { FormStructure** parsed_form_structure) {
DCHECK(parsed_form_structure); DCHECK(parsed_form_structure);
if (form_structures_.size() >= kMaxFormCacheSize) if (form_structures_.size() >= kAutofillHandlerMaxFormCacheSize)
return false; return false;
auto form_structure = std::make_unique<FormStructure>(form); auto form_structure = std::make_unique<FormStructure>(form);
......
...@@ -77,7 +77,7 @@ std::unique_ptr<EntityData> CreateEntityDataFromAutofillDataModel( ...@@ -77,7 +77,7 @@ std::unique_ptr<EntityData> CreateEntityDataFromAutofillDataModel(
} }
// Returns EntityData for wallet_metadata for |local_profile|. // Returns EntityData for wallet_metadata for |local_profile|.
std::unique_ptr<EntityData> CreateEntityDataFromAutofillProfile( std::unique_ptr<EntityData> CreateWalletMetadataEntityDataFromAutofillProfile(
const AutofillProfile& local_profile) { const AutofillProfile& local_profile) {
std::unique_ptr<EntityData> entity_data = std::unique_ptr<EntityData> entity_data =
CreateEntityDataFromAutofillDataModel( CreateEntityDataFromAutofillDataModel(
...@@ -213,7 +213,8 @@ void AutofillWalletMetadataSyncBridge::GetDataImpl( ...@@ -213,7 +213,8 @@ void AutofillWalletMetadataSyncBridge::GetDataImpl(
for (const std::unique_ptr<AutofillProfile>& entry : profiles) { for (const std::unique_ptr<AutofillProfile>& entry : profiles) {
std::string key = GetStorageKeyForEntryServerId(entry->server_id()); std::string key = GetStorageKeyForEntryServerId(entry->server_id());
if (!storage_keys_set || base::ContainsKey(*storage_keys_set, key)) { if (!storage_keys_set || base::ContainsKey(*storage_keys_set, key)) {
batch->Put(key, CreateEntityDataFromAutofillProfile(*entry)); batch->Put(key,
CreateWalletMetadataEntityDataFromAutofillProfile(*entry));
} }
} }
for (const std::unique_ptr<CreditCard>& entry : cards) { for (const std::unique_ptr<CreditCard>& entry : cards) {
......
...@@ -17,7 +17,7 @@ namespace autofill { ...@@ -17,7 +17,7 @@ namespace autofill {
namespace { namespace {
const int kPickleVersion = 6; const int kFormDataPickleVersion = 6;
bool ReadGURL(base::PickleIterator* iter, GURL* url) { bool ReadGURL(base::PickleIterator* iter, GURL* url) {
std::string spec; std::string spec;
...@@ -152,7 +152,7 @@ std::ostream& operator<<(std::ostream& os, const FormData& form) { ...@@ -152,7 +152,7 @@ std::ostream& operator<<(std::ostream& os, const FormData& form) {
} }
void SerializeFormData(const FormData& form_data, base::Pickle* pickle) { void SerializeFormData(const FormData& form_data, base::Pickle* pickle) {
pickle->WriteInt(kPickleVersion); pickle->WriteInt(kFormDataPickleVersion);
pickle->WriteString16(form_data.name); pickle->WriteString16(form_data.name);
pickle->WriteString(form_data.origin.spec()); pickle->WriteString(form_data.origin.spec());
pickle->WriteString(form_data.action.spec()); pickle->WriteString(form_data.action.spec());
...@@ -179,7 +179,7 @@ bool DeserializeFormData(base::PickleIterator* iter, FormData* form_data) { ...@@ -179,7 +179,7 @@ bool DeserializeFormData(base::PickleIterator* iter, FormData* form_data) {
return false; return false;
} }
if (version < 1 || version > kPickleVersion) { if (version < 1 || version > kFormDataPickleVersion) {
DVLOG(1) << "Unknown FormData pickle version " << version; DVLOG(1) << "Unknown FormData pickle version " << version;
return false; return false;
} }
......
...@@ -15,8 +15,8 @@ namespace autofill { ...@@ -15,8 +15,8 @@ namespace autofill {
namespace { namespace {
// Increment this anytime pickle format is modified as well as provide // Increment this anytime pickle format is modified as well as provide
// deserialization routine from previous kPickleVersion format. // deserialization routine from previous kFormFieldDataPickleVersion format.
const int kPickleVersion = 7; const int kFormFieldDataPickleVersion = 7;
void AddVectorToPickle(std::vector<base::string16> strings, void AddVectorToPickle(std::vector<base::string16> strings,
base::Pickle* pickle) { base::Pickle* pickle) {
...@@ -280,7 +280,7 @@ bool FormFieldData::operator<(const FormFieldData& field) const { ...@@ -280,7 +280,7 @@ bool FormFieldData::operator<(const FormFieldData& field) const {
void SerializeFormFieldData(const FormFieldData& field_data, void SerializeFormFieldData(const FormFieldData& field_data,
base::Pickle* pickle) { base::Pickle* pickle) {
pickle->WriteInt(kPickleVersion); pickle->WriteInt(kFormFieldDataPickleVersion);
pickle->WriteString16(field_data.label); pickle->WriteString16(field_data.label);
pickle->WriteString16(field_data.name); pickle->WriteString16(field_data.name);
pickle->WriteString16(field_data.value); pickle->WriteString16(field_data.value);
......
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