| 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 <deque> | 8 #include <deque> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // retransmitted, it will keep track of each version of a packet so that if a | 40 // retransmitted, it will keep track of each version of a packet so that if a |
| 41 // previous transmission is acked, the data will not be retransmitted. | 41 // previous transmission is acked, the data will not be retransmitted. |
| 42 class NET_EXPORT_PRIVATE QuicSentPacketManager { | 42 class NET_EXPORT_PRIVATE QuicSentPacketManager { |
| 43 public: | 43 public: |
| 44 // Struct to store the pending retransmission information. | 44 // Struct to store the pending retransmission information. |
| 45 struct PendingRetransmission { | 45 struct PendingRetransmission { |
| 46 PendingRetransmission(QuicPacketSequenceNumber sequence_number, | 46 PendingRetransmission(QuicPacketSequenceNumber sequence_number, |
| 47 TransmissionType transmission_type, | 47 TransmissionType transmission_type, |
| 48 const RetransmittableFrames& retransmittable_frames, | 48 const RetransmittableFrames& retransmittable_frames, |
| 49 QuicSequenceNumberLength sequence_number_length) | 49 QuicSequenceNumberLength sequence_number_length) |
| 50 : sequence_number(sequence_number), | 50 : sequence_number(sequence_number), |
| 51 transmission_type(transmission_type), | 51 transmission_type(transmission_type), |
| 52 retransmittable_frames(retransmittable_frames), | 52 retransmittable_frames(retransmittable_frames), |
| 53 sequence_number_length(sequence_number_length) { | 53 sequence_number_length(sequence_number_length) {} |
| 54 } | |
| 55 | 54 |
| 56 QuicPacketSequenceNumber sequence_number; | 55 QuicPacketSequenceNumber sequence_number; |
| 57 TransmissionType transmission_type; | 56 TransmissionType transmission_type; |
| 58 const RetransmittableFrames& retransmittable_frames; | 57 const RetransmittableFrames& retransmittable_frames; |
| 59 QuicSequenceNumberLength sequence_number_length; | 58 QuicSequenceNumberLength sequence_number_length; |
| 60 }; | 59 }; |
| 61 | 60 |
| 62 QuicSentPacketManager(bool is_server, | 61 QuicSentPacketManager(bool is_server, |
| 63 const QuicClock* clock, | 62 const QuicClock* clock, |
| 64 QuicConnectionStats* stats, | 63 QuicConnectionStats* stats, |
| 65 CongestionFeedbackType congestion_type, | 64 CongestionFeedbackType congestion_type, |
| 66 LossDetectionType loss_type); | 65 LossDetectionType loss_type); |
| 67 virtual ~QuicSentPacketManager(); | 66 virtual ~QuicSentPacketManager(); |
| 68 | 67 |
| 69 virtual void SetFromConfig(const QuicConfig& config); | 68 virtual void SetFromConfig(const QuicConfig& config); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 RTO_MODE, | 181 RTO_MODE, |
| 183 // A tail loss probe. By default, QUIC sends up to two before RTOing. | 182 // A tail loss probe. By default, QUIC sends up to two before RTOing. |
| 184 TLP_MODE, | 183 TLP_MODE, |
| 185 // Retransmission of handshake packets prior to handshake completion. | 184 // Retransmission of handshake packets prior to handshake completion. |
| 186 HANDSHAKE_MODE, | 185 HANDSHAKE_MODE, |
| 187 // Re-invoke the loss detection when a packet is not acked before the | 186 // Re-invoke the loss detection when a packet is not acked before the |
| 188 // loss detection algorithm expects. | 187 // loss detection algorithm expects. |
| 189 LOSS_MODE, | 188 LOSS_MODE, |
| 190 }; | 189 }; |
| 191 | 190 |
| 192 typedef linked_hash_map<QuicPacketSequenceNumber, | 191 typedef linked_hash_map<QuicPacketSequenceNumber, TransmissionType> |
| 193 TransmissionType> PendingRetransmissionMap; | 192 PendingRetransmissionMap; |
| 194 | 193 |
| 195 // Process the incoming ack looking for newly ack'd data packets. | 194 // Process the incoming ack looking for newly ack'd data packets. |
| 196 void HandleAckForSentPackets(const ReceivedPacketInfo& received_info); | 195 void HandleAckForSentPackets(const ReceivedPacketInfo& received_info); |
| 197 | 196 |
| 198 // Called when a packet is timed out, such as an RTO. Removes the bytes from | 197 // Called when a packet is timed out, such as an RTO. Removes the bytes from |
| 199 // the congestion manager, but does not change the congestion window size. | 198 // the congestion manager, but does not change the congestion window size. |
| 200 void OnPacketAbandoned(QuicPacketSequenceNumber sequence_number); | 199 void OnPacketAbandoned(QuicPacketSequenceNumber sequence_number); |
| 201 | 200 |
| 202 // Returns the current retransmission mode. | 201 // Returns the current retransmission mode. |
| 203 RetransmissionTimeoutMode GetRetransmissionMode() const; | 202 RetransmissionTimeoutMode GetRetransmissionMode() const; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // Maximum number of tail loss probes to send before firing an RTO. | 289 // Maximum number of tail loss probes to send before firing an RTO. |
| 291 size_t max_tail_loss_probes_; | 290 size_t max_tail_loss_probes_; |
| 292 bool using_pacing_; | 291 bool using_pacing_; |
| 293 | 292 |
| 294 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 293 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
| 295 }; | 294 }; |
| 296 | 295 |
| 297 } // namespace net | 296 } // namespace net |
| 298 | 297 |
| 299 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 298 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
| OLD | NEW |