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

Unified Diff: sync/internal_api/write_node.cc

Issue 10844005: [Sync] Refactor GetEncryptedTypes usage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase + add dcheck Created 8 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 | « sync/internal_api/test/test_user_share.cc ('k') | sync/syncable/directory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/write_node.cc
diff --git a/sync/internal_api/write_node.cc b/sync/internal_api/write_node.cc
index 22d7e5f248b7d613813ffb51b6bd67837fad5c1b..c9d4755f1cfa6a3f2eb8e564a6c406f2050ceee3 100644
--- a/sync/internal_api/write_node.cc
+++ b/sync/internal_api/write_node.cc
@@ -42,10 +42,9 @@ void WriteNode::SetIsFolder(bool folder) {
void WriteNode::SetTitle(const std::wstring& title) {
DCHECK_NE(GetModelType(), UNSPECIFIED);
ModelType type = GetModelType();
- Cryptographer* cryptographer = GetTransaction()->GetCryptographer();
// It's possible the nigori lost the set of encrypted types. If the current
// specifics are already encrypted, we want to ensure we continue encrypting.
- bool needs_encryption = cryptographer->GetEncryptedTypes().Has(type) ||
+ bool needs_encryption = GetTransaction()->GetEncryptedTypes().Has(type) ||
entry_->Get(SPECIFICS).has_encrypted();
// If this datatype is encrypted and is not a bookmark, we disregard the
@@ -203,7 +202,6 @@ void WriteNode::SetEntitySpecifics(
if (GetModelType() != UNSPECIFIED) {
DCHECK_EQ(new_specifics_type, GetModelType());
}
- Cryptographer* cryptographer = GetTransaction()->GetCryptographer();
// Preserve unknown fields.
const sync_pb::EntitySpecifics& old_specifics = entry_->Get(SPECIFICS);
@@ -213,7 +211,9 @@ void WriteNode::SetEntitySpecifics(
old_specifics.unknown_fields());
// Will update the entry if encryption was necessary.
- if (!UpdateEntryWithEncryption(cryptographer, new_specifics, entry_)) {
+ if (!UpdateEntryWithEncryption(GetTransaction()->GetWrappedTrans(),
+ new_specifics,
+ entry_)) {
return;
}
if (entry_->Get(SPECIFICS).has_encrypted()) {
« no previous file with comments | « sync/internal_api/test/test_user_share.cc ('k') | sync/syncable/directory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698