| 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/receive_algorithm_interface.h" | |
| 9 #include "net/quic/congestion_control/send_algorithm_interface.h" | 8 #include "net/quic/congestion_control/send_algorithm_interface.h" |
| 10 #include "net/quic/quic_connection.h" | 9 #include "net/quic/quic_connection.h" |
| 11 #include "net/quic/quic_packet_writer.h" | 10 #include "net/quic/quic_packet_writer.h" |
| 12 #include "net/quic/quic_received_packet_manager.h" | 11 #include "net/quic/quic_received_packet_manager.h" |
| 13 #include "net/quic/test_tools/quic_framer_peer.h" | 12 #include "net/quic/test_tools/quic_framer_peer.h" |
| 14 #include "net/quic/test_tools/quic_packet_generator_peer.h" | 13 #include "net/quic/test_tools/quic_packet_generator_peer.h" |
| 15 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" | 14 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" |
| 16 | 15 |
| 17 namespace net { | 16 namespace net { |
| 18 namespace test { | 17 namespace test { |
| 19 | 18 |
| 20 // static | 19 // static |
| 21 void QuicConnectionPeer::SendAck(QuicConnection* connection) { | 20 void QuicConnectionPeer::SendAck(QuicConnection* connection) { |
| 22 connection->SendAck(); | 21 connection->SendAck(); |
| 23 } | 22 } |
| 24 | 23 |
| 25 // static | 24 // static |
| 26 void QuicConnectionPeer::SetReceiveAlgorithm( | |
| 27 QuicConnection* connection, | |
| 28 ReceiveAlgorithmInterface* receive_algorithm) { | |
| 29 connection->received_packet_manager_.receive_algorithm_.reset( | |
| 30 receive_algorithm); | |
| 31 } | |
| 32 | |
| 33 // static | |
| 34 void QuicConnectionPeer::SetSendAlgorithm( | 25 void QuicConnectionPeer::SetSendAlgorithm( |
| 35 QuicConnection* connection, | 26 QuicConnection* connection, |
| 36 SendAlgorithmInterface* send_algorithm) { | 27 SendAlgorithmInterface* send_algorithm) { |
| 37 connection->sent_packet_manager_.send_algorithm_.reset(send_algorithm); | 28 connection->sent_packet_manager_.send_algorithm_.reset(send_algorithm); |
| 38 } | 29 } |
| 39 | 30 |
| 40 // static | 31 // static |
| 41 void QuicConnectionPeer::PopulateAckFrame(QuicConnection* connection, | 32 void QuicConnectionPeer::PopulateAckFrame(QuicConnection* connection, |
| 42 QuicAckFrame* ack) { | 33 QuicAckFrame* ack) { |
| 43 connection->PopulateAckFrame(ack); | 34 connection->PopulateAckFrame(ack); |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 connection->sequence_number_of_last_sent_packet_ = number; | 257 connection->sequence_number_of_last_sent_packet_ = number; |
| 267 } | 258 } |
| 268 | 259 |
| 269 // static | 260 // static |
| 270 QuicConnectionStats* QuicConnectionPeer::GetStats(QuicConnection* connection) { | 261 QuicConnectionStats* QuicConnectionPeer::GetStats(QuicConnection* connection) { |
| 271 return &connection->stats_; | 262 return &connection->stats_; |
| 272 } | 263 } |
| 273 | 264 |
| 274 } // namespace test | 265 } // namespace test |
| 275 } // namespace net | 266 } // namespace net |
| OLD | NEW |