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

Unified Diff: sync/syncable/nigori_util.cc

Issue 10832286: sync: Introduce control data types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add ToFullModelTypeSet() function 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
« sync/internal_api/public/base/model_type.h ('K') | « sync/syncable/model_type.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/nigori_util.cc
diff --git a/sync/syncable/nigori_util.cc b/sync/syncable/nigori_util.cc
index 4b595164790f728047f0e85e174ee30aee134745..70cf41bfc5628a0c0934681fc6565a7e13cc9291 100644
--- a/sync/syncable/nigori_util.cc
+++ b/sync/syncable/nigori_util.cc
@@ -70,7 +70,7 @@ bool EntryNeedsEncryption(ModelTypeSet encrypted_types,
if (!entry.Get(UNIQUE_SERVER_TAG).empty())
return false; // We don't encrypt unique server nodes.
ModelType type = entry.GetModelType();
- if (type == PASSWORDS || type == NIGORI)
+ if (type == PASSWORDS || IsControlType(type))
return false;
// Checking NON_UNIQUE_NAME is not necessary for the correctness of encrypting
// the data, nor for determining if data is encrypted. We simply ensure it has
@@ -83,7 +83,7 @@ bool EntryNeedsEncryption(ModelTypeSet encrypted_types,
bool SpecificsNeedsEncryption(ModelTypeSet encrypted_types,
const sync_pb::EntitySpecifics& specifics) {
const ModelType type = GetModelTypeFromSpecifics(specifics);
- if (type == PASSWORDS || type == NIGORI)
+ if (type == PASSWORDS || IsControlType(type))
return false; // These types have their own encryption schemes.
if (!encrypted_types.Has(type))
return false; // This type does not require encryption
@@ -96,7 +96,7 @@ bool VerifyDataTypeEncryptionForTest(
ModelType type,
bool is_encrypted) {
Cryptographer* cryptographer = trans->directory()->GetCryptographer(trans);
- if (type == PASSWORDS || type == NIGORI) {
+ if (type == PASSWORDS || IsControlType(type)) {
NOTREACHED();
return true;
}
« sync/internal_api/public/base/model_type.h ('K') | « sync/syncable/model_type.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698