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

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

Issue 932723002: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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/test_tools/quic_test_utils.h ('k') | net/tools/quic/end_to_end_test.cc » ('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 fc451060446d4cb5c0326712b0913189ef349b12..b504b756cb2c1f1a6f30aa1036278a68a8f0c2da 100644
--- a/net/quic/test_tools/quic_test_utils.cc
+++ b/net/quic/test_tools/quic_test_utils.cc
@@ -13,6 +13,7 @@
#include "net/quic/crypto/null_encrypter.h"
#include "net/quic/crypto/quic_decrypter.h"
#include "net/quic/crypto/quic_encrypter.h"
+#include "net/quic/quic_data_writer.h"
#include "net/quic/quic_framer.h"
#include "net/quic/quic_packet_creator.h"
#include "net/quic/quic_utils.h"
@@ -76,7 +77,22 @@ QuicPacket* BuildUnsizedDataPacket(QuicFramer* framer,
DCHECK(frame_size);
packet_size += frame_size;
}
- return framer->BuildDataPacket(header, frames, packet_size);
+ return BuildUnsizedDataPacket(framer, header, frames, packet_size);
+}
+
+QuicPacket* BuildUnsizedDataPacket(QuicFramer* framer,
+ const QuicPacketHeader& header,
+ const QuicFrames& frames,
+ size_t packet_size) {
+ char* buffer = new char[packet_size];
+ scoped_ptr<QuicPacket> packet(
+ framer->BuildDataPacket(header, frames, buffer, packet_size));
+ DCHECK(packet.get() != nullptr);
+ // Now I have to re-construct the data packet with data ownership.
+ return new QuicPacket(buffer, packet->length(), true,
+ header.public_header.connection_id_length,
+ header.public_header.version_flag,
+ header.public_header.sequence_number_length);
}
uint64 SimpleRandom::RandUint64() {
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698