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

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

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 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 #ifndef COMPONENTS_RAPPOR_RAPPOR_H_
6 #define COMPONENTS_RAPPOR_RAPPOR_H_
7
8 #include <assert.h>
9 #include <limits.h>
10 #include <math.h>
11
12 #include <string>
13 #include <vector>
14
15 #include "components/rappor/bloom_filter.h"
16 #include "components/rappor/rappor_parameters.h"
17
18 // A Rappor is an object for collecting privacy preserving randomized reports.
19 // Samples are added to named metrics through the use of the RAPPOR_SAMPLE
20 // macro. Samples can be either individual strings, or a vector of strings.
21
22 namespace rappor {
23
24 // A class that maintains parameters and bloom filter data for a Rappor Metric.
Alexei Svitkine (slow) 2013/12/19 19:47:02 Maybe it should be called RapporMetric? Rappor by
Steven Holte 2013/12/20 03:03:55 I'll pick this up in the next pass.
Steven Holte 2013/12/20 23:36:04 Done.
25 //
26 // For a full description of the rappor metrics, see
27 // http://www.chromium.org/developers/design-documents/rappor
28 class Rappor {
29 public:
30 Rappor(const RapporParameters* parameters);
31
32 // Record additional samples in the bloom filter.
33 void AddSamples(const std::vector<std::string>& strings);
34 void AddSample(const std::string& str);
35
36 // Retrieves the current bloom filter bits.
37 const ByteVector& GetBytes() const;
38 const RapporParameters* parameters() const { return parameters_; }
39
40 private:
41 const RapporParameters* parameters_;
42 BloomFilter bloom_;
43 };
Alexei Svitkine (slow) 2013/12/19 19:47:02 Nit: DISALLOW_COPY_AND_ASSIGN
Steven Holte 2013/12/20 03:03:55 Done.
44
45 } // namespace rappor
46
47 #endif // COMPONENTS_RAPPOR_RAPPOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698