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 // Change for readability |
| 6 |
5 #include "components/rappor/rappor_metric.h" | 7 #include "components/rappor/rappor_metric.h" |
6 | 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 | 10 |
9 namespace rappor { | 11 namespace rappor { |
10 | 12 |
11 RapporMetric::RapporMetric(const std::string& metric_name, | 13 RapporMetric::RapporMetric(const std::string& metric_name, |
12 const RapporParameters& parameters, | 14 const RapporParameters& parameters, |
13 int32_t cohort) | 15 int32_t cohort) |
14 : metric_name_(metric_name), | 16 : metric_name_(metric_name), |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 ByteVector one_coins = | 53 ByteVector one_coins = |
52 coin_generator.GetWeightedRandomByteVector(parameters().one_coin_prob); | 54 coin_generator.GetWeightedRandomByteVector(parameters().one_coin_prob); |
53 | 55 |
54 // Create a randomized response report on the fake and redacted data, sending | 56 // Create a randomized response report on the fake and redacted data, sending |
55 // the outcome of flipping a zero coin for the zero bits in that data, and of | 57 // the outcome of flipping a zero coin for the zero bits in that data, and of |
56 // flipping a one coin for the one bits in that data, as the final report. | 58 // flipping a one coin for the one bits in that data, as the final report. |
57 return *ByteVectorMerge(*fake_and_redacted_bits, zero_coins, &one_coins); | 59 return *ByteVectorMerge(*fake_and_redacted_bits, zero_coins, &one_coins); |
58 } | 60 } |
59 | 61 |
60 } // namespace rappor | 62 } // namespace rappor |
OLD | NEW |