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/send_algorithm_interface.h" | 8 #include "net/quic/congestion_control/send_algorithm_interface.h" |
9 #include "net/quic/quic_connection.h" | 9 #include "net/quic/quic_connection.h" |
10 #include "net/quic/quic_packet_writer.h" | 10 #include "net/quic/quic_packet_writer.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 // static | 94 // static |
95 QuicPacketEntropyHash QuicConnectionPeer::ReceivedEntropyHash( | 95 QuicPacketEntropyHash QuicConnectionPeer::ReceivedEntropyHash( |
96 QuicConnection* connection, | 96 QuicConnection* connection, |
97 QuicPacketSequenceNumber sequence_number) { | 97 QuicPacketSequenceNumber sequence_number) { |
98 return connection->received_packet_manager_.EntropyHash( | 98 return connection->received_packet_manager_.EntropyHash( |
99 sequence_number); | 99 sequence_number); |
100 } | 100 } |
101 | 101 |
102 // static | 102 // static |
103 bool QuicConnectionPeer::IsServer(QuicConnection* connection) { | 103 void QuicConnectionPeer::SetPerspective(QuicConnection* connection, |
104 return connection->is_server_; | 104 Perspective perspective) { |
| 105 connection->perspective_ = perspective; |
| 106 QuicFramerPeer::SetPerspective(&connection->framer_, perspective); |
105 } | 107 } |
106 | 108 |
107 // static | 109 // static |
108 void QuicConnectionPeer::SetIsServer(QuicConnection* connection, | |
109 bool is_server) { | |
110 connection->is_server_ = is_server; | |
111 QuicFramerPeer::SetIsServer(&connection->framer_, is_server); | |
112 } | |
113 | |
114 // static | |
115 void QuicConnectionPeer::SetSelfAddress(QuicConnection* connection, | 110 void QuicConnectionPeer::SetSelfAddress(QuicConnection* connection, |
116 const IPEndPoint& self_address) { | 111 const IPEndPoint& self_address) { |
117 connection->self_address_ = self_address; | 112 connection->self_address_ = self_address; |
118 } | 113 } |
119 | 114 |
120 // static | 115 // static |
121 void QuicConnectionPeer::SetPeerAddress(QuicConnection* connection, | 116 void QuicConnectionPeer::SetPeerAddress(QuicConnection* connection, |
122 const IPEndPoint& peer_address) { | 117 const IPEndPoint& peer_address) { |
123 connection->peer_address_ = peer_address; | 118 connection->peer_address_ = peer_address; |
124 } | 119 } |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 connection->sequence_number_of_last_sent_packet_ = number; | 223 connection->sequence_number_of_last_sent_packet_ = number; |
229 } | 224 } |
230 | 225 |
231 // static | 226 // static |
232 QuicConnectionStats* QuicConnectionPeer::GetStats(QuicConnection* connection) { | 227 QuicConnectionStats* QuicConnectionPeer::GetStats(QuicConnection* connection) { |
233 return &connection->stats_; | 228 return &connection->stats_; |
234 } | 229 } |
235 | 230 |
236 } // namespace test | 231 } // namespace test |
237 } // namespace net | 232 } // namespace net |
OLD | NEW |