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

Unified Diff: net/quic/test_tools/mock_random.h

Issue 109323006: Pool 64 bits of entropy instead of calling OpenSSL's RNG for one bit (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Deleted the second MockRandom 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
« no previous file with comments | « net/quic/quic_stream_factory_test.cc ('k') | net/quic/test_tools/mock_random.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/mock_random.h
diff --git a/net/quic/test_tools/mock_random.h b/net/quic/test_tools/mock_random.h
index 544f5ce048ac6d1c5f7d70c900c5c2669970bc07..3a3c87f4497f7391815c76369eb460f3beb227ab 100644
--- a/net/quic/test_tools/mock_random.h
+++ b/net/quic/test_tools/mock_random.h
@@ -12,15 +12,15 @@ namespace net {
class MockRandom : public QuicRandom {
public:
+ // Initializes base_ to 0xDEADBEEF.
MockRandom();
+ MockRandom(uint32 base);
// QuicRandom:
// Fills the |data| buffer with a repeating byte, initially 'r'.
virtual void RandBytes(void* data, size_t len) OVERRIDE;
- // Returns 0xDEADBEEF + the current increment.
+ // Returns base + the current increment.
virtual uint64 RandUint64() OVERRIDE;
- // Returns false.
- virtual bool RandBool() OVERRIDE;
// Does nothing.
virtual void Reseed(const void* additional_entropy,
size_t entropy_len) OVERRIDE;
@@ -30,6 +30,7 @@ class MockRandom : public QuicRandom {
void ChangeValue();
private:
+ uint32 base_;
uint8 increment_;
};
« no previous file with comments | « net/quic/quic_stream_factory_test.cc ('k') | net/quic/test_tools/mock_random.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698