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

Unified Diff: components/rappor/bytevector.h

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 side-by-side diff with in-line comments
Download patch
Index: components/rappor/bytevector.h
diff --git a/components/rappor/bytevector.h b/components/rappor/bytevector.h
new file mode 100644
index 0000000000000000000000000000000000000000..062b074368b8e633bf2e5ebbd95fd4225a3bf940
--- /dev/null
+++ b/components/rappor/bytevector.h
@@ -0,0 +1,32 @@
+// Copyright (c) 2013 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_BYTEVECTOR_H_
+#define CHROME_BROWSER_RAPPOR_BYTEVECTOR_H_
+
+#include <stddef.h>
+#include <stdint.h>
+#include <vector>
+
+// ByteVector is a class that extends a vector of one byte integers with
+// methods for manipulating it's content as a set of binary bits.
+
+namespace rappor {
+
+class ByteVector : public std::vector<uint8_t> {
+ public:
+ explicit ByteVector(size_t bytes_size);
+ explicit ByteVector(const std::vector<uint8_t>& v);
+ ByteVector(const char* bytes, int bytes_size);
+
+ ByteVector operator&(ByteVector rhs) const;
jwd 2013/12/16 17:04:03 Operator overloading is frowned upon in the c++ go
Steven Holte 2013/12/16 23:02:16 Done.
+
+ ByteVector operator|(ByteVector rhs) const;
+
+ ByteVector operator~() const;
+};
+
+} // namespace rappor
+
+#endif // CHROME_BROWSER_RAPPOR_BYTEVECTOR_H_

Powered by Google App Engine
This is Rietveld 408576698