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

Unified Diff: net/quic/test_tools/quic_test_utils.cc

Issue 330163003: First version of a QUIC SendAlgorithmSimulator which is designed to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase with trunk Created 6 years, 6 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/test_tools/quic_test_utils.h ('k') | net/tools/quic/test_tools/packet_dropping_test_writer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/quic_test_utils.cc
diff --git a/net/quic/test_tools/quic_test_utils.cc b/net/quic/test_tools/quic_test_utils.cc
index 727c5446c8f0d75dee96f3ac0b91a64d2c84d5ce..85bdfbdccc63083f965004e6cfb5d04047fa3532 100644
--- a/net/quic/test_tools/quic_test_utils.cc
+++ b/net/quic/test_tools/quic_test_utils.cc
@@ -4,6 +4,7 @@
#include "net/quic/test_tools/quic_test_utils.h"
+#include "base/sha1.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "net/quic/crypto/crypto_framer.h"
@@ -82,6 +83,14 @@ SerializedPacket BuildUnsizedDataPacket(QuicFramer* framer,
return framer->BuildDataPacket(header, frames, packet_size);
}
+uint64 SimpleRandom::RandUint64() {
+ unsigned char hash[base::kSHA1Length];
+ base::SHA1HashBytes(reinterpret_cast<unsigned char*>(&seed_), sizeof(seed_),
+ hash);
+ memcpy(&seed_, hash, sizeof(seed_));
+ return seed_;
+}
+
MockFramerVisitor::MockFramerVisitor() {
// By default, we want to accept packets.
ON_CALL(*this, OnProtocolVersionMismatch(_))
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/test_tools/packet_dropping_test_writer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698