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/core/congestion_control/send_algorithm_interface.h" | 8 #include "net/quic/core/congestion_control/send_algorithm_interface.h" |
9 #include "net/quic/core/quic_multipath_sent_packet_manager.h" | 9 #include "net/quic/core/quic_multipath_sent_packet_manager.h" |
10 #include "net/quic/core/quic_packet_writer.h" | 10 #include "net/quic/core/quic_packet_writer.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 connection->sent_packet_manager_.get()); | 83 connection->sent_packet_manager_.get()); |
84 } | 84 } |
85 | 85 |
86 // static | 86 // static |
87 QuicTime::Delta QuicConnectionPeer::GetNetworkTimeout( | 87 QuicTime::Delta QuicConnectionPeer::GetNetworkTimeout( |
88 QuicConnection* connection) { | 88 QuicConnection* connection) { |
89 return connection->idle_network_timeout_; | 89 return connection->idle_network_timeout_; |
90 } | 90 } |
91 | 91 |
92 // static | 92 // static |
93 QuicSentEntropyManager* QuicConnectionPeer::GetSentEntropyManager( | |
94 QuicConnection* connection) { | |
95 return &connection->sent_entropy_manager_; | |
96 } | |
97 | |
98 // static | |
99 // TODO(ianswett): Create a GetSentEntropyHash which accepts an AckFrame. | |
100 QuicPacketEntropyHash QuicConnectionPeer::GetSentEntropyHash( | |
101 QuicConnection* connection, | |
102 QuicPacketNumber packet_number) { | |
103 QuicSentEntropyManager::CumulativeEntropy last_entropy_copy = | |
104 connection->sent_entropy_manager_.last_cumulative_entropy_; | |
105 connection->sent_entropy_manager_.UpdateCumulativeEntropy(packet_number, | |
106 &last_entropy_copy); | |
107 return last_entropy_copy.entropy; | |
108 } | |
109 | |
110 // static | |
111 QuicPacketEntropyHash QuicConnectionPeer::PacketEntropy( | |
112 QuicConnection* connection, | |
113 QuicPacketNumber packet_number) { | |
114 return connection->sent_entropy_manager_.GetPacketEntropy(packet_number); | |
115 } | |
116 | |
117 // static | |
118 QuicPacketEntropyHash QuicConnectionPeer::ReceivedEntropyHash( | |
119 QuicConnection* connection, | |
120 QuicPacketNumber packet_number) { | |
121 return connection->received_packet_manager_.EntropyHash(packet_number); | |
122 } | |
123 | |
124 // static | |
125 void QuicConnectionPeer::SetPerspective(QuicConnection* connection, | 93 void QuicConnectionPeer::SetPerspective(QuicConnection* connection, |
126 Perspective perspective) { | 94 Perspective perspective) { |
127 connection->perspective_ = perspective; | 95 connection->perspective_ = perspective; |
128 QuicFramerPeer::SetPerspective(&connection->framer_, perspective); | 96 QuicFramerPeer::SetPerspective(&connection->framer_, perspective); |
129 } | 97 } |
130 | 98 |
131 // static | 99 // static |
132 void QuicConnectionPeer::SetSelfAddress(QuicConnection* connection, | 100 void QuicConnectionPeer::SetSelfAddress(QuicConnection* connection, |
133 const IPEndPoint& self_address) { | 101 const IPEndPoint& self_address) { |
134 connection->self_address_ = self_address; | 102 connection->self_address_ = self_address; |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 bool QuicConnectionPeer::HasRetransmittableFrames( | 271 bool QuicConnectionPeer::HasRetransmittableFrames( |
304 QuicConnection* connection, | 272 QuicConnection* connection, |
305 QuicPathId path_id, | 273 QuicPathId path_id, |
306 QuicPacketNumber packet_number) { | 274 QuicPacketNumber packet_number) { |
307 return QuicSentPacketManagerPeer::HasRetransmittableFrames( | 275 return QuicSentPacketManagerPeer::HasRetransmittableFrames( |
308 GetSentPacketManager(connection, path_id), packet_number); | 276 GetSentPacketManager(connection, path_id), packet_number); |
309 } | 277 } |
310 | 278 |
311 } // namespace test | 279 } // namespace test |
312 } // namespace net | 280 } // namespace net |
OLD | NEW |