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

Side by Side Diff: sync/internal_api/public/sync_encryption_handler.h

Issue 779093002: Add the Sync.PassphraseType histogram. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | sync/internal_api/sync_encryption_handler_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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_INTERNAL_API_PUBLIC_SYNC_ENCRYPTION_HANDLER_H_ 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SYNC_ENCRYPTION_HANDLER_H_
6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_ENCRYPTION_HANDLER_H_ 6 #define SYNC_INTERNAL_API_PUBLIC_SYNC_ENCRYPTION_HANDLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 14 matching lines...) Expand all
25 REASON_ENCRYPTION = 1, // The cryptographer requires a 25 REASON_ENCRYPTION = 1, // The cryptographer requires a
26 // passphrase for its first attempt at 26 // passphrase for its first attempt at
27 // encryption. Happens only during 27 // encryption. Happens only during
28 // migration or upgrade. 28 // migration or upgrade.
29 REASON_DECRYPTION = 2, // The cryptographer requires a 29 REASON_DECRYPTION = 2, // The cryptographer requires a
30 // passphrase for its first attempt at 30 // passphrase for its first attempt at
31 // decryption. 31 // decryption.
32 }; 32 };
33 33
34 // The different states for the encryption passphrase. These control if and how 34 // The different states for the encryption passphrase. These control if and how
35 // the user should be prompted for a decryption passphrase. 35 // the user should be prompted for a decryption passphrase.
Alexei Svitkine (slow) 2014/12/04 19:57:06 Nit: Add a note not to re-order or delete entries,
maxbogue 2014/12/04 21:14:24 Done.
36 enum PassphraseType { 36 enum PassphraseType {
37 IMPLICIT_PASSPHRASE = 0, // GAIA-based passphrase (deprecated). 37 IMPLICIT_PASSPHRASE = 0, // GAIA-based passphrase (deprecated).
38 KEYSTORE_PASSPHRASE = 1, // Keystore passphrase. 38 KEYSTORE_PASSPHRASE = 1, // Keystore passphrase.
39 FROZEN_IMPLICIT_PASSPHRASE = 2, // Frozen GAIA passphrase. 39 FROZEN_IMPLICIT_PASSPHRASE = 2, // Frozen GAIA passphrase.
40 CUSTOM_PASSPHRASE = 3, // User-provided passphrase. 40 CUSTOM_PASSPHRASE = 3, // User-provided passphrase.
41 }; 41 };
42 42
43 const int PASSPHRASE_TYPE_SIZE = 4;
Alexei Svitkine (slow) 2014/12/04 19:57:06 Usually, this is put inside the enum at the end, s
maxbogue 2014/12/04 21:14:24 I thought about doing that, but it might affect co
Nicolas Zea 2014/12/05 00:53:19 I'm fine with adding a NUM_PASSPHRASE_TYPES enum,
maxbogue 2014/12/05 18:58:59 Done. It all compiled.
44
43 // Enum used to distinguish which bootstrap encryption token is being updated. 45 // Enum used to distinguish which bootstrap encryption token is being updated.
44 enum BootstrapTokenType { 46 enum BootstrapTokenType {
45 PASSPHRASE_BOOTSTRAP_TOKEN, 47 PASSPHRASE_BOOTSTRAP_TOKEN,
46 KEYSTORE_BOOTSTRAP_TOKEN 48 KEYSTORE_BOOTSTRAP_TOKEN
47 }; 49 };
48 50
49 // Sync's encryption handler. Handles tracking encrypted types, ensuring the 51 // Sync's encryption handler. Handles tracking encrypted types, ensuring the
50 // cryptographer encrypts with the proper key and has the most recent keybag, 52 // cryptographer encrypts with the proper key and has the most recent keybag,
51 // and keeps the nigori node up to date. 53 // and keeps the nigori node up to date.
52 // Implementations of this class must be assumed to be non-thread-safe. All 54 // Implementations of this class must be assumed to be non-thread-safe. All
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 // bag of encryption keys in the nigori node. 170 // bag of encryption keys in the nigori node.
169 virtual PassphraseType GetPassphraseType() const = 0; 171 virtual PassphraseType GetPassphraseType() const = 0;
170 172
171 // The set of types that are always encrypted. 173 // The set of types that are always encrypted.
172 static ModelTypeSet SensitiveTypes(); 174 static ModelTypeSet SensitiveTypes();
173 }; 175 };
174 176
175 } // namespace syncer 177 } // namespace syncer
176 178
177 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_ENCRYPTION_HANDLER_H_ 179 #endif // SYNC_INTERNAL_API_PUBLIC_SYNC_ENCRYPTION_HANDLER_H_
OLDNEW
« no previous file with comments | « no previous file | sync/internal_api/sync_encryption_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698