Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_ | |
| 6 #define COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_ | |
| 7 | |
| 8 #include <ostream> | |
| 9 #include <string> | |
| 10 | |
| 11 namespace rappor { | |
| 12 | |
| 13 enum Probability { | |
| 14 PROBABILITY_75, // 75% | |
| 15 PROBABILITY_50, // 50% | |
| 16 }; | |
| 17 | |
| 18 // An object describing a rappor metric and the parameters used to generate it. | |
| 19 // | |
| 20 // For a full description of the rappor metrics, see | |
| 21 // http://www.chromium.org/developers/design-documents/rappor | |
| 22 struct RapporParameters { | |
| 23 // The name of the metric. | |
| 24 std::string rappor_name; | |
| 25 | |
| 26 // The number of bytes stored in the Bloom filter. | |
| 27 int bloom_filter_size_bytes; | |
| 28 // The number of hash functions used in the Bloom filter. | |
| 29 int bloom_filter_hash_function_count; | |
| 30 | |
| 31 // The probability that a bit will be redacted with fake data. | |
| 32 Probability fake_prob; | |
| 33 // The probability that a fake bit will be a one. | |
| 34 Probability fake_one_prob; | |
| 35 | |
| 36 // The probability that a one bit in the redacted data reports as one. | |
| 37 Probability one_coin_prob; | |
| 38 // The probability that a zero bit in the redacted data reports as one. | |
| 39 Probability zero_coin_prob; | |
| 40 }; | |
| 41 | |
| 42 std::ostream& operator<<(std::ostream& out, const RapporParameters& rhs); | |
|
Alexei Svitkine (slow)
2014/01/21 18:14:04
Generally, operator overloads are discouraged. I'd
Steven Holte
2014/01/21 20:25:14
These only exist to make DCHECK_EQ work and I've a
Alexei Svitkine (slow)
2014/01/21 20:30:39
How about just doing DCHECK_EQ() on ToString() res
Steven Holte
2014/01/21 21:05:32
Done.
| |
| 43 | |
| 44 bool operator==(const RapporParameters& lhs, const RapporParameters& rhs); | |
| 45 | |
| 46 } // namespace rappor | |
| 47 | |
| 48 #endif // COMPONENTS_RAPPOR_RAPPOR_PARAMETERS_H_ | |
| OLD | NEW |