| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 QuicConnection::RetransmissionMap::iterator it = | 82 QuicConnection::RetransmissionMap::iterator it = |
| 83 connection->retransmission_map_.find(sequence_number); | 83 connection->retransmission_map_.find(sequence_number); |
| 84 DCHECK(connection->retransmission_map_.end() != it); | 84 DCHECK(connection->retransmission_map_.end() != it); |
| 85 return it->second.number_retransmissions; | 85 return it->second.number_retransmissions; |
| 86 } | 86 } |
| 87 | 87 |
| 88 // static | 88 // static |
| 89 QuicPacketEntropyHash QuicConnectionPeer::GetSentEntropyHash( | 89 QuicPacketEntropyHash QuicConnectionPeer::GetSentEntropyHash( |
| 90 QuicConnection* connection, | 90 QuicConnection* connection, |
| 91 QuicPacketSequenceNumber sequence_number) { | 91 QuicPacketSequenceNumber sequence_number) { |
| 92 return connection->entropy_manager_.SentEntropyHash(sequence_number); | 92 return connection->sent_entropy_manager_.EntropyHash(sequence_number); |
| 93 } | 93 } |
| 94 | 94 |
| 95 // static | 95 // static |
| 96 bool QuicConnectionPeer::IsValidEntropy( | 96 bool QuicConnectionPeer::IsValidEntropy( |
| 97 QuicConnection* connection, | 97 QuicConnection* connection, |
| 98 QuicPacketSequenceNumber largest_observed, | 98 QuicPacketSequenceNumber largest_observed, |
| 99 const SequenceNumberSet& missing_packets, | 99 const SequenceNumberSet& missing_packets, |
| 100 QuicPacketEntropyHash entropy_hash) { | 100 QuicPacketEntropyHash entropy_hash) { |
| 101 return connection->entropy_manager_.IsValidEntropy( | 101 return connection->sent_entropy_manager_.IsValidEntropy( |
| 102 largest_observed, missing_packets, entropy_hash); | 102 largest_observed, missing_packets, entropy_hash); |
| 103 } | 103 } |
| 104 | 104 |
| 105 // static | 105 // static |
| 106 QuicPacketEntropyHash QuicConnectionPeer::ReceivedEntropyHash( | 106 QuicPacketEntropyHash QuicConnectionPeer::ReceivedEntropyHash( |
| 107 QuicConnection* connection, | 107 QuicConnection* connection, |
| 108 QuicPacketSequenceNumber sequence_number) { | 108 QuicPacketSequenceNumber sequence_number) { |
| 109 return connection->entropy_manager_.ReceivedEntropyHash(sequence_number); | 109 return connection->received_entropy_manager_.EntropyHash( |
| 110 sequence_number); |
| 110 } | 111 } |
| 111 | 112 |
| 112 // static | 113 // static |
| 113 bool QuicConnectionPeer::IsServer(QuicConnection* connection) { | 114 bool QuicConnectionPeer::IsServer(QuicConnection* connection) { |
| 114 return connection->is_server_; | 115 return connection->is_server_; |
| 115 } | 116 } |
| 116 | 117 |
| 117 // static | 118 // static |
| 118 void QuicConnectionPeer::SetIsServer(QuicConnection* connection, | 119 void QuicConnectionPeer::SetIsServer(QuicConnection* connection, |
| 119 bool is_server) { | 120 bool is_server) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 147 } | 148 } |
| 148 | 149 |
| 149 QuicFecGroup* QuicConnectionPeer::GetFecGroup(QuicConnection* connection, | 150 QuicFecGroup* QuicConnectionPeer::GetFecGroup(QuicConnection* connection, |
| 150 int fec_group) { | 151 int fec_group) { |
| 151 connection->last_header_.fec_group = fec_group; | 152 connection->last_header_.fec_group = fec_group; |
| 152 return connection->GetFecGroup(); | 153 return connection->GetFecGroup(); |
| 153 } | 154 } |
| 154 | 155 |
| 155 } // namespace test | 156 } // namespace test |
| 156 } // namespace net | 157 } // namespace net |
| OLD | NEW |