| Index: components/rappor/rappor.h
|
| diff --git a/components/rappor/rappor.h b/components/rappor/rappor.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f3ae408b33810c44274e0533c8248712ce60ba61
|
| --- /dev/null
|
| +++ b/components/rappor/rappor.h
|
| @@ -0,0 +1,61 @@
|
| +// 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.
|
| +
|
| +#ifndef CHROME_BROWSER_RAPPOR_RAPPOR_H_
|
| +#define CHROME_BROWSER_RAPPOR_RAPPOR_H_
|
| +
|
| +#include <assert.h>
|
| +#include <limits.h>
|
| +#include <math.h>
|
| +
|
| +#include <string>
|
| +#include <vector>
|
| +
|
| +#include "components/rappor/bloom_filter.h"
|
| +
|
| +// A Rappor is an object for collecting privacy preserving randomized reports.
|
| +// Samples are added to named metrics through the use of the RAPPOR_SAMPLE
|
| +// macro. Samples can be either individual strings, or a vector of strings.
|
| +
|
| +namespace rappor {
|
| +
|
| +class Rappor {
|
| + public:
|
| + Rappor(const std::string& name,
|
| + const uint32_t bytes_size,
|
| + const uint32_t hash_count,
|
| + const int fake_prob_index,
|
| + const int fake_one_prob_index,
|
| + const int one_honesty_prob_index,
|
| + const int zero_honesty_prob_index);
|
| +
|
| + void Add(const std::vector<std::string>& strings);
|
| +
|
| + void Add(const std::string& str);
|
| +
|
| + const ByteVector& GetBytes() const;
|
| +
|
| + const std::string& rappor_name() const;
|
| +
|
| + int fake_prob_index() const { return fake_prob_index_; }
|
| +
|
| + int fake_one_prob_index() const { return fake_one_prob_index_; }
|
| +
|
| + int one_honesty_prob_index() const { return one_honesty_prob_index_; }
|
| +
|
| + int zero_honesty_prob_index() const { return zero_honesty_prob_index_; }
|
| +
|
| + private:
|
| + const std::string rappor_name_;
|
| + BloomFilter bloom_;
|
| +
|
| + const int fake_prob_index_;
|
| + const int fake_one_prob_index_;
|
| + const int one_honesty_prob_index_;
|
| + const int zero_honesty_prob_index_;
|
| +};
|
| +
|
| +} // namespace rappor
|
| +
|
| +#endif // CHROME_BROWSER_RAPPOR_RAPPOR_H_
|
|
|