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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 QuicPacketSequenceNumber sequence_number) { | 100 QuicPacketSequenceNumber sequence_number) { |
101 return QuicSentPacketManagerPeer::IsRetransmission( | 101 return QuicSentPacketManagerPeer::IsRetransmission( |
102 &connection->sent_packet_manager_, sequence_number); | 102 &connection->sent_packet_manager_, sequence_number); |
103 } | 103 } |
104 | 104 |
105 // static | 105 // static |
106 // TODO(ianswett): Create a GetSentEntropyHash which accepts an AckFrame. | 106 // TODO(ianswett): Create a GetSentEntropyHash which accepts an AckFrame. |
107 QuicPacketEntropyHash QuicConnectionPeer::GetSentEntropyHash( | 107 QuicPacketEntropyHash QuicConnectionPeer::GetSentEntropyHash( |
108 QuicConnection* connection, | 108 QuicConnection* connection, |
109 QuicPacketSequenceNumber sequence_number) { | 109 QuicPacketSequenceNumber sequence_number) { |
110 return connection->sent_entropy_manager_.EntropyHash(sequence_number); | 110 QuicSentEntropyManager::CumulativeEntropy last_entropy_copy = |
| 111 connection->sent_entropy_manager_.last_cumulative_entropy_; |
| 112 connection->sent_entropy_manager_.UpdateCumulativeEntropy(sequence_number, |
| 113 &last_entropy_copy); |
| 114 return last_entropy_copy.entropy; |
111 } | 115 } |
112 | 116 |
113 // static | 117 // static |
114 QuicPacketEntropyHash QuicConnectionPeer::PacketEntropy( | 118 QuicPacketEntropyHash QuicConnectionPeer::PacketEntropy( |
115 QuicConnection* connection, | 119 QuicConnection* connection, |
116 QuicPacketSequenceNumber sequence_number) { | 120 QuicPacketSequenceNumber sequence_number) { |
117 return | 121 return connection->sent_entropy_manager_.GetPacketEntropy(sequence_number); |
118 connection->sent_entropy_manager_.packets_entropy_[sequence_number].first; | |
119 } | 122 } |
120 | 123 |
121 // static | 124 // static |
122 QuicPacketEntropyHash QuicConnectionPeer::ReceivedEntropyHash( | 125 QuicPacketEntropyHash QuicConnectionPeer::ReceivedEntropyHash( |
123 QuicConnection* connection, | 126 QuicConnection* connection, |
124 QuicPacketSequenceNumber sequence_number) { | 127 QuicPacketSequenceNumber sequence_number) { |
125 return connection->received_packet_manager_.EntropyHash( | 128 return connection->received_packet_manager_.EntropyHash( |
126 sequence_number); | 129 sequence_number); |
127 } | 130 } |
128 | 131 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 } | 237 } |
235 | 238 |
236 // static | 239 // static |
237 void QuicConnectionPeer::SetSupportedVersions(QuicConnection* connection, | 240 void QuicConnectionPeer::SetSupportedVersions(QuicConnection* connection, |
238 QuicVersionVector versions) { | 241 QuicVersionVector versions) { |
239 connection->framer_.SetSupportedVersions(versions); | 242 connection->framer_.SetSupportedVersions(versions); |
240 } | 243 } |
241 | 244 |
242 } // namespace test | 245 } // namespace test |
243 } // namespace net | 246 } // namespace net |
OLD | NEW |