OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_connection_peer.h" | 5 #include "net/quic/test_tools/quic_connection_peer.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "net/quic/congestion_control/send_algorithm_interface.h" | 8 #include "net/quic/congestion_control/send_algorithm_interface.h" |
9 #include "net/quic/quic_connection.h" | 9 #include "net/quic/quic_connection.h" |
10 #include "net/quic/quic_packet_writer.h" | 10 #include "net/quic/quic_packet_writer.h" |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 } | 212 } |
213 | 213 |
214 // static | 214 // static |
215 void QuicConnectionPeer::CloseConnection(QuicConnection* connection) { | 215 void QuicConnectionPeer::CloseConnection(QuicConnection* connection) { |
216 connection->connected_ = false; | 216 connection->connected_ = false; |
217 } | 217 } |
218 | 218 |
219 // static | 219 // static |
220 QuicEncryptedPacket* QuicConnectionPeer::GetConnectionClosePacket( | 220 QuicEncryptedPacket* QuicConnectionPeer::GetConnectionClosePacket( |
221 QuicConnection* connection) { | 221 QuicConnection* connection) { |
222 return connection->connection_close_packet_.get(); | 222 if (connection->termination_packets_ == nullptr || |
| 223 connection->termination_packets_->empty()) { |
| 224 return nullptr; |
| 225 } |
| 226 return (*connection->termination_packets_)[0]; |
223 } | 227 } |
224 | 228 |
225 // static | 229 // static |
226 QuicPacketHeader* QuicConnectionPeer::GetLastHeader( | 230 QuicPacketHeader* QuicConnectionPeer::GetLastHeader( |
227 QuicConnection* connection) { | 231 QuicConnection* connection) { |
228 return &connection->last_header_; | 232 return &connection->last_header_; |
229 } | 233 } |
230 | 234 |
231 // static | 235 // static |
232 void QuicConnectionPeer::SetPacketNumberOfLastSentPacket( | 236 void QuicConnectionPeer::SetPacketNumberOfLastSentPacket( |
(...skipping 20 matching lines...) Expand all Loading... |
253 } | 257 } |
254 | 258 |
255 // static | 259 // static |
256 void QuicConnectionPeer::SetNextMtuProbeAt(QuicConnection* connection, | 260 void QuicConnectionPeer::SetNextMtuProbeAt(QuicConnection* connection, |
257 QuicPacketNumber number) { | 261 QuicPacketNumber number) { |
258 connection->next_mtu_probe_at_ = number; | 262 connection->next_mtu_probe_at_ = number; |
259 } | 263 } |
260 | 264 |
261 } // namespace test | 265 } // namespace test |
262 } // namespace net | 266 } // namespace net |
OLD | NEW |