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

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

Issue 1660593004: Landing Recent QUIC changes until 01/28/2016 18:41 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0202
Patch Set: Created 4 years, 11 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_packet_creator_peer.h ('k') | net/quic/test_tools/quic_session_peer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/test_tools/quic_packet_creator_peer.cc
diff --git a/net/quic/test_tools/quic_packet_creator_peer.cc b/net/quic/test_tools/quic_packet_creator_peer.cc
index 531235c2e8ba68fca2feba062e41f746c910d610..90e469f121a4c5c01861ba7ac0de3bf8cf9f6306 100644
--- a/net/quic/test_tools/quic_packet_creator_peer.cc
+++ b/net/quic/test_tools/quic_packet_creator_peer.cc
@@ -36,7 +36,7 @@ void QuicPacketCreatorPeer::SetSendPathIdInPacket(QuicPacketCreator* creator,
void QuicPacketCreatorPeer::SetPacketNumberLength(
QuicPacketCreator* creator,
QuicPacketNumberLength packet_number_length) {
- creator->packet_number_length_ = packet_number_length;
+ creator->packet_.packet_number_length = packet_number_length;
}
// static
@@ -55,12 +55,12 @@ QuicPacketNumberLength QuicPacketCreatorPeer::NextPacketNumberLength(
// static
QuicPacketNumberLength QuicPacketCreatorPeer::GetPacketNumberLength(
QuicPacketCreator* creator) {
- return creator->packet_number_length_;
+ return creator->packet_.packet_number_length;
}
void QuicPacketCreatorPeer::SetPacketNumber(QuicPacketCreator* creator,
QuicPacketNumber s) {
- creator->packet_number_ = s;
+ creator->packet_.packet_number = s;
}
// static
@@ -105,10 +105,30 @@ void QuicPacketCreatorPeer::StopFecProtectingPackets(
}
// static
-SerializedPacket QuicPacketCreatorPeer::SerializeFec(QuicPacketCreator* creator,
- char* buffer,
- size_t buffer_len) {
- return creator->SerializeFec(buffer, buffer_len);
+void QuicPacketCreatorPeer::SerializeFec(QuicPacketCreator* creator,
+ char* buffer,
+ size_t buffer_len) {
+ creator->SerializeFec(buffer, buffer_len);
+}
+
+// static
+SerializedPacket QuicPacketCreatorPeer::SerializeAllFrames(
+ QuicPacketCreator* creator,
+ const QuicFrames& frames,
+ char* buffer,
+ size_t buffer_len) {
+ DCHECK(creator->queued_frames_.empty());
+ DCHECK(!frames.empty());
+ for (const QuicFrame& frame : frames) {
+ bool success = creator->AddFrame(frame, false);
+ DCHECK(success);
+ }
+ creator->SerializePacket(buffer, buffer_len);
+ SerializedPacket packet = creator->packet_;
+ // The caller takes ownership of the QuicEncryptedPacket.
+ creator->packet_.packet = nullptr;
+ DCHECK(packet.retransmittable_frames.empty());
+ return packet;
}
// static
@@ -131,12 +151,12 @@ float QuicPacketCreatorPeer::GetRttMultiplierForFecTimeout(
// static
EncryptionLevel QuicPacketCreatorPeer::GetEncryptionLevel(
QuicPacketCreator* creator) {
- return creator->encryption_level_;
+ return creator->packet_.encryption_level;
}
// static
QuicPathId QuicPacketCreatorPeer::GetCurrentPath(QuicPacketCreator* creator) {
- return creator->current_path_;
+ return creator->packet_.path_id;
}
} // namespace test
« no previous file with comments | « net/quic/test_tools/quic_packet_creator_peer.h ('k') | net/quic/test_tools/quic_session_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698