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

Unified Diff: net/http2/tools/http2_random.h

Issue 2606733004: Add HpackDecoderTables, static and dynamic tables for decoding HPACK. (Closed)
Patch Set: Rebase. Created 3 years, 11 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
« no previous file with comments | « net/http2/hpack/hpack_string.cc ('k') | net/http2/tools/http2_random.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http2/tools/http2_random.h
diff --git a/net/http2/tools/http2_random.h b/net/http2/tools/http2_random.h
index f7956cb8952603ce7b0ea52d661d6b8fb7b14074..eb3f6aa7d11d460064dd5c503378b8b199bff674 100644
--- a/net/http2/tools/http2_random.h
+++ b/net/http2/tools/http2_random.h
@@ -7,6 +7,7 @@
#include <stdint.h>
+#include <limits>
#include <string>
namespace net {
@@ -24,8 +25,18 @@ class RandomBase {
virtual int32_t Next() = 0;
virtual int32_t Skewed(int max_log) = 0;
virtual std::string RandString(int length) = 0;
+
+ // STL UniformRandomNumberGenerator implementation.
+ typedef uint32_t result_type;
+ static constexpr result_type min() { return 0; }
+ static constexpr result_type max() {
+ return std::numeric_limits<uint32_t>::max();
+ }
+ result_type operator()() { return Rand32(); }
};
+// Http2Random holds no state: instances use the same base::RandGenerator
+// with a global state.
class Http2Random : public RandomBase {
public:
~Http2Random() override {}
« no previous file with comments | « net/http2/hpack/hpack_string.cc ('k') | net/http2/tools/http2_random.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698