OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #include "components/rappor/rappor_prefs.h" | 5 #include "components/rappor/rappor_prefs.h" |
6 | 6 |
7 #include "base/base64.h" | 7 #include "base/base64.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/prefs/pref_registry_simple.h" | |
10 #include "base/prefs/pref_service.h" | |
11 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
12 #include "components/metrics/daily_event.h" | 10 #include "components/metrics/daily_event.h" |
| 11 #include "components/prefs/pref_registry_simple.h" |
| 12 #include "components/prefs/pref_service.h" |
13 #include "components/rappor/byte_vector_utils.h" | 13 #include "components/rappor/byte_vector_utils.h" |
14 #include "components/rappor/rappor_parameters.h" | 14 #include "components/rappor/rappor_parameters.h" |
15 #include "components/rappor/rappor_pref_names.h" | 15 #include "components/rappor/rappor_pref_names.h" |
16 | 16 |
17 namespace rappor { | 17 namespace rappor { |
18 | 18 |
19 namespace internal { | 19 namespace internal { |
20 | 20 |
21 const char kLoadCohortHistogramName[] = "Rappor.LoadCohortResult"; | 21 const char kLoadCohortHistogramName[] = "Rappor.LoadCohortResult"; |
22 const char kLoadSecretHistogramName[] = "Rappor.LoadSecretResult"; | 22 const char kLoadSecretHistogramName[] = "Rappor.LoadSecretResult"; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 DVLOG(2) << "Generated a new Rappor secret."; | 89 DVLOG(2) << "Generated a new Rappor secret."; |
90 secret = HmacByteVectorGenerator::GenerateEntropyInput(); | 90 secret = HmacByteVectorGenerator::GenerateEntropyInput(); |
91 base::Base64Encode(secret, &secret_base64); | 91 base::Base64Encode(secret, &secret_base64); |
92 pref_service->SetString(prefs::kRapporSecret, secret_base64); | 92 pref_service->SetString(prefs::kRapporSecret, secret_base64); |
93 return secret; | 93 return secret; |
94 } | 94 } |
95 | 95 |
96 } // namespace internal | 96 } // namespace internal |
97 | 97 |
98 } // namespace rappor | 98 } // namespace rappor |
OLD | NEW |