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

Side by Side Diff: chrome/browser/sync/util/cryptographer.h

Issue 8564032: [Sync] The cryptographer should be able to handle empty or old nigori nodes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_UTIL_CRYPTOGRAPHER_H_ 5 #ifndef CHROME_BROWSER_SYNC_UTIL_CRYPTOGRAPHER_H_
6 #define CHROME_BROWSER_SYNC_UTIL_CRYPTOGRAPHER_H_ 6 #define CHROME_BROWSER_SYNC_UTIL_CRYPTOGRAPHER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // Setter/getter for whether all current and future datatypes should 175 // Setter/getter for whether all current and future datatypes should
176 // be encrypted. Once set you cannot unset without reading from a 176 // be encrypted. Once set you cannot unset without reading from a
177 // new nigori node. set_encrypt_everything() emits a notification 177 // new nigori node. set_encrypt_everything() emits a notification
178 // the first time it's called. 178 // the first time it's called.
179 void set_encrypt_everything(); 179 void set_encrypt_everything();
180 bool encrypt_everything() const; 180 bool encrypt_everything() const;
181 181
182 // Return the set of encrypted types. 182 // Return the set of encrypted types.
183 syncable::ModelTypeSet GetEncryptedTypes() const; 183 syncable::ModelTypeSet GetEncryptedTypes() const;
184 184
185 // Forwards to SetEncryptedTypes. 185 // Forwards to MergeEncryptedTypes.
186 void SetEncryptedTypesForTest( 186 void MergeEncryptedTypesForTest(
187 const syncable::ModelTypeSet& encrypted_types); 187 const syncable::ModelTypeSet& encrypted_types);
188 188
189 private: 189 private:
190 FRIEND_TEST_ALL_PREFIXES(CryptographerTest, PackUnpack); 190 FRIEND_TEST_ALL_PREFIXES(CryptographerTest, PackUnpack);
191 typedef std::map<std::string, linked_ptr<const Nigori> > NigoriMap; 191 typedef std::map<std::string, linked_ptr<const Nigori> > NigoriMap;
192 192
193 // Changes the set of encrypted types and emits a notification if 193 // Changes the set of encrypted types and emits a notification if
akalin 2011/11/17 11:29:18 Update comment, maybe: // Merges the given set wi
Nicolas Zea 2011/11/17 19:03:16 Done.
194 // necessary. 194 // necessary.
195 void SetEncryptedTypes(const syncable::ModelTypeSet& encrypted_types); 195 void MergeEncryptedTypes(const syncable::ModelTypeSet& encrypted_types);
196 196
197 void EmitEncryptedTypesChangedNotification(); 197 void EmitEncryptedTypesChangedNotification();
198 198
199 // Helper method to instantiate Nigori instances for each set of key 199 // Helper method to instantiate Nigori instances for each set of key
200 // parameters in |bag| and setting the default encryption key to 200 // parameters in |bag| and setting the default encryption key to
201 // |default_key_name|. 201 // |default_key_name|.
202 void InstallKeys(const std::string& default_key_name, 202 void InstallKeys(const std::string& default_key_name,
203 const sync_pb::NigoriKeyBag& bag); 203 const sync_pb::NigoriKeyBag& bag);
204 204
205 bool AddKeyImpl(Nigori* nigori); 205 bool AddKeyImpl(Nigori* nigori);
(...skipping 12 matching lines...) Expand all
218 218
219 syncable::ModelTypeSet encrypted_types_; 219 syncable::ModelTypeSet encrypted_types_;
220 bool encrypt_everything_; 220 bool encrypt_everything_;
221 221
222 DISALLOW_COPY_AND_ASSIGN(Cryptographer); 222 DISALLOW_COPY_AND_ASSIGN(Cryptographer);
223 }; 223 };
224 224
225 } // namespace browser_sync 225 } // namespace browser_sync
226 226
227 #endif // CHROME_BROWSER_SYNC_UTIL_CRYPTOGRAPHER_H_ 227 #endif // CHROME_BROWSER_SYNC_UTIL_CRYPTOGRAPHER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/util/cryptographer.cc » ('j') | chrome/browser/sync/util/cryptographer_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698