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.
|