Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_RAPPOR_RAPPOR_PREFS_H_ | |
| 6 #define COMPONENTS_RAPPOR_RAPPOR_PREFS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 | |
| 12 class PrefService; | |
| 13 class PrefRegistrySimple; | |
| 14 | |
| 15 namespace rappor { | |
| 16 | |
| 17 namespace internal { | |
| 18 | |
| 19 enum LoadResult { | |
| 20 LOAD_SUCCESS = 0, | |
| 21 LOAD_EMPTY_VALUE, | |
| 22 LOAD_CORRUPT_VALUE, | |
| 23 NUM_LOAD_RESULTS, | |
| 24 }; | |
| 25 | |
| 26 extern const char kLoadCohortHistogramName[]; | |
| 27 extern const char kLoadSecretHistogramName[]; | |
| 28 | |
| 29 // Registers all rappor preferences. | |
| 30 void RegisterPrefs(PrefRegistrySimple* registry); | |
| 31 | |
| 32 // Retrieves the cohort number this client was assigned to, generating it if | |
| 33 // doesn't already exist. The cohort should be persistent. | |
| 34 int32_t LoadCohort(PrefService* pref_service); | |
| 35 | |
| 36 // Retrieves the value for secret_ from preferences, generating it if doesn't | |
|
Alexei Svitkine (slow)
2015/01/14 21:45:38
Nit: What's |secret_|? Update comment.
Steven Holte
2015/01/14 23:25:12
Done.
| |
| 37 // already exist. The secret should be persistent, so that additional bits | |
| 38 // from the client do not get exposed over time. | |
| 39 std::string LoadSecret(PrefService* pref_service); | |
| 40 | |
| 41 } // namespace internal | |
| 42 | |
| 43 } // namespace rappor | |
| 44 | |
| 45 #endif // COMPONENTS_RAPPOR_RAPPOR_PREFS_H_ | |
| OLD | NEW |