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

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

Issue 2606733004: Add HpackDecoderTables, static and dynamic tables for decoding HPACK. (Closed)
Patch Set: Remove NET_EXPORT from files in the test build target. Created 4 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: net/http2/tools/http2_random.h
diff --git a/net/http2/tools/http2_random.h b/net/http2/tools/http2_random.h
index f7956cb8952603ce7b0ea52d661d6b8fb7b14074..2192a28a45d96b01ee1b984d0134be7e53815457 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,6 +25,14 @@ 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(); }
};
class Http2Random : public RandomBase {
James Synge 2017/01/03 19:11:29 Seems like there should be a comment indicating th
Bence 2017/01/04 16:15:20 Done.

Powered by Google App Engine
This is Rietveld 408576698