OLD | NEW |
(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::AddSamples(const std::vector<std::string>& strings) { |
| 24 bloom_.AddStrings(strings); |
| 25 } |
| 26 |
| 27 void Rappor::AddSample(const std::string& str) { bloom_.AddString(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 |
OLD | NEW |