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

Unified Diff: components/rappor/bloom_filter.cc

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/bloom_filter.cc
diff --git a/components/rappor/bloom_filter.cc b/components/rappor/bloom_filter.cc
index d3f9e6339328714bc301237173e4f93baee96fee..45c7dc2523542b1e3f9874ce8a4f9eaa6a287182 100644
--- a/components/rappor/bloom_filter.cc
+++ b/components/rappor/bloom_filter.cc
@@ -33,4 +33,17 @@ void BloomFilter::AddString(const std::string& str) {
}
}
+void BloomFilter::Clear() {
+ for (size_t i = 0; i < bytes_.size(); ++i) {
+ bytes_[i] = 0;
+ }
+}
+
+void BloomFilter::SetBytesForTesting(const ByteVector& bytes) {
+ DCHECK_EQ(bytes.size(), bytes_.size());
Alexei Svitkine (slow) 2014/07/30 17:12:47 Nit: Swap params (expected size should be on the l
Steven Holte 2014/08/04 23:30:26 Done.
+ for (size_t i = 0; i < bytes_.size(); ++i) {
+ bytes_[i] = bytes[i];
+ }
+}
+
} // namespace rappor

Powered by Google App Engine
This is Rietveld 408576698