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

Side by Side Diff: net/quic/test_tools/quic_packet_creator_peer.cc

Issue 1658373002: Move QuicPacketCreator::SerializeAllFrames into QuicPacketCreatorPeer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0202
Patch Set: Created 4 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/test_tools/quic_packet_creator_peer.h" 5 #include "net/quic/test_tools/quic_packet_creator_peer.h"
6 6
7 #include "net/quic/quic_packet_creator.h" 7 #include "net/quic/quic_packet_creator.h"
8 8
9 namespace net { 9 namespace net {
10 namespace test { 10 namespace test {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 106
107 // static 107 // static
108 SerializedPacket QuicPacketCreatorPeer::SerializeFec(QuicPacketCreator* creator, 108 SerializedPacket QuicPacketCreatorPeer::SerializeFec(QuicPacketCreator* creator,
109 char* buffer, 109 char* buffer,
110 size_t buffer_len) { 110 size_t buffer_len) {
111 return creator->SerializeFec(buffer, buffer_len); 111 return creator->SerializeFec(buffer, buffer_len);
112 } 112 }
113 113
114 // static 114 // static
115 SerializedPacket QuicPacketCreatorPeer::SerializeAllFrames(
116 QuicPacketCreator* creator,
117 const QuicFrames& frames,
118 char* buffer,
119 size_t buffer_len) {
120 DCHECK(creator->queued_frames_.empty());
121 DCHECK(!frames.empty());
122 for (const QuicFrame& frame : frames) {
123 bool success = creator->AddFrame(frame, false);
124 DCHECK(success);
125 }
126 SerializedPacket packet = creator->SerializePacket(buffer, buffer_len);
127 DCHECK(packet.retransmittable_frames == nullptr);
128 return packet;
129 }
130
131 // static
115 void QuicPacketCreatorPeer::ResetFecGroup(QuicPacketCreator* creator) { 132 void QuicPacketCreatorPeer::ResetFecGroup(QuicPacketCreator* creator) {
116 creator->ResetFecGroup(); 133 creator->ResetFecGroup();
117 } 134 }
118 135
119 // static 136 // static
120 QuicTime::Delta QuicPacketCreatorPeer::GetFecTimeout( 137 QuicTime::Delta QuicPacketCreatorPeer::GetFecTimeout(
121 QuicPacketCreator* creator) { 138 QuicPacketCreator* creator) {
122 return creator->fec_timeout_; 139 return creator->fec_timeout_;
123 } 140 }
124 141
125 // static 142 // static
126 float QuicPacketCreatorPeer::GetRttMultiplierForFecTimeout( 143 float QuicPacketCreatorPeer::GetRttMultiplierForFecTimeout(
127 QuicPacketCreator* creator) { 144 QuicPacketCreator* creator) {
128 return creator->rtt_multiplier_for_fec_timeout_; 145 return creator->rtt_multiplier_for_fec_timeout_;
129 } 146 }
130 147
131 // static 148 // static
132 EncryptionLevel QuicPacketCreatorPeer::GetEncryptionLevel( 149 EncryptionLevel QuicPacketCreatorPeer::GetEncryptionLevel(
133 QuicPacketCreator* creator) { 150 QuicPacketCreator* creator) {
134 return creator->encryption_level_; 151 return creator->encryption_level_;
135 } 152 }
136 153
137 // static 154 // static
138 QuicPathId QuicPacketCreatorPeer::GetCurrentPath(QuicPacketCreator* creator) { 155 QuicPathId QuicPacketCreatorPeer::GetCurrentPath(QuicPacketCreator* creator) {
139 return creator->current_path_; 156 return creator->current_path_;
140 } 157 }
141 158
142 } // namespace test 159 } // namespace test
143 } // namespace net 160 } // namespace net
OLDNEW
« 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