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

Side by Side Diff: net/quic/quic_received_packet_manager.h

Issue 420313005: Land Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0723
Patch Set: change QUIC packet size to 1350 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // Manages the packet entropy calculation for both sent and received packets 5 // Manages the packet entropy calculation for both sent and received packets
6 // for a connection. 6 // for a connection.
7 7
8 #ifndef NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_ 8 #ifndef NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_
9 #define NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_ 9 #define NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_
10 10
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 QuicTime receipt_time); 107 QuicTime receipt_time);
108 108
109 void RecordPacketRevived(QuicPacketSequenceNumber sequence_number); 109 void RecordPacketRevived(QuicPacketSequenceNumber sequence_number);
110 110
111 // Checks whether |sequence_number| is missing and less than largest observed. 111 // Checks whether |sequence_number| is missing and less than largest observed.
112 bool IsMissing(QuicPacketSequenceNumber sequence_number); 112 bool IsMissing(QuicPacketSequenceNumber sequence_number);
113 113
114 // Checks if we're still waiting for the packet with |sequence_number|. 114 // Checks if we're still waiting for the packet with |sequence_number|.
115 bool IsAwaitingPacket(QuicPacketSequenceNumber sequence_number); 115 bool IsAwaitingPacket(QuicPacketSequenceNumber sequence_number);
116 116
117 // Update the |received_info| for an outgoing ack. 117 // Update the |received_info| for an outgoing ack.
wtc 2014/08/04 23:28:13 |received_info| => |ack_frame|. Also fix line 134.
ramant (doing other things) 2014/08/09 02:53:19 Done.
118 void UpdateReceivedPacketInfo(ReceivedPacketInfo* received_info, 118 void UpdateReceivedPacketInfo(QuicAckFrame* ack_frame,
119 QuicTime approximate_now); 119 QuicTime approximate_now);
120 120
121 // Should be called before sending an ACK packet, to decide if we need 121 // Should be called before sending an ACK packet, to decide if we need
122 // to attach a QuicCongestionFeedbackFrame block. 122 // to attach a QuicCongestionFeedbackFrame block.
123 // Returns false if no QuicCongestionFeedbackFrame block is needed. 123 // Returns false if no QuicCongestionFeedbackFrame block is needed.
124 // Otherwise fills in feedback and returns true. 124 // Otherwise fills in feedback and returns true.
125 virtual bool GenerateCongestionFeedback( 125 virtual bool GenerateCongestionFeedback(
126 QuicCongestionFeedbackFrame* feedback); 126 QuicCongestionFeedbackFrame* feedback);
127 127
128 // QuicReceivedEntropyHashCalculatorInterface 128 // QuicReceivedEntropyHashCalculatorInterface
129 // Called by QuicFramer, when the outgoing ack gets truncated, to recalculate 129 // Called by QuicFramer, when the outgoing ack gets truncated, to recalculate
130 // the received entropy hash for the truncated ack frame. 130 // the received entropy hash for the truncated ack frame.
131 virtual QuicPacketEntropyHash EntropyHash( 131 virtual QuicPacketEntropyHash EntropyHash(
132 QuicPacketSequenceNumber sequence_number) const OVERRIDE; 132 QuicPacketSequenceNumber sequence_number) const OVERRIDE;
133 133
134 // Updates internal state based on |received_info|. 134 // Updates internal state based on |received_info|.
135 void UpdatePacketInformationReceivedByPeer( 135 void UpdatePacketInformationReceivedByPeer(const QuicAckFrame& ack_frame);
136 const ReceivedPacketInfo& received_nfo);
137 // Updates internal state based on |stop_waiting|. 136 // Updates internal state based on |stop_waiting|.
138 void UpdatePacketInformationSentByPeer( 137 void UpdatePacketInformationSentByPeer(
139 const QuicStopWaitingFrame& stop_waiting); 138 const QuicStopWaitingFrame& stop_waiting);
140 139
141 // Returns whether the peer is missing packets. 140 // Returns whether the peer is missing packets.
142 bool HasMissingPackets(); 141 bool HasMissingPackets();
143 142
144 // Returns true when there are new missing packets to be reported within 3 143 // Returns true when there are new missing packets to be reported within 3
145 // packets of the largest observed. 144 // packets of the largest observed.
146 bool HasNewMissingPackets(); 145 bool HasNewMissingPackets();
(...skipping 27 matching lines...) Expand all
174 // Largest sequence number that the peer has observed. Mostly received, 173 // Largest sequence number that the peer has observed. Mostly received,
175 // missing in case of truncated acks. 174 // missing in case of truncated acks.
176 QuicPacketSequenceNumber peer_largest_observed_packet_; 175 QuicPacketSequenceNumber peer_largest_observed_packet_;
177 // Least sequence number which the peer is still waiting for. 176 // Least sequence number which the peer is still waiting for.
178 QuicPacketSequenceNumber least_packet_awaited_by_peer_; 177 QuicPacketSequenceNumber least_packet_awaited_by_peer_;
179 // Least sequence number of the the packet sent by the peer for which it 178 // Least sequence number of the the packet sent by the peer for which it
180 // hasn't received an ack. 179 // hasn't received an ack.
181 QuicPacketSequenceNumber peer_least_packet_awaiting_ack_; 180 QuicPacketSequenceNumber peer_least_packet_awaiting_ack_;
182 181
183 // Received packet information used to produce acks. 182 // Received packet information used to produce acks.
184 ReceivedPacketInfo received_info_; 183 QuicAckFrame ack_frame_;
185 184
186 // The time we received the largest_observed sequence number, or zero if 185 // The time we received the largest_observed sequence number, or zero if
187 // no sequence numbers have been received since UpdateReceivedPacketInfo. 186 // no sequence numbers have been received since UpdateReceivedPacketInfo.
188 // Needed for calculating delta_time_largest_observed. 187 // Needed for calculating delta_time_largest_observed.
189 QuicTime time_largest_observed_; 188 QuicTime time_largest_observed_;
190 189
191 scoped_ptr<ReceiveAlgorithmInterface> receive_algorithm_; 190 scoped_ptr<ReceiveAlgorithmInterface> receive_algorithm_;
192 191
193 QuicConnectionStats* stats_; 192 QuicConnectionStats* stats_;
194 193
195 DISALLOW_COPY_AND_ASSIGN(QuicReceivedPacketManager); 194 DISALLOW_COPY_AND_ASSIGN(QuicReceivedPacketManager);
196 }; 195 };
197 196
198 } // namespace net 197 } // namespace net
199 198
200 #endif // NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_ 199 #endif // NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698