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/quic_congestion_manager.h" | 8 #include "net/quic/congestion_control/quic_congestion_manager.h" |
9 #include "net/quic/congestion_control/receive_algorithm_interface.h" | 9 #include "net/quic/congestion_control/receive_algorithm_interface.h" |
10 #include "net/quic/congestion_control/send_algorithm_interface.h" | 10 #include "net/quic/congestion_control/send_algorithm_interface.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 return connection->received_truncated_ack_; | 56 return connection->received_truncated_ack_; |
57 } | 57 } |
58 | 58 |
59 // static | 59 // static |
60 size_t QuicConnectionPeer::GetNumRetransmissionTimeouts( | 60 size_t QuicConnectionPeer::GetNumRetransmissionTimeouts( |
61 QuicConnection* connection) { | 61 QuicConnection* connection) { |
62 return connection->retransmission_timeouts_.size(); | 62 return connection->retransmission_timeouts_.size(); |
63 } | 63 } |
64 | 64 |
65 // static | 65 // static |
| 66 QuicTime::Delta QuicConnectionPeer::GetTimeout(QuicConnection* connection) { |
| 67 return connection->timeout_; |
| 68 } |
| 69 |
| 70 // static |
66 bool QuicConnectionPeer::IsSavedForRetransmission( | 71 bool QuicConnectionPeer::IsSavedForRetransmission( |
67 QuicConnection* connection, | 72 QuicConnection* connection, |
68 QuicPacketSequenceNumber sequence_number) { | 73 QuicPacketSequenceNumber sequence_number) { |
69 return ContainsKey(connection->retransmission_map_, sequence_number); | 74 return ContainsKey(connection->retransmission_map_, sequence_number); |
70 } | 75 } |
71 | 76 |
72 // static | 77 // static |
73 size_t QuicConnectionPeer::GetRetransmissionCount( | 78 size_t QuicConnectionPeer::GetRetransmissionCount( |
74 QuicConnection* connection, | 79 QuicConnection* connection, |
75 QuicPacketSequenceNumber sequence_number) { | 80 QuicPacketSequenceNumber sequence_number) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 connection->is_server_ = is_server; | 119 connection->is_server_ = is_server; |
115 QuicFramerPeer::SetIsServer(&connection->framer_, is_server); | 120 QuicFramerPeer::SetIsServer(&connection->framer_, is_server); |
116 } | 121 } |
117 | 122 |
118 // static | 123 // static |
119 void QuicConnectionPeer::SwapCrypters(QuicConnection* connection, | 124 void QuicConnectionPeer::SwapCrypters(QuicConnection* connection, |
120 QuicFramer* framer) { | 125 QuicFramer* framer) { |
121 framer->SwapCryptersForTest(&connection->framer_); | 126 framer->SwapCryptersForTest(&connection->framer_); |
122 } | 127 } |
123 | 128 |
| 129 // static |
| 130 void QuicConnectionPeer:: SetMaxPacketsPerRetransmissionAlarm( |
| 131 QuicConnection* connection, |
| 132 int max_packets) { |
| 133 connection->max_packets_per_retransmission_alarm_ = max_packets; |
| 134 } |
| 135 |
| 136 // static |
| 137 QuicConnectionHelperInterface* QuicConnectionPeer::GetHelper( |
| 138 QuicConnection* connection) { |
| 139 return connection->helper_.get(); |
| 140 } |
| 141 |
| 142 QuicFecGroup* QuicConnectionPeer::GetFecGroup(QuicConnection* connection, |
| 143 int fec_group) { |
| 144 connection->last_header_.fec_group = fec_group; |
| 145 return connection->GetFecGroup(); |
| 146 } |
| 147 |
124 } // namespace test | 148 } // namespace test |
125 } // namespace net | 149 } // namespace net |
OLD | NEW |