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

Unified Diff: components/password_manager/core/browser/login_database.cc

Issue 1778423002: Don't upload "null" to the Sync server for empty federation_url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 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 | components/password_manager/core/browser/password_syncable_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/login_database.cc
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc
index 9e781d524e93eddb3106d53eb9a1289044143afa..897c155f69428e4f9db186137f7517e864128bff 100644
--- a/components/password_manager/core/browser/login_database.cc
+++ b/components/password_manager/core/browser/login_database.cc
@@ -141,7 +141,11 @@ void BindAddStatement(const PasswordForm& form,
s->BindInt64(COLUMN_DATE_SYNCED, form.date_synced.ToInternalValue());
s->BindString16(COLUMN_DISPLAY_NAME, form.display_name);
s->BindString(COLUMN_ICON_URL, form.icon_url.spec());
- s->BindString(COLUMN_FEDERATION_URL, form.federation_origin.Serialize());
+ // An empty Origin serializes as "null" which would be strange to store here.
+ s->BindString(COLUMN_FEDERATION_URL,
+ form.federation_origin.unique()
+ ? std::string()
+ : form.federation_origin.Serialize());
s->BindInt(COLUMN_SKIP_ZERO_CLICK, form.skip_zero_click);
s->BindInt(COLUMN_GENERATION_UPLOAD_STATUS, form.generation_upload_status);
}
@@ -941,8 +945,7 @@ PasswordStoreChangeList LoginDatabase::UpdateLogin(const PasswordForm& form) {
s.BindInt(11, form.type);
s.BindString16(12, form.display_name);
s.BindString(13, form.icon_url.spec());
- // We serialize unique origins as "", in order to make other systems that
- // read from the login database happy. https://crbug.com/591310
+ // An empty Origin serializes as "null" which would be strange to store here.
s.BindString(14, form.federation_origin.unique()
? std::string()
: form.federation_origin.Serialize());
« no previous file with comments | « no previous file | components/password_manager/core/browser/password_syncable_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698