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" | 8 #include "net/quic/congestion_control/receive_algorithm_interface.h" |
9 #include "net/quic/congestion_control/send_algorithm_interface.h" | 9 #include "net/quic/congestion_control/send_algorithm_interface.h" |
10 #include "net/quic/quic_connection.h" | 10 #include "net/quic/quic_connection.h" |
11 #include "net/quic/quic_packet_writer.h" | 11 #include "net/quic/quic_packet_writer.h" |
12 #include "net/quic/quic_received_packet_manager.h" | 12 #include "net/quic/quic_received_packet_manager.h" |
13 #include "net/quic/test_tools/quic_framer_peer.h" | 13 #include "net/quic/test_tools/quic_framer_peer.h" |
14 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" | 14 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" |
15 #include "net/quic/test_tools/quic_test_writer.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 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 108 |
110 // static | 109 // static |
111 QuicPacketEntropyHash QuicConnectionPeer::ReceivedEntropyHash( | 110 QuicPacketEntropyHash QuicConnectionPeer::ReceivedEntropyHash( |
112 QuicConnection* connection, | 111 QuicConnection* connection, |
113 QuicPacketSequenceNumber sequence_number) { | 112 QuicPacketSequenceNumber sequence_number) { |
114 return connection->received_packet_manager_.EntropyHash( | 113 return connection->received_packet_manager_.EntropyHash( |
115 sequence_number); | 114 sequence_number); |
116 } | 115 } |
117 | 116 |
118 // static | 117 // static |
119 bool QuicConnectionPeer::IsWriteBlocked(QuicConnection* connection) { | |
120 return connection->write_blocked_; | |
121 } | |
122 | |
123 // static | |
124 void QuicConnectionPeer::SetIsWriteBlocked(QuicConnection* connection, | |
125 bool write_blocked) { | |
126 connection->write_blocked_ = write_blocked; | |
127 } | |
128 | |
129 // static | |
130 bool QuicConnectionPeer::IsServer(QuicConnection* connection) { | 118 bool QuicConnectionPeer::IsServer(QuicConnection* connection) { |
131 return connection->is_server_; | 119 return connection->is_server_; |
132 } | 120 } |
133 | 121 |
134 // static | 122 // static |
135 void QuicConnectionPeer::SetIsServer(QuicConnection* connection, | 123 void QuicConnectionPeer::SetIsServer(QuicConnection* connection, |
136 bool is_server) { | 124 bool is_server) { |
137 connection->is_server_ = is_server; | 125 connection->is_server_ = is_server; |
138 QuicFramerPeer::SetIsServer(&connection->framer_, is_server); | 126 QuicFramerPeer::SetIsServer(&connection->framer_, is_server); |
139 } | 127 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 return connection->timeout_alarm_.get(); | 188 return connection->timeout_alarm_.get(); |
201 } | 189 } |
202 | 190 |
203 // static | 191 // static |
204 QuicPacketWriter* QuicConnectionPeer::GetWriter(QuicConnection* connection) { | 192 QuicPacketWriter* QuicConnectionPeer::GetWriter(QuicConnection* connection) { |
205 return connection->writer_; | 193 return connection->writer_; |
206 } | 194 } |
207 | 195 |
208 // static | 196 // static |
209 void QuicConnectionPeer::SetWriter(QuicConnection* connection, | 197 void QuicConnectionPeer::SetWriter(QuicConnection* connection, |
210 QuicTestWriter* writer) { | 198 QuicPacketWriter* writer) { |
211 connection->writer_ = writer; | 199 connection->writer_ = writer; |
212 } | 200 } |
213 | 201 |
214 // static | 202 // static |
215 void QuicConnectionPeer::CloseConnection(QuicConnection* connection) { | 203 void QuicConnectionPeer::CloseConnection(QuicConnection* connection) { |
216 connection->connected_ = false; | 204 connection->connected_ = false; |
217 } | 205 } |
218 | 206 |
| 207 // static |
| 208 QuicEncryptedPacket* QuicConnectionPeer::GetConnectionClosePacket( |
| 209 QuicConnection* connection) { |
| 210 return connection->connection_close_packet_.get(); |
| 211 } |
| 212 |
219 } // namespace test | 213 } // namespace test |
220 } // namespace net | 214 } // namespace net |
OLD | NEW |