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

Unified Diff: components/rappor/rappor_metric.cc

Issue 264123004: Modify rappor parameters. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/rappor/proto/rappor_metric.proto ('k') | components/rappor/rappor_metric_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/rappor/rappor_metric.cc
diff --git a/components/rappor/rappor_metric.cc b/components/rappor/rappor_metric.cc
index f8ff16252e232ddbdbd258e6f337ed20b3d124f2..b4bd950af9d1741210b81dcdf54bbd893b1b63b2 100644
--- a/components/rappor/rappor_metric.cc
+++ b/components/rappor/rappor_metric.cc
@@ -10,13 +10,15 @@ namespace rappor {
RapporMetric::RapporMetric(const std::string& metric_name,
const RapporParameters& parameters,
- int32_t cohort)
+ int32_t cohort_seed)
: metric_name_(metric_name),
parameters_(parameters),
bloom_filter_(parameters.bloom_filter_size_bytes,
parameters.bloom_filter_hash_function_count,
- cohort * parameters.bloom_filter_hash_function_count) {
- DCHECK_GE(cohort, 0);
+ (cohort_seed % parameters.num_cohorts) *
ulfar 2014/05/27 17:52:14 This is the only place where I see parameters.num_
Steven Holte 2014/05/27 17:58:42 Yes, it's reporting the seed, and we'll just aggre
+ parameters.bloom_filter_hash_function_count) {
+ DCHECK_GE(cohort_seed, 0);
+ DCHECK_LT(cohort_seed, RapporParameters::kMaxCohorts);
}
RapporMetric::~RapporMetric() {}
« no previous file with comments | « components/rappor/proto/rappor_metric.proto ('k') | components/rappor/rappor_metric_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698