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

Side by Side Diff: components/variations/entropy_provider.cc

Issue 23097007: Create variations target that depends on base. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 3 months 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "chrome/common/metrics/entropy_provider.h" 5 #include "components/variations/entropy_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/rand_util.h" 12 #include "base/rand_util.h"
13 #include "base/sha1.h" 13 #include "base/sha1.h"
14 #include "base/sys_byteorder.h" 14 #include "base/sys_byteorder.h"
15 #include "chrome/common/metrics/metrics_util.h" 15 #include "components/variations/metrics_util.h"
16 16
17 namespace metrics { 17 namespace metrics {
18 18
19 namespace internal { 19 namespace internal {
20 20
21 SeededRandGenerator::SeededRandGenerator(uint32 seed) { 21 SeededRandGenerator::SeededRandGenerator(uint32 seed) {
22 mersenne_twister_.init_genrand(seed); 22 mersenne_twister_.init_genrand(seed);
23 } 23 }
24 24
25 SeededRandGenerator::~SeededRandGenerator() { 25 SeededRandGenerator::~SeededRandGenerator() {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 } 110 }
111 111
112 uint16 PermutedEntropyProvider::GetPermutedValue( 112 uint16 PermutedEntropyProvider::GetPermutedValue(
113 uint32 randomization_seed) const { 113 uint32 randomization_seed) const {
114 std::vector<uint16> mapping(low_entropy_source_max_); 114 std::vector<uint16> mapping(low_entropy_source_max_);
115 internal::PermuteMappingUsingRandomizationSeed(randomization_seed, &mapping); 115 internal::PermuteMappingUsingRandomizationSeed(randomization_seed, &mapping);
116 return mapping[low_entropy_source_]; 116 return mapping[low_entropy_source_];
117 } 117 }
118 118
119 } // namespace metrics 119 } // namespace metrics
OLDNEW
« no previous file with comments | « components/variations/entropy_provider.h ('k') | components/variations/entropy_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698