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

Unified Diff: chrome/browser/password_manager/native_backend_gnome_x.cc

Issue 980583002: Serialize form_data in Gnome keyring password store service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style fix Created 5 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 | chrome/browser/password_manager/native_backend_gnome_x_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/password_manager/native_backend_gnome_x.cc
diff --git a/chrome/browser/password_manager/native_backend_gnome_x.cc b/chrome/browser/password_manager/native_backend_gnome_x.cc
index 1d30df71f3a5f3e014d5605c02ee832fb3e5c781..f5d2b15aa5eebcadb8c74823f8a08d866b15a29f 100644
--- a/chrome/browser/password_manager/native_backend_gnome_x.cc
+++ b/chrome/browser/password_manager/native_backend_gnome_x.cc
@@ -158,7 +158,8 @@ scoped_ptr<PasswordForm> FormFromAttributes(GnomeKeyringAttributeList* attrs) {
form->generation_upload_status =
static_cast<PasswordForm::GenerationUploadStatus>(
uint_attr_map["generation_upload_status"]);
-
+ DeserializeFormDataFromBase64String(string_attr_map["form_data"],
+ &form->form_data);
return form.Pass();
}
@@ -220,11 +221,6 @@ void ConvertFormList(GList* found,
}
// Schema is analagous to the fields in PasswordForm.
-// TODO(gcasto): Adding 'form_data' would be nice, but we would need to
-// serialize in a way that is guaranteed to not have any embedded NULLs. Pickle
-// doesn't make this guarantee, so we just don't serialize this field. Since
-// it's only used to crowd source data collection it doesn't matter that much
-// if it's not available on this platform.
const GnomeKeyringPasswordSchema kGnomeSchema = {
GNOME_KEYRING_ITEM_GENERIC_SECRET, {
{ "origin_url", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
@@ -247,6 +243,7 @@ const GnomeKeyringPasswordSchema kGnomeSchema = {
{ "federation_url", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
{ "skip_zero_click", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 },
{ "generation_upload_status", GNOME_KEYRING_ATTRIBUTE_TYPE_UINT32 },
+ { "form_data", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
// This field is always "chrome" so that we can search for it.
{ "application", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING },
{ nullptr }
@@ -339,6 +336,8 @@ void GKRMethod::AddLogin(const PasswordForm& form, const char* app_string) {
if (!date_created)
date_created = base::Time::Now().ToInternalValue();
int64 date_synced = form.date_synced.ToInternalValue();
+ std::string form_data;
+ SerializeFormDataToBase64String(form.form_data, &form_data);
gnome_keyring_store_password(
&kGnomeSchema,
nullptr, // Default keyring.
@@ -367,6 +366,7 @@ void GKRMethod::AddLogin(const PasswordForm& form, const char* app_string) {
"federation_url", form.federation_url.spec().c_str(),
"skip_zero_click", form.skip_zero_click,
"generation_upload_status", form.generation_upload_status,
+ "form_data", form_data.c_str(),
"application", app_string,
nullptr);
}
« no previous file with comments | « no previous file | chrome/browser/password_manager/native_backend_gnome_x_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698