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

Side by Side Diff: components/rappor/rappor.cc

Issue 49753002: RAPPOR implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BrowserProcess member 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 #include "components/rappor/rappor.h"
6
7 namespace rappor {
8
9 Rappor::Rappor(const std::string& name,
10 const uint32_t bytes_size,
11 const uint32_t hash_count,
12 const int fake_prob_index,
13 const int fake_one_prob_index,
14 const int one_honesty_prob_index,
15 const int zero_honesty_prob_index)
16 : rappor_name_(name),
17 bloom_(bytes_size, hash_count),
18 fake_prob_index_(fake_prob_index),
19 fake_one_prob_index_(fake_one_prob_index),
20 one_honesty_prob_index_(one_honesty_prob_index),
21 zero_honesty_prob_index_(zero_honesty_prob_index) {}
22
23 void Rappor::Add(const std::vector<std::string>& strings) {
24 bloom_.Add(strings);
25 }
26
27 void Rappor::Add(const std::string& str) { bloom_.Add(str); }
28
29 const ByteVector& Rappor::GetBytes() const { return bloom_.bytes(); }
30
31 const std::string& Rappor::rappor_name() const { return rappor_name_; }
32
33 } // namespace rappor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698