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

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

Issue 1658393003: Make a SerializedPacket a member variable of QuicPacketCreator to (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@113076102
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') | no next file » | 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 c1b34d66ef6aa376a118221e2033336d648f6498..53a928cbe3ae02118614e15ce9c44b04296d6676 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,10 @@ 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
@@ -123,7 +123,10 @@ SerializedPacket QuicPacketCreatorPeer::SerializeAllFrames(
bool success = creator->AddFrame(frame, false);
DCHECK(success);
}
- SerializedPacket packet = creator->SerializePacket(buffer, buffer_len);
+ creator->SerializePacket(buffer, buffer_len);
+ SerializedPacket packet = creator->packet_;
+ // The caller takes ownership of the QuicEncryptedPacket.
+ creator->packet_.packet = nullptr;
DCHECK(packet.retransmittable_frames == nullptr);
return packet;
}
@@ -148,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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698