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

Unified Diff: net/quic/crypto/quic_random.cc

Issue 12334063: Land recent QUIC changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more EXPECT_FALSE Created 7 years, 10 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/quic/crypto/quic_random.h ('k') | net/quic/quic_client_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/quic_random.cc
diff --git a/net/quic/crypto/quic_random.cc b/net/quic/crypto/quic_random.cc
index 9a679180149e28aead53ca6ebef94cb8d58fc816..be1f3c0cfd0dedeed413ac191adca661138d259e 100644
--- a/net/quic/crypto/quic_random.cc
+++ b/net/quic/crypto/quic_random.cc
@@ -19,6 +19,7 @@ class DefaultRandom : public QuicRandom {
// QuicRandom implementation
virtual void RandBytes(void* data, size_t len) OVERRIDE;
virtual uint64 RandUint64() OVERRIDE;
+ virtual bool RandBool() OVERRIDE;
virtual void Reseed(const void* additional_entropy,
size_t entropy_len) OVERRIDE;
@@ -44,6 +45,12 @@ uint64 DefaultRandom::RandUint64() {
return value;
}
+bool DefaultRandom::RandBool() {
+ char value;
+ RandBytes(&value, sizeof(value));
+ return (value & 1) == 1;
+}
+
void DefaultRandom::Reseed(const void* additional_entropy, size_t entropy_len) {
// No such function exists in crypto/random.h.
}
« no previous file with comments | « net/quic/crypto/quic_random.h ('k') | net/quic/quic_client_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698