| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 QuicTime::Delta QuicConnectionPeer::GetNetworkTimeout( | 69 QuicTime::Delta QuicConnectionPeer::GetNetworkTimeout( |
| 70 QuicConnection* connection) { | 70 QuicConnection* connection) { |
| 71 return connection->idle_network_timeout_; | 71 return connection->idle_network_timeout_; |
| 72 } | 72 } |
| 73 | 73 |
| 74 // static | 74 // static |
| 75 bool QuicConnectionPeer::IsSavedForRetransmission( | 75 bool QuicConnectionPeer::IsSavedForRetransmission( |
| 76 QuicConnection* connection, | 76 QuicConnection* connection, |
| 77 QuicPacketSequenceNumber sequence_number) { | 77 QuicPacketSequenceNumber sequence_number) { |
| 78 return connection->sent_packet_manager_.IsUnacked(sequence_number) && | 78 return connection->sent_packet_manager_.IsUnacked(sequence_number) && |
| 79 connection->sent_packet_manager_.HasRetransmittableFrames( | 79 connection->sent_packet_manager_.HasRetransmittableFrames( |
| 80 sequence_number); | 80 sequence_number); |
| 81 } | 81 } |
| 82 | 82 |
| 83 // static | 83 // static |
| 84 bool QuicConnectionPeer::IsRetransmission( | 84 bool QuicConnectionPeer::IsRetransmission( |
| 85 QuicConnection* connection, | 85 QuicConnection* connection, |
| 86 QuicPacketSequenceNumber sequence_number) { | 86 QuicPacketSequenceNumber sequence_number) { |
| 87 return QuicSentPacketManagerPeer::IsRetransmission( | 87 return QuicSentPacketManagerPeer::IsRetransmission( |
| 88 &connection->sent_packet_manager_, sequence_number); | 88 &connection->sent_packet_manager_, sequence_number); |
| 89 } | 89 } |
| 90 | 90 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 103 const SequenceNumberSet& missing_packets, | 103 const SequenceNumberSet& missing_packets, |
| 104 QuicPacketEntropyHash entropy_hash) { | 104 QuicPacketEntropyHash entropy_hash) { |
| 105 return connection->sent_entropy_manager_.IsValidEntropy( | 105 return connection->sent_entropy_manager_.IsValidEntropy( |
| 106 largest_observed, missing_packets, entropy_hash); | 106 largest_observed, missing_packets, entropy_hash); |
| 107 } | 107 } |
| 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(sequence_number); |
| 114 sequence_number); | |
| 115 } | 114 } |
| 116 | 115 |
| 117 // static | 116 // static |
| 118 bool QuicConnectionPeer::IsServer(QuicConnection* connection) { | 117 bool QuicConnectionPeer::IsServer(QuicConnection* connection) { |
| 119 return connection->is_server_; | 118 return connection->is_server_; |
| 120 } | 119 } |
| 121 | 120 |
| 122 // static | 121 // static |
| 123 void QuicConnectionPeer::SetIsServer(QuicConnection* connection, | 122 void QuicConnectionPeer::SetIsServer(QuicConnection* connection, |
| 124 bool is_server) { | 123 bool is_server) { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 } | 209 } |
| 211 | 210 |
| 212 // static | 211 // static |
| 213 QuicEncryptedPacket* QuicConnectionPeer::GetConnectionClosePacket( | 212 QuicEncryptedPacket* QuicConnectionPeer::GetConnectionClosePacket( |
| 214 QuicConnection* connection) { | 213 QuicConnection* connection) { |
| 215 return connection->connection_close_packet_.get(); | 214 return connection->connection_close_packet_.get(); |
| 216 } | 215 } |
| 217 | 216 |
| 218 } // namespace test | 217 } // namespace test |
| 219 } // namespace net | 218 } // namespace net |
| OLD | NEW |