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

Unified Diff: components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc

Issue 2663423002: [Sync] Incorporate value into USS AUTOFILL non_unique_name. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc
diff --git a/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc b/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc
index c5ce09b1a3cfff9dc4b994f15de04f3bd11c316a..c18292a288632bde3cf5cacb046e35bfb46bdd90 100644
--- a/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc
+++ b/components/autofill/core/browser/webdata/autocomplete_sync_bridge.cc
@@ -57,15 +57,21 @@ void* UserDataKey() {
return reinterpret_cast<void*>(&user_data_key);
}
+std::string EscapeIdentifiers(const AutofillSpecifics& specifics) {
+ return net::EscapePath(specifics.name()) +
+ std::string(kAutocompleteTagDelimiter) +
+ net::EscapePath(specifics.value());
+}
+
std::unique_ptr<EntityData> CreateEntityData(const AutofillEntry& entry) {
auto entity_data = base::MakeUnique<EntityData>();
- entity_data->non_unique_name = base::UTF16ToUTF8(entry.key().name());
AutofillSpecifics* autofill = entity_data->specifics.mutable_autofill();
autofill->set_name(base::UTF16ToUTF8(entry.key().name()));
autofill->set_value(base::UTF16ToUTF8(entry.key().value()));
autofill->add_usage_timestamp(entry.date_created().ToInternalValue());
if (entry.date_created() != entry.date_last_used())
autofill->add_usage_timestamp(entry.date_last_used().ToInternalValue());
+ entity_data->non_unique_name = EscapeIdentifiers(*autofill);
return entity_data;
}
@@ -450,11 +456,8 @@ void AutocompleteSyncBridge::LoadMetadata() {
std::string AutocompleteSyncBridge::GetClientTag(
const EntityData& entity_data) {
DCHECK(entity_data.specifics.has_autofill());
- const AutofillSpecifics specifics = entity_data.specifics.autofill();
return std::string(kAutocompleteEntryNamespaceTag) +
- net::EscapePath(specifics.name()) +
- std::string(kAutocompleteTagDelimiter) +
- net::EscapePath(specifics.value());
+ EscapeIdentifiers(entity_data.specifics.autofill());
}
std::string AutocompleteSyncBridge::GetStorageKey(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698