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

Unified Diff: components/sync/driver/generic_change_processor.cc

Issue 2285753002: Passing correct passhprase type in the generic change processor. (Closed)
Patch Set: 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/base_transaction.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/driver/generic_change_processor.cc
diff --git a/components/sync/driver/generic_change_processor.cc b/components/sync/driver/generic_change_processor.cc
index 55a17325d18ead37034da47b75e598c5fdce43ef..cc5b4bebd8f254704c06ac9ad252d29b8b0ca352 100644
--- a/components/sync/driver/generic_change_processor.cc
+++ b/components/sync/driver/generic_change_processor.cc
@@ -37,14 +37,14 @@ namespace {
const int kContextSizeLimit = 1024; // Datatype context size limit.
void SetNodeSpecifics(const sync_pb::EntitySpecifics& entity_specifics,
- syncer::WriteNode* write_node) {
+ syncer::WriteNode* write_node,
+ syncer::PassphraseType passphrase_type) {
if (syncer::GetModelTypeFromSpecifics(entity_specifics) ==
syncer::PASSWORDS) {
write_node->SetPasswordSpecifics(
entity_specifics.password().client_only_encrypted_data(),
- // TODO(melandory): Since PasswordsSpecifics care about passphrase type.
- // the real value should be passed here.
- syncer::PassphraseType::UNDEFINED);
+ passphrase_type);
+
} else {
write_node->SetEntitySpecifics(entity_specifics);
}
@@ -557,8 +557,13 @@ syncer::SyncError GenericChangeProcessor::HandleActionAdd(
}
}
}
+ syncer::PassphraseType passphrase_type = syncer::PassphraseType::UNDEFINED;
+ {
+ syncer::ReadTransaction trans(FROM_HERE, share_handle());
+ passphrase_type = trans.GetPassphraseType();
+ }
sync_node->SetTitle(change.sync_data().GetTitle());
- SetNodeSpecifics(sync_data_local.GetSpecifics(), sync_node);
+ SetNodeSpecifics(sync_data_local.GetSpecifics(), sync_node,passphrase_type) ;
syncer::AttachmentIdList attachment_ids = sync_data_local.GetAttachmentIds();
SetAttachmentMetadata(attachment_ids, sync_node);
@@ -620,9 +625,13 @@ syncer::SyncError GenericChangeProcessor::HandleActionUpdate(
return error;
}
}
-
+ syncer::PassphraseType passphrase_type = syncer::PassphraseType::UNDEFINED;
+ {
+ syncer::ReadTransaction trans(FROM_HERE, share_handle());
+ passphrase_type = trans.GetPassphraseType();
+ }
sync_node->SetTitle(change.sync_data().GetTitle());
- SetNodeSpecifics(sync_data_local.GetSpecifics(), sync_node);
+ SetNodeSpecifics(sync_data_local.GetSpecifics(), sync_node, passphrase_type);
syncer::AttachmentIdList attachment_ids = sync_data_local.GetAttachmentIds();
SetAttachmentMetadata(attachment_ids, sync_node);
« no previous file with comments | « components/sync/core/base_transaction.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698