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" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 // static | 109 // static |
110 QuicPacketEntropyHash QuicConnectionPeer::ReceivedEntropyHash( | 110 QuicPacketEntropyHash QuicConnectionPeer::ReceivedEntropyHash( |
111 QuicConnection* connection, | 111 QuicConnection* connection, |
112 QuicPacketSequenceNumber sequence_number) { | 112 QuicPacketSequenceNumber sequence_number) { |
113 return connection->received_packet_manager_.EntropyHash( | 113 return connection->received_packet_manager_.EntropyHash( |
114 sequence_number); | 114 sequence_number); |
115 } | 115 } |
116 | 116 |
117 // static | 117 // static |
118 bool QuicConnectionPeer::IsWriteBlocked(QuicConnection* connection) { | |
119 return connection->write_blocked_; | |
120 } | |
121 | |
122 // static | |
123 void QuicConnectionPeer::SetIsWriteBlocked(QuicConnection* connection, | |
124 bool write_blocked) { | |
125 connection->write_blocked_ = write_blocked; | |
126 } | |
127 | |
128 // static | |
129 bool QuicConnectionPeer::IsServer(QuicConnection* connection) { | 118 bool QuicConnectionPeer::IsServer(QuicConnection* connection) { |
130 return connection->is_server_; | 119 return connection->is_server_; |
131 } | 120 } |
132 | 121 |
133 // static | 122 // static |
134 void QuicConnectionPeer::SetIsServer(QuicConnection* connection, | 123 void QuicConnectionPeer::SetIsServer(QuicConnection* connection, |
135 bool is_server) { | 124 bool is_server) { |
136 connection->is_server_ = is_server; | 125 connection->is_server_ = is_server; |
137 QuicFramerPeer::SetIsServer(&connection->framer_, is_server); | 126 QuicFramerPeer::SetIsServer(&connection->framer_, is_server); |
138 } | 127 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 void QuicConnectionPeer::SetWriter(QuicConnection* connection, | 197 void QuicConnectionPeer::SetWriter(QuicConnection* connection, |
209 QuicPacketWriter* writer) { | 198 QuicPacketWriter* writer) { |
210 connection->writer_ = writer; | 199 connection->writer_ = writer; |
211 } | 200 } |
212 | 201 |
213 // static | 202 // static |
214 void QuicConnectionPeer::CloseConnection(QuicConnection* connection) { | 203 void QuicConnectionPeer::CloseConnection(QuicConnection* connection) { |
215 connection->connected_ = false; | 204 connection->connected_ = false; |
216 } | 205 } |
217 | 206 |
| 207 // static |
| 208 QuicEncryptedPacket* QuicConnectionPeer::GetConnectionClosePacket( |
| 209 QuicConnection* connection) { |
| 210 return connection->connection_close_packet_.get(); |
| 211 } |
| 212 |
218 } // namespace test | 213 } // namespace test |
219 } // namespace net | 214 } // namespace net |
OLD | NEW |