Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: net/quic/test_tools/quic_connection_peer.cc

Issue 479543004: Convert QUIC's SentEntropyManager to use a deque instead of a map in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@send_updated_bandwidth_estimates_73579021
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_sent_entropy_manager_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 } 236 }
234 237
235 // static 238 // static
236 void QuicConnectionPeer::SetSupportedVersions(QuicConnection* connection, 239 void QuicConnectionPeer::SetSupportedVersions(QuicConnection* connection,
237 QuicVersionVector versions) { 240 QuicVersionVector versions) {
238 connection->framer_.SetSupportedVersions(versions); 241 connection->framer_.SetSupportedVersions(versions);
239 } 242 }
240 243
241 } // namespace test 244 } // namespace test
242 } // namespace net 245 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_sent_entropy_manager_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698