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

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

Issue 2278333002: Supplimentary identifier for passwords specific (Closed)
Patch Set: cleanup Created 4 years, 4 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 | « components/sync/core/write_node.h ('k') | components/sync/core_impl/sync_encryption_handler_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..db818f2e172e4dfd7291d4e663a73e2b65bffd07 100644
--- a/components/sync/core/write_node.cc
+++ b/components/sync/core/write_node.cc
@@ -117,8 +117,8 @@ void WriteNode::SetNigoriSpecifics(const sync_pb::NigoriSpecifics& new_value) {
SetEntitySpecifics(entity_specifics);
}
-void WriteNode::SetPasswordSpecifics(
- const sync_pb::PasswordSpecificsData& data) {
+void WriteNode::SetPasswordSpecifics(const sync_pb::PasswordSpecificsData& data,
+ PassphraseType passphrase_type) {
DCHECK_EQ(GetModelType(), PASSWORDS);
Cryptographer* cryptographer = GetTransaction()->GetCryptographer();
@@ -143,10 +143,15 @@ void WriteNode::SetPasswordSpecifics(
<< "corruption";
return;
}
- SetEntitySpecifics(entity_specifics);
+ SetEntitySpecifics(entity_specifics, passphrase_type);
}
void WriteNode::SetEntitySpecifics(const sync_pb::EntitySpecifics& new_value) {
+ SetEntitySpecifics(new_value, PassphraseType::UNDEFINED);
+}
+
+void WriteNode::SetEntitySpecifics(const sync_pb::EntitySpecifics& new_value,
+ PassphraseType passphrase_type) {
ModelType new_specifics_type = GetModelTypeFromSpecifics(new_value);
CHECK(!new_value.password().has_client_only_encrypted_data());
DCHECK_NE(new_specifics_type, UNSPECIFIED);
@@ -163,7 +168,7 @@ void WriteNode::SetEntitySpecifics(const sync_pb::EntitySpecifics& new_value) {
// Will update the entry if encryption was necessary.
if (!UpdateEntryWithEncryption(GetTransaction()->GetWrappedTrans(),
Nicolas Zea 2016/08/26 18:28:30 Given you have access to the transaction now, I do
melandory 2016/08/26 23:16:59 Oh, definitelly! Fixed and updated CL https://cod
- new_specifics, entry_)) {
+ new_specifics, entry_, passphrase_type)) {
return;
}
if (entry_->GetSpecifics().has_encrypted()) {
« no previous file with comments | « components/sync/core/write_node.h ('k') | components/sync/core_impl/sync_encryption_handler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698