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

Unified Diff: components/sync/core/write_node.cc

Issue 2294913009: Fill the un-encrypted metadata field in password specifics. (Closed)
Patch Set: check Created 4 years, 3 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
Index: components/sync/core/write_node.cc
diff --git a/components/sync/core/write_node.cc b/components/sync/core/write_node.cc
index 0977234702cbce013978ddd190d8df1375a17d00..a8b77ea76ae1d31cb7bb4adad110f3272298b138 100644
--- a/components/sync/core/write_node.cc
+++ b/components/sync/core/write_node.cc
@@ -11,6 +11,7 @@
#include "base/values.h"
#include "components/sync/base/cryptographer.h"
#include "components/sync/core/base_transaction.h"
+#include "components/sync/core/password_metadata_filling.h"
#include "components/sync/core/write_transaction.h"
#include "components/sync/core_impl/syncapi_internal.h"
#include "components/sync/protocol/bookmark_specifics.pb.h"
@@ -136,6 +137,13 @@ void WriteNode::SetPasswordSpecifics(
}
sync_pb::PasswordSpecifics* password_specifics =
entity_specifics.mutable_password();
+
+ const std::string metadata_url(data.signon_realm());
+ if (!IsExplicitPassphrase(GetTransaction()->GetPassphraseType()) &&
+ base::FeatureList::IsEnabled(kPasswordsMetadataFilling) &&
+ password_specifics->unencrypted_metadata().url() != metadata_url) {
+ password_specifics->mutable_unencrypted_metadata()->set_url(metadata_url);
+ }
Nicolas Zea 2016/09/23 23:10:37 nit: newline after
melandory 2016/10/04 10:13:12 Done.
// This will only update password_specifics if the underlying unencrypted blob
// was different from |data| or was not encrypted with the proper passphrase.
if (!cryptographer->Encrypt(data, password_specifics->mutable_encrypted())) {

Powered by Google App Engine
This is Rietveld 408576698