OLD | NEW |
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 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 5 #ifndef NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 6 #define NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // Removes the retransmittable frames from all unencrypted packets to ensure | 113 // Removes the retransmittable frames from all unencrypted packets to ensure |
114 // they don't get retransmitted. | 114 // they don't get retransmitted. |
115 void NeuterUnencryptedPackets() override; | 115 void NeuterUnencryptedPackets() override; |
116 | 116 |
117 // Returns true if there are pending retransmissions. | 117 // Returns true if there are pending retransmissions. |
118 // Not const because retransmissions may be cancelled before returning. | 118 // Not const because retransmissions may be cancelled before returning. |
119 bool HasPendingRetransmissions() const override; | 119 bool HasPendingRetransmissions() const override; |
120 | 120 |
121 // Retrieves the next pending retransmission. You must ensure that | 121 // Retrieves the next pending retransmission. You must ensure that |
122 // there are pending retransmissions prior to calling this function. | 122 // there are pending retransmissions prior to calling this function. |
123 PendingRetransmission NextPendingRetransmission() override; | 123 QuicPendingRetransmission NextPendingRetransmission() override; |
124 | 124 |
125 bool HasUnackedPackets() const override; | 125 bool HasUnackedPackets() const override; |
126 | 126 |
127 // Returns the smallest packet number of a serialized packet which has not | 127 // Returns the smallest packet number of a serialized packet which has not |
128 // been acked by the peer. | 128 // been acked by the peer. |
129 QuicPacketNumber GetLeastUnacked(QuicPathId) const override; | 129 QuicPacketNumber GetLeastUnacked(QuicPathId) const override; |
130 | 130 |
131 // Called when we have sent bytes to the peer. This informs the manager both | 131 // Called when we have sent bytes to the peer. This informs the manager both |
132 // the number of bytes sent and if they were retransmitted. Returns true if | 132 // the number of bytes sent and if they were retransmitted. Returns true if |
133 // the sender should reset the retransmission timer. | 133 // the sender should reset the retransmission timer. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 // Returns the timer for a new tail loss probe. | 251 // Returns the timer for a new tail loss probe. |
252 const QuicTime::Delta GetTailLossProbeDelay() const; | 252 const QuicTime::Delta GetTailLossProbeDelay() const; |
253 | 253 |
254 // Returns the retransmission timeout, after which a full RTO occurs. | 254 // Returns the retransmission timeout, after which a full RTO occurs. |
255 const QuicTime::Delta GetRetransmissionDelay() const; | 255 const QuicTime::Delta GetRetransmissionDelay() const; |
256 | 256 |
257 // Returns the newest transmission associated with a packet. | 257 // Returns the newest transmission associated with a packet. |
258 QuicPacketNumber GetNewestRetransmission( | 258 QuicPacketNumber GetNewestRetransmission( |
259 QuicPacketNumber packet_number, | 259 QuicPacketNumber packet_number, |
260 const TransmissionInfo& transmission_info) const; | 260 const QuicTransmissionInfo& transmission_info) const; |
261 | 261 |
262 // Update the RTT if the ack is for the largest acked packet number. | 262 // Update the RTT if the ack is for the largest acked packet number. |
263 // Returns true if the rtt was updated. | 263 // Returns true if the rtt was updated. |
264 bool MaybeUpdateRTT(const QuicAckFrame& ack_frame, QuicTime ack_receive_time); | 264 bool MaybeUpdateRTT(const QuicAckFrame& ack_frame, QuicTime ack_receive_time); |
265 | 265 |
266 // Invokes the loss detection algorithm and loses and retransmits packets if | 266 // Invokes the loss detection algorithm and loses and retransmits packets if |
267 // necessary. | 267 // necessary. |
268 void InvokeLossDetection(QuicTime time); | 268 void InvokeLossDetection(QuicTime time); |
269 | 269 |
270 // Invokes OnCongestionEvent if |rtt_updated| is true, there are pending acks, | 270 // Invokes OnCongestionEvent if |rtt_updated| is true, there are pending acks, |
(...skipping 13 matching lines...) Expand all Loading... |
284 // landed. | 284 // landed. |
285 // The packet needs no longer to be retransmitted, but the packet remains | 285 // The packet needs no longer to be retransmitted, but the packet remains |
286 // pending if it is and the congestion control does not consider the packet | 286 // pending if it is and the congestion control does not consider the packet |
287 // acked. | 287 // acked. |
288 void MarkPacketNotRetransmittable(QuicPacketNumber packet_number, | 288 void MarkPacketNotRetransmittable(QuicPacketNumber packet_number, |
289 QuicTime::Delta ack_delay_time); | 289 QuicTime::Delta ack_delay_time); |
290 | 290 |
291 // Removes the retransmittability and in flight properties from the packet at | 291 // Removes the retransmittability and in flight properties from the packet at |
292 // |info| due to receipt by the peer. | 292 // |info| due to receipt by the peer. |
293 void MarkPacketHandled(QuicPacketNumber packet_number, | 293 void MarkPacketHandled(QuicPacketNumber packet_number, |
294 TransmissionInfo* info, | 294 QuicTransmissionInfo* info, |
295 QuicTime::Delta ack_delay_time); | 295 QuicTime::Delta ack_delay_time); |
296 | 296 |
297 // Request that |packet_number| be retransmitted after the other pending | 297 // Request that |packet_number| be retransmitted after the other pending |
298 // retransmissions. Does not add it to the retransmissions if it's already | 298 // retransmissions. Does not add it to the retransmissions if it's already |
299 // a pending retransmission. | 299 // a pending retransmission. |
300 void MarkForRetransmission(QuicPacketNumber packet_number, | 300 void MarkForRetransmission(QuicPacketNumber packet_number, |
301 TransmissionType transmission_type); | 301 TransmissionType transmission_type); |
302 | 302 |
303 // Notify observers that packet with TransmissionInfo |info| is a spurious | 303 // Notify observers that packet with QuicTransmissionInfo |info| is a spurious |
304 // retransmission. It is caller's responsibility to guarantee the packet with | 304 // retransmission. It is caller's responsibility to guarantee the packet with |
305 // TransmissionInfo |info| is a spurious retransmission before calling this | 305 // QuicTransmissionInfo |info| is a spurious retransmission before calling |
306 // function. | 306 // this function. |
307 void RecordOneSpuriousRetransmission(const TransmissionInfo& info); | 307 void RecordOneSpuriousRetransmission(const QuicTransmissionInfo& info); |
308 | 308 |
309 // Notify observers about spurious retransmits of packet with TransmissionInfo | 309 // Notify observers about spurious retransmits of packet with |
310 // |info|. | 310 // QuicTransmissionInfo |info|. |
311 void RecordSpuriousRetransmissions(const TransmissionInfo& info, | 311 void RecordSpuriousRetransmissions(const QuicTransmissionInfo& info, |
312 QuicPacketNumber acked_packet_number); | 312 QuicPacketNumber acked_packet_number); |
313 | 313 |
314 // Returns mutable TransmissionInfo associated with |packet_number|, which | 314 // Returns mutable QuicTransmissionInfo associated with |packet_number|, which |
315 // must be unacked. | 315 // must be unacked. |
316 TransmissionInfo* GetMutableTransmissionInfo(QuicPacketNumber packet_number); | 316 QuicTransmissionInfo* GetMutableTransmissionInfo( |
| 317 QuicPacketNumber packet_number); |
317 | 318 |
318 // Remove any packets no longer needed for retransmission, congestion, or | 319 // Remove any packets no longer needed for retransmission, congestion, or |
319 // RTT measurement purposes. | 320 // RTT measurement purposes. |
320 void RemoveObsoletePackets(); | 321 void RemoveObsoletePackets(); |
321 | 322 |
322 // Sets the send algorithm to the given congestion control type and points the | 323 // Sets the send algorithm to the given congestion control type and points the |
323 // pacing sender at |send_algorithm_|. Can be called any number of times. | 324 // pacing sender at |send_algorithm_|. Can be called any number of times. |
324 void SetSendAlgorithm(CongestionControlType congestion_control_type); | 325 void SetSendAlgorithm(CongestionControlType congestion_control_type); |
325 | 326 |
326 // Sets the send algorithm to |send_algorithm| and points the pacing sender at | 327 // Sets the send algorithm to |send_algorithm| and points the pacing sender at |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 // Records bandwidth from server to client in normal operation, over periods | 415 // Records bandwidth from server to client in normal operation, over periods |
415 // of time with no loss events. | 416 // of time with no loss events. |
416 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; | 417 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; |
417 | 418 |
418 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 419 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
419 }; | 420 }; |
420 | 421 |
421 } // namespace net | 422 } // namespace net |
422 | 423 |
423 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 424 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
OLD | NEW |