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

Unified Diff: components/rappor/rappor.cc

Issue 49753002: RAPPOR implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years 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.cc
diff --git a/components/rappor/rappor.cc b/components/rappor/rappor.cc
new file mode 100644
index 0000000000000000000000000000000000000000..5aa62b511a68e792db4d6b4dd40a52af8b1afa5b
--- /dev/null
+++ b/components/rappor/rappor.cc
@@ -0,0 +1,22 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/rappor/rappor.h"
+
+namespace rappor {
+
+Rappor::Rappor(const RapporParameters* parameters)
+ : parameters_(parameters),
+ bloom_(parameters->bloom_filter_size_bytes,
+ parameters->bloom_filter_hash_count) {}
+
+void Rappor::AddSamples(const std::vector<std::string>& strings) {
+ bloom_.AddStrings(strings);
+}
+
+void Rappor::AddSample(const std::string& str) { bloom_.AddString(str); }
+
+const ByteVector& Rappor::GetBytes() const { return bloom_.bytes(); }
+
+} // namespace rappor

Powered by Google App Engine
This is Rietveld 408576698