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

Unified Diff: components/rappor/rappor_metric.h

Issue 419683014: Randomly select a single rappor sample when more than one is collected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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
Index: components/rappor/rappor_metric.h
diff --git a/components/rappor/rappor_metric.h b/components/rappor/rappor_metric.h
index 07f422ddf187a9fa67125a9333ed5b8d36c694ac..250701f25a919f5b63fe2fba1b1d165d68ea99c4 100644
--- a/components/rappor/rappor_metric.h
+++ b/components/rappor/rappor_metric.h
@@ -35,6 +35,7 @@ class RapporMetric {
~RapporMetric();
// Records an additional sample in the Bloom filter.
+ // A random sample will be used when reporting this metric.
void AddSample(const std::string& str);
// Retrieves the current Bloom filter bits.
@@ -48,9 +49,13 @@ class RapporMetric {
// final report bits.
ByteVector GetReport(const std::string& secret) const;
+ // Specify the bytes to generate a report from, for testing purposes.
+ void SetBytesForTesting(const ByteVector& bytes);
+
private:
const std::string metric_name_;
const RapporParameters parameters_;
+ uint32_t sample_count_;
BloomFilter bloom_filter_;
DISALLOW_COPY_AND_ASSIGN(RapporMetric);

Powered by Google App Engine
This is Rietveld 408576698