| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SYNC_UTIL_CRYPTOGRAPHER_H_ | 5 #ifndef SYNC_UTIL_CRYPTOGRAPHER_H_ |
| 6 #define SYNC_UTIL_CRYPTOGRAPHER_H_ | 6 #define SYNC_UTIL_CRYPTOGRAPHER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 void set_encrypt_everything(); | 212 void set_encrypt_everything(); |
| 213 bool encrypt_everything() const; | 213 bool encrypt_everything() const; |
| 214 | 214 |
| 215 // Return the set of encrypted types. | 215 // Return the set of encrypted types. |
| 216 ModelTypeSet GetEncryptedTypes() const; | 216 ModelTypeSet GetEncryptedTypes() const; |
| 217 | 217 |
| 218 // Forwards to MergeEncryptedTypes. | 218 // Forwards to MergeEncryptedTypes. |
| 219 void MergeEncryptedTypesForTest(ModelTypeSet encrypted_types); | 219 void MergeEncryptedTypesForTest(ModelTypeSet encrypted_types); |
| 220 | 220 |
| 221 private: | 221 private: |
| 222 FRIEND_TEST_ALL_PREFIXES(SyncCryptographerTest, PackUnpack); | 222 FRIEND_TEST_ALL_PREFIXES(CryptographerTest, PackUnpack); |
| 223 typedef std::map<std::string, linked_ptr<const Nigori> > NigoriMap; | 223 typedef std::map<std::string, linked_ptr<const Nigori> > NigoriMap; |
| 224 | 224 |
| 225 // Merges the given set of encrypted types with the existing set and emits a | 225 // Merges the given set of encrypted types with the existing set and emits a |
| 226 // notification if necessary. | 226 // notification if necessary. |
| 227 void MergeEncryptedTypes(ModelTypeSet encrypted_types); | 227 void MergeEncryptedTypes(ModelTypeSet encrypted_types); |
| 228 | 228 |
| 229 void EmitEncryptedTypesChangedNotification(); | 229 void EmitEncryptedTypesChangedNotification(); |
| 230 | 230 |
| 231 // Decrypts |encrypted| and uses its contents to initialize Nigori instances. | 231 // Decrypts |encrypted| and uses its contents to initialize Nigori instances. |
| 232 // Returns true unless decryption of |encrypted| fails. The caller is | 232 // Returns true unless decryption of |encrypted| fails. The caller is |
| (...skipping 27 matching lines...) Expand all Loading... |
| 260 | 260 |
| 261 ModelTypeSet encrypted_types_; | 261 ModelTypeSet encrypted_types_; |
| 262 bool encrypt_everything_; | 262 bool encrypt_everything_; |
| 263 | 263 |
| 264 DISALLOW_COPY_AND_ASSIGN(Cryptographer); | 264 DISALLOW_COPY_AND_ASSIGN(Cryptographer); |
| 265 }; | 265 }; |
| 266 | 266 |
| 267 } // namespace syncer | 267 } // namespace syncer |
| 268 | 268 |
| 269 #endif // SYNC_UTIL_CRYPTOGRAPHER_H_ | 269 #endif // SYNC_UTIL_CRYPTOGRAPHER_H_ |
| OLD | NEW |