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

Unified Diff: components/rappor/sample.h

Issue 1090683003: Alternative Multi-dimensional Rappor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months 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/sample.h
diff --git a/components/rappor/sample.h b/components/rappor/sample.h
new file mode 100644
index 0000000000000000000000000000000000000000..69cd62c16c8c1a71b908a1a32e32da034fe83bd0
--- /dev/null
+++ b/components/rappor/sample.h
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
Alexei Svitkine (slow) 2015/04/16 15:09:43 2015. Fix throughout.
Steven Holte 2015/04/22 19:24:28 Done.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_RAPPOR_SAMPLE_H_
+#define COMPONENTS_RAPPOR_SAMPLE_H_
+
+#include <map>
+#include <string>
+
+#include "base/macros.h"
+#include "components/rappor/rappor_parameters.h"
+
+namespace rappor {
+
+class RapporReports;
+
+class Sample {
Alexei Svitkine (slow) 2015/04/16 15:09:43 Comment.
Steven Holte 2015/04/22 19:24:28 Done.
+ public:
+ Sample(int32_t cohort_seed, const RapporParameters& parameters);
+ ~Sample();
+
+ void SetStringField(const std::string& fieldName, const std::string& value);
Alexei Svitkine (slow) 2015/04/16 15:09:43 Nit: field_name
Steven Holte 2015/04/22 19:24:28 Done.
+ void SetFlagsField(const std::string& fieldName, uint64_t flags);
+
+ void ExportMetrics(const std::string& secret,
+ const std::string& metricName,
Alexei Svitkine (slow) 2015/04/16 15:09:43 metric_name
Steven Holte 2015/04/22 19:24:28 Done.
+ RapporReports* reports) const;
+
+ const RapporParameters& parameters() { return parameters_; }
+
+ private:
+ const RapporParameters parameters_;
+ uint32_t bloom_offset_;
+ std::map<std::string, size_t> sizes;
Alexei Svitkine (slow) 2015/04/16 15:09:43 sizes_
Steven Holte 2015/04/22 19:24:28 Done.
+ std::map<std::string, uint64_t> fields;
Alexei Svitkine (slow) 2015/04/16 15:09:43 fields_
Steven Holte 2015/04/22 19:24:28 Done.
+ DISALLOW_COPY_AND_ASSIGN(Sample);
Alexei Svitkine (slow) 2015/04/16 15:09:43 Empty line before.
Steven Holte 2015/04/22 19:24:28 Done.
+};
+
+} // namespace rappor
+
+#endif // COMPONENTS_RAPPOR_SAMPLE_H_

Powered by Google App Engine
This is Rietveld 408576698