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 QuicAckFrame* QuicConnectionPeer::CreateAckFrame(QuicConnection* connection) { | 32 void QuicConnectionPeer::PopulateAckFrame(QuicConnection* connection, |
42 return connection->CreateAckFrame(); | 33 QuicAckFrame* ack) { |
| 34 connection->PopulateAckFrame(ack); |
43 } | 35 } |
44 | 36 |
45 // static | 37 // static |
46 QuicStopWaitingFrame* QuicConnectionPeer::CreateStopWaitingFrame( | 38 void QuicConnectionPeer::PopulateStopWaitingFrame( |
47 QuicConnection* connection) { | 39 QuicConnection* connection, |
48 return connection->CreateStopWaitingFrame(); | 40 QuicStopWaitingFrame* stop_waiting) { |
| 41 connection->PopulateStopWaitingFrame(stop_waiting); |
49 } | 42 } |
50 | 43 |
51 // static | 44 // static |
52 QuicConnectionVisitorInterface* QuicConnectionPeer::GetVisitor( | 45 QuicConnectionVisitorInterface* QuicConnectionPeer::GetVisitor( |
53 QuicConnection* connection) { | 46 QuicConnection* connection) { |
54 return connection->visitor_; | 47 return connection->visitor_; |
55 } | 48 } |
56 | 49 |
57 // static | 50 // static |
58 QuicPacketCreator* QuicConnectionPeer::GetPacketCreator( | 51 QuicPacketCreator* QuicConnectionPeer::GetPacketCreator( |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 connection->sequence_number_of_last_sent_packet_ = number; | 257 connection->sequence_number_of_last_sent_packet_ = number; |
265 } | 258 } |
266 | 259 |
267 // static | 260 // static |
268 QuicConnectionStats* QuicConnectionPeer::GetStats(QuicConnection* connection) { | 261 QuicConnectionStats* QuicConnectionPeer::GetStats(QuicConnection* connection) { |
269 return &connection->stats_; | 262 return &connection->stats_; |
270 } | 263 } |
271 | 264 |
272 } // namespace test | 265 } // namespace test |
273 } // namespace net | 266 } // namespace net |
OLD | NEW |