| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/variations/caching_permuted_entropy_provider.h" | 5 #include "components/variations/caching_permuted_entropy_provider.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/prefs/pref_registry_simple.h" | 11 #include "components/prefs/pref_registry_simple.h" |
| 12 #include "base/prefs/pref_service.h" | 12 #include "components/prefs/pref_service.h" |
| 13 #include "components/variations/pref_names.h" | 13 #include "components/variations/pref_names.h" |
| 14 | 14 |
| 15 namespace metrics { | 15 namespace metrics { |
| 16 | 16 |
| 17 CachingPermutedEntropyProvider::CachingPermutedEntropyProvider( | 17 CachingPermutedEntropyProvider::CachingPermutedEntropyProvider( |
| 18 PrefService* local_state, | 18 PrefService* local_state, |
| 19 uint16_t low_entropy_source, | 19 uint16_t low_entropy_source, |
| 20 size_t low_entropy_source_max) | 20 size_t low_entropy_source_max) |
| 21 : PermutedEntropyProvider(low_entropy_source, low_entropy_source_max), | 21 : PermutedEntropyProvider(low_entropy_source, low_entropy_source_max), |
| 22 local_state_(local_state) { | 22 local_state_(local_state) { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 for (int i = 0; i < cache_.entry_size(); ++i) { | 99 for (int i = 0; i < cache_.entry_size(); ++i) { |
| 100 if (cache_.entry(i).randomization_seed() == randomization_seed) { | 100 if (cache_.entry(i).randomization_seed() == randomization_seed) { |
| 101 *value = cache_.entry(i).value(); | 101 *value = cache_.entry(i).value(); |
| 102 return true; | 102 return true; |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 return false; | 105 return false; |
| 106 } | 106 } |
| 107 | 107 |
| 108 } // namespace metrics | 108 } // namespace metrics |
| OLD | NEW |