| 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> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <set> | 12 #include <set> |
| 13 #include <utility> | 13 #include <utility> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "net/base/linked_hash_map.h" | 17 #include "net/base/linked_hash_map.h" |
| 18 #include "net/quic/congestion_control/loss_detection_interface.h" | 18 #include "net/quic/congestion_control/loss_detection_interface.h" |
| 19 #include "net/quic/congestion_control/rtt_stats.h" | 19 #include "net/quic/congestion_control/rtt_stats.h" |
| 20 #include "net/quic/congestion_control/send_algorithm_interface.h" | 20 #include "net/quic/congestion_control/send_algorithm_interface.h" |
| 21 #include "net/quic/quic_protocol.h" | 21 #include "net/quic/quic_protocol.h" |
| 22 #include "net/quic/quic_sustained_bandwidth_recorder.h" | 22 #include "net/quic/quic_sent_packet_manager_interface.h" |
| 23 #include "net/quic/quic_unacked_packet_map.h" | 23 #include "net/quic/quic_unacked_packet_map.h" |
| 24 | 24 |
| 25 namespace net { | 25 namespace net { |
| 26 | 26 |
| 27 namespace test { | 27 namespace test { |
| 28 class QuicConnectionPeer; | 28 class QuicConnectionPeer; |
| 29 class QuicSentPacketManagerPeer; | 29 class QuicSentPacketManagerPeer; |
| 30 } // namespace test | 30 } // namespace test |
| 31 | 31 |
| 32 class QuicClock; | 32 class QuicClock; |
| 33 class QuicConfig; | 33 class QuicConfig; |
| 34 struct QuicConnectionStats; | 34 struct QuicConnectionStats; |
| 35 | 35 |
| 36 // Class which tracks the set of packets sent on a QUIC connection and contains | 36 // Class which tracks the set of packets sent on a QUIC connection and contains |
| 37 // a send algorithm to decide when to send new packets. It keeps track of any | 37 // a send algorithm to decide when to send new packets. It keeps track of any |
| 38 // retransmittable data associated with each packet. If a packet is | 38 // retransmittable data associated with each packet. If a packet is |
| 39 // retransmitted, it will keep track of each version of a packet so that if a | 39 // retransmitted, it will keep track of each version of a packet so that if a |
| 40 // previous transmission is acked, the data will not be retransmitted. | 40 // previous transmission is acked, the data will not be retransmitted. |
| 41 class NET_EXPORT_PRIVATE QuicSentPacketManager { | 41 class NET_EXPORT_PRIVATE QuicSentPacketManager |
| 42 : public QuicSentPacketManagerInterface { |
| 42 public: | 43 public: |
| 43 // A delegate interface which manages pending retransmissions. | 44 // A delegate interface which manages pending retransmissions. |
| 44 class MultipathDelegateInterface { | 45 class MultipathDelegateInterface { |
| 45 public: | 46 public: |
| 46 virtual ~MultipathDelegateInterface() {} | 47 virtual ~MultipathDelegateInterface() {} |
| 47 | 48 |
| 48 // Called when unencrypted |packet_number| is requested to be neutered. | 49 // Called when unencrypted |packet_number| is requested to be neutered. |
| 49 virtual void OnUnencryptedPacketsNeutered( | 50 virtual void OnUnencryptedPacketsNeutered( |
| 50 QuicPathId path_id, | 51 QuicPathId path_id, |
| 51 QuicPacketNumber packet_number) = 0; | 52 QuicPacketNumber packet_number) = 0; |
| 52 // Called when |packet_number| is requested to be retransmitted. | 53 // Called when |packet_number| is requested to be retransmitted. |
| 53 virtual void OnRetransmissionMarked(QuicPathId path_id, | 54 virtual void OnRetransmissionMarked(QuicPathId path_id, |
| 54 QuicPacketNumber packet_number, | 55 QuicPacketNumber packet_number, |
| 55 TransmissionType transmission_type) = 0; | 56 TransmissionType transmission_type) = 0; |
| 56 // Called when |packet_number| is marked as not retransmittable. | 57 // Called when |packet_number| is marked as not retransmittable. |
| 57 virtual void OnPacketMarkedNotRetransmittable( | 58 virtual void OnPacketMarkedNotRetransmittable( |
| 58 QuicPathId path_id, | 59 QuicPathId path_id, |
| 59 QuicPacketNumber packet_number, | 60 QuicPacketNumber packet_number, |
| 60 QuicTime::Delta delta_largest_observed) = 0; | 61 QuicTime::Delta delta_largest_observed) = 0; |
| 61 // Called when any transmission of |packet_number| is handled. | 62 // Called when any transmission of |packet_number| is handled. |
| 62 virtual void OnPacketMarkedHandled( | 63 virtual void OnPacketMarkedHandled( |
| 63 QuicPathId path_id, | 64 QuicPathId path_id, |
| 64 QuicPacketNumber packet_number, | 65 QuicPacketNumber packet_number, |
| 65 QuicTime::Delta delta_largest_observed) = 0; | 66 QuicTime::Delta delta_largest_observed) = 0; |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 // Interface which gets callbacks from the QuicSentPacketManager at | |
| 69 // interesting points. Implementations must not mutate the state of | |
| 70 // the packet manager or connection as a result of these callbacks. | |
| 71 class NET_EXPORT_PRIVATE DebugDelegate { | |
| 72 public: | |
| 73 virtual ~DebugDelegate() {} | |
| 74 | |
| 75 // Called when a spurious retransmission is detected. | |
| 76 virtual void OnSpuriousPacketRetransmission( | |
| 77 TransmissionType transmission_type, | |
| 78 QuicByteCount byte_size) {} | |
| 79 | |
| 80 virtual void OnIncomingAck(const QuicAckFrame& ack_frame, | |
| 81 QuicTime ack_receive_time, | |
| 82 QuicPacketNumber largest_observed, | |
| 83 bool rtt_updated, | |
| 84 QuicPacketNumber least_unacked_sent_packet) {} | |
| 85 | |
| 86 virtual void OnPacketLoss(QuicPacketNumber lost_packet_number, | |
| 87 TransmissionType transmission_type, | |
| 88 QuicTime detection_time) {} | |
| 89 }; | |
| 90 | |
| 91 // Interface which gets callbacks from the QuicSentPacketManager when | |
| 92 // network-related state changes. Implementations must not mutate the | |
| 93 // state of the packet manager as a result of these callbacks. | |
| 94 class NET_EXPORT_PRIVATE NetworkChangeVisitor { | |
| 95 public: | |
| 96 virtual ~NetworkChangeVisitor() {} | |
| 97 | |
| 98 // Called when congestion window or RTT may have changed. | |
| 99 virtual void OnCongestionChange() = 0; | |
| 100 | |
| 101 // Called with the path may be degrading. Note that the path may only be | |
| 102 // temporarily degrading. | |
| 103 // TODO(jri): With multipath, this method should probably have a path_id | |
| 104 // parameter, and should maybe result in the path being marked as inactive. | |
| 105 virtual void OnPathDegrading() = 0; | |
| 106 }; | |
| 107 | |
| 108 QuicSentPacketManager(Perspective perspective, | 69 QuicSentPacketManager(Perspective perspective, |
| 109 QuicPathId path_id, | 70 QuicPathId path_id, |
| 110 const QuicClock* clock, | 71 const QuicClock* clock, |
| 111 QuicConnectionStats* stats, | 72 QuicConnectionStats* stats, |
| 112 CongestionControlType congestion_control_type, | 73 CongestionControlType congestion_control_type, |
| 113 LossDetectionType loss_type, | 74 LossDetectionType loss_type, |
| 114 MultipathDelegateInterface* delegate); | 75 MultipathDelegateInterface* delegate); |
| 115 virtual ~QuicSentPacketManager(); | 76 ~QuicSentPacketManager() override; |
| 116 | 77 |
| 117 virtual void SetFromConfig(const QuicConfig& config); | 78 // Start implementation of QuicSentPacketManagerInterface. |
| 79 void SetFromConfig(const QuicConfig& config) override; |
| 118 | 80 |
| 119 // Pass the CachedNetworkParameters to the send algorithm. | 81 // Pass the CachedNetworkParameters to the send algorithm. |
| 120 void ResumeConnectionState( | 82 void ResumeConnectionState( |
| 121 const CachedNetworkParameters& cached_network_params, | 83 const CachedNetworkParameters& cached_network_params, |
| 122 bool max_bandwidth_resumption); | 84 bool max_bandwidth_resumption) override; |
| 123 | 85 |
| 124 void SetNumOpenStreams(size_t num_streams); | 86 void SetNumOpenStreams(size_t num_streams) override; |
| 125 | 87 |
| 126 void SetMaxPacingRate(QuicBandwidth max_pacing_rate); | 88 void SetMaxPacingRate(QuicBandwidth max_pacing_rate) override; |
| 127 | 89 |
| 128 void SetHandshakeConfirmed() { handshake_confirmed_ = true; } | 90 void SetHandshakeConfirmed() override; |
| 129 | 91 |
| 130 // Processes the incoming ack. | 92 // Processes the incoming ack. |
| 131 void OnIncomingAck(const QuicAckFrame& ack_frame, QuicTime ack_receive_time); | 93 void OnIncomingAck(const QuicAckFrame& ack_frame, |
| 94 QuicTime ack_receive_time) override; |
| 132 | 95 |
| 133 // Returns true if packet |packet_number| is unacked. | 96 // Returns true if packet |packet_number| is unacked. |
| 134 bool IsUnacked(QuicPacketNumber packet_number) const; | 97 bool IsUnacked(QuicPathId, QuicPacketNumber packet_number) const override; |
| 135 | 98 |
| 136 // Requests retransmission of all unacked packets of |retransmission_type|. | 99 // Requests retransmission of all unacked packets of |retransmission_type|. |
| 137 // The behavior of this method depends on the value of |retransmission_type|: | 100 // The behavior of this method depends on the value of |retransmission_type|: |
| 138 // ALL_UNACKED_RETRANSMISSION - All unacked packets will be retransmitted. | 101 // ALL_UNACKED_RETRANSMISSION - All unacked packets will be retransmitted. |
| 139 // This can happen, for example, after a version negotiation packet has been | 102 // This can happen, for example, after a version negotiation packet has been |
| 140 // received and all packets needs to be retransmitted with the new version. | 103 // received and all packets needs to be retransmitted with the new version. |
| 141 // ALL_INITIAL_RETRANSMISSION - Only initially encrypted packets will be | 104 // ALL_INITIAL_RETRANSMISSION - Only initially encrypted packets will be |
| 142 // retransmitted. This can happen, for example, when a CHLO has been rejected | 105 // retransmitted. This can happen, for example, when a CHLO has been rejected |
| 143 // and the previously encrypted data needs to be encrypted with a new key. | 106 // and the previously encrypted data needs to be encrypted with a new key. |
| 144 void RetransmitUnackedPackets(TransmissionType retransmission_type); | 107 void RetransmitUnackedPackets(TransmissionType retransmission_type) override; |
| 145 | 108 |
| 146 // Retransmits the oldest pending packet there is still a tail loss probe | 109 // Retransmits the oldest pending packet there is still a tail loss probe |
| 147 // pending. Invoked after OnRetransmissionTimeout. | 110 // pending. Invoked after OnRetransmissionTimeout. |
| 148 bool MaybeRetransmitTailLossProbe(); | 111 bool MaybeRetransmitTailLossProbe() override; |
| 149 | 112 |
| 150 // Removes the retransmittable frames from all unencrypted packets to ensure | 113 // Removes the retransmittable frames from all unencrypted packets to ensure |
| 151 // they don't get retransmitted. | 114 // they don't get retransmitted. |
| 152 void NeuterUnencryptedPackets(); | 115 void NeuterUnencryptedPackets() override; |
| 153 | 116 |
| 154 // Returns true if the unacked packet |packet_number| has retransmittable | 117 // Returns true if the unacked packet |packet_number| has retransmittable |
| 155 // frames. This will only return false if the packet has been acked, if a | 118 // frames. This will only return false if the packet has been acked, if a |
| 156 // previous transmission of this packet was ACK'd, or if this packet has been | 119 // previous transmission of this packet was ACK'd, or if this packet has been |
| 157 // retransmitted as with different packet number. | 120 // retransmitted as with different packet number. |
| 158 bool HasRetransmittableFrames(QuicPacketNumber packet_number) const; | 121 bool HasRetransmittableFrames(QuicPathId, |
| 122 QuicPacketNumber packet_number) const override; |
| 159 | 123 |
| 160 // Returns true if there are pending retransmissions. | 124 // Returns true if there are pending retransmissions. |
| 161 // Not const because retransmissions may be cancelled before returning. | 125 // Not const because retransmissions may be cancelled before returning. |
| 162 bool HasPendingRetransmissions() const; | 126 bool HasPendingRetransmissions() const override; |
| 163 | 127 |
| 164 // Retrieves the next pending retransmission. You must ensure that | 128 // Retrieves the next pending retransmission. You must ensure that |
| 165 // there are pending retransmissions prior to calling this function. | 129 // there are pending retransmissions prior to calling this function. |
| 166 PendingRetransmission NextPendingRetransmission(); | 130 PendingRetransmission NextPendingRetransmission() override; |
| 167 | 131 |
| 168 bool HasUnackedPackets() const; | 132 bool HasUnackedPackets() const override; |
| 169 | 133 |
| 170 // Returns the smallest packet number of a serialized packet which has not | 134 // Returns the smallest packet number of a serialized packet which has not |
| 171 // been acked by the peer. | 135 // been acked by the peer. |
| 172 QuicPacketNumber GetLeastUnacked() const; | 136 QuicPacketNumber GetLeastUnacked(QuicPathId) const override; |
| 173 | 137 |
| 174 // Called when we have sent bytes to the peer. This informs the manager both | 138 // Called when we have sent bytes to the peer. This informs the manager both |
| 175 // the number of bytes sent and if they were retransmitted. Returns true if | 139 // the number of bytes sent and if they were retransmitted. Returns true if |
| 176 // the sender should reset the retransmission timer. | 140 // the sender should reset the retransmission timer. |
| 177 virtual bool OnPacketSent(SerializedPacket* serialized_packet, | 141 bool OnPacketSent(SerializedPacket* serialized_packet, |
| 178 QuicPathId /*original_path_id*/, | 142 QuicPathId /*original_path_id*/, |
| 179 QuicPacketNumber original_packet_number, | 143 QuicPacketNumber original_packet_number, |
| 180 QuicTime sent_time, | 144 QuicTime sent_time, |
| 181 TransmissionType transmission_type, | 145 TransmissionType transmission_type, |
| 182 HasRetransmittableData has_retransmittable_data); | 146 HasRetransmittableData has_retransmittable_data) override; |
| 183 | 147 |
| 184 // Called when the retransmission timer expires. | 148 // Called when the retransmission timer expires. |
| 185 virtual void OnRetransmissionTimeout(); | 149 void OnRetransmissionTimeout() override; |
| 186 | 150 |
| 187 // Calculate the time until we can send the next packet to the wire. | 151 // Calculate the time until we can send the next packet to the wire. |
| 188 // Note 1: When kUnknownWaitTime is returned, there is no need to poll | 152 // Note 1: When kUnknownWaitTime is returned, there is no need to poll |
| 189 // TimeUntilSend again until we receive an OnIncomingAckFrame event. | 153 // TimeUntilSend again until we receive an OnIncomingAckFrame event. |
| 190 // Note 2: Send algorithms may or may not use |retransmit| in their | 154 // Note 2: Send algorithms may or may not use |retransmit| in their |
| 191 // calculations. | 155 // calculations. |
| 192 virtual QuicTime::Delta TimeUntilSend(QuicTime now, | 156 QuicTime::Delta TimeUntilSend(QuicTime now, |
| 193 HasRetransmittableData retransmittable); | 157 HasRetransmittableData retransmittable, |
| 194 | 158 QuicPathId* path_id) override; |
| 195 // Returns amount of time for delayed ack timer. | |
| 196 const QuicTime::Delta DelayedAckTime() const; | |
| 197 | 159 |
| 198 // Returns the current delay for the retransmission timer, which may send | 160 // Returns the current delay for the retransmission timer, which may send |
| 199 // either a tail loss probe or do a full RTO. Returns QuicTime::Zero() if | 161 // either a tail loss probe or do a full RTO. Returns QuicTime::Zero() if |
| 200 // there are no retransmittable packets. | 162 // there are no retransmittable packets. |
| 201 const QuicTime GetRetransmissionTime() const; | 163 const QuicTime GetRetransmissionTime() const override; |
| 202 | 164 |
| 203 const RttStats* GetRttStats() const; | 165 const RttStats* GetRttStats() const override; |
| 204 | 166 |
| 205 // Returns the estimated bandwidth calculated by the congestion algorithm. | 167 // Returns the estimated bandwidth calculated by the congestion algorithm. |
| 206 QuicBandwidth BandwidthEstimate() const; | 168 QuicBandwidth BandwidthEstimate() const override; |
| 207 | 169 |
| 208 const QuicSustainedBandwidthRecorder& SustainedBandwidthRecorder() const; | 170 const QuicSustainedBandwidthRecorder& SustainedBandwidthRecorder() |
| 171 const override; |
| 209 | 172 |
| 210 // Returns the size of the current congestion window in number of | 173 // Returns the size of the current congestion window in number of |
| 211 // kDefaultTCPMSS-sized segments. Note, this is not the *available* window. | 174 // kDefaultTCPMSS-sized segments. Note, this is not the *available* window. |
| 212 // Some send algorithms may not use a congestion window and will return 0. | 175 // Some send algorithms may not use a congestion window and will return 0. |
| 213 QuicPacketCount GetCongestionWindowInTcpMss() const; | 176 QuicPacketCount GetCongestionWindowInTcpMss() const override; |
| 214 | 177 |
| 215 // Returns the number of packets of length |max_packet_length| which fit in | 178 // Returns the number of packets of length |max_packet_length| which fit in |
| 216 // the current congestion window. More packets may end up in flight if the | 179 // the current congestion window. More packets may end up in flight if the |
| 217 // congestion window has been recently reduced, of if non-full packets are | 180 // congestion window has been recently reduced, of if non-full packets are |
| 218 // sent. | 181 // sent. |
| 219 QuicPacketCount EstimateMaxPacketsInFlight( | 182 QuicPacketCount EstimateMaxPacketsInFlight( |
| 220 QuicByteCount max_packet_length) const; | 183 QuicByteCount max_packet_length) const override; |
| 221 | 184 |
| 222 // Returns the size of the current congestion window size in bytes. | 185 // Returns the size of the current congestion window size in bytes. |
| 223 QuicByteCount GetCongestionWindowInBytes() const; | 186 QuicByteCount GetCongestionWindowInBytes() const override; |
| 224 | 187 |
| 225 // Returns the size of the slow start congestion window in nume of 1460 byte | 188 // Returns the size of the slow start congestion window in nume of 1460 byte |
| 226 // TCP segments, aka ssthresh. Some send algorithms do not define a slow | 189 // TCP segments, aka ssthresh. Some send algorithms do not define a slow |
| 227 // start threshold and will return 0. | 190 // start threshold and will return 0. |
| 228 QuicPacketCount GetSlowStartThresholdInTcpMss() const; | 191 QuicPacketCount GetSlowStartThresholdInTcpMss() const override; |
| 229 | 192 |
| 230 // No longer retransmit data for |stream_id|. | 193 // No longer retransmit data for |stream_id|. |
| 231 void CancelRetransmissionsForStream(QuicStreamId stream_id); | 194 void CancelRetransmissionsForStream(QuicStreamId stream_id) override; |
| 232 | |
| 233 // Enables pacing if it has not already been enabled. | |
| 234 void EnablePacing(); | |
| 235 | 195 |
| 236 // Called when peer address changes and the connection migrates. | 196 // Called when peer address changes and the connection migrates. |
| 237 void OnConnectionMigration(PeerAddressChangeType type); | 197 void OnConnectionMigration(QuicPathId, PeerAddressChangeType type) override; |
| 238 | 198 |
| 239 bool using_pacing() const { return using_pacing_; } | 199 bool IsHandshakeConfirmed() const override; |
| 240 | 200 |
| 241 bool handshake_confirmed() const { return handshake_confirmed_; } | 201 void SetDebugDelegate(DebugDelegate* debug_delegate) override; |
| 242 | 202 |
| 243 void set_debug_delegate(DebugDelegate* debug_delegate) { | 203 QuicPacketNumber GetLargestObserved(QuicPathId) const override; |
| 244 debug_delegate_ = debug_delegate; | |
| 245 } | |
| 246 | 204 |
| 247 QuicPacketNumber largest_observed() const { | 205 QuicPacketNumber GetLargestSentPacket(QuicPathId) const override; |
| 248 return unacked_packets_.largest_observed(); | |
| 249 } | |
| 250 | 206 |
| 251 QuicPacketNumber largest_sent_packet() const { | 207 QuicPacketNumber GetLeastPacketAwaitedByPeer(QuicPathId) const override; |
| 252 return unacked_packets_.largest_sent_packet(); | |
| 253 } | |
| 254 | 208 |
| 255 QuicPacketNumber least_packet_awaited_by_peer() const { | 209 void SetNetworkChangeVisitor(NetworkChangeVisitor* visitor) override; |
| 256 return least_packet_awaited_by_peer_; | |
| 257 } | |
| 258 | 210 |
| 259 void set_network_change_visitor(NetworkChangeVisitor* visitor) { | 211 bool InSlowStart() const override; |
| 260 DCHECK(!network_change_visitor_); | |
| 261 DCHECK(visitor); | |
| 262 network_change_visitor_ = visitor; | |
| 263 } | |
| 264 | 212 |
| 265 bool InSlowStart() const; | 213 size_t GetConsecutiveRtoCount() const override; |
| 266 | 214 |
| 267 // Used in Chromium, but not in the server. | 215 size_t GetConsecutiveTlpCount() const override; |
| 268 size_t consecutive_rto_count() const { return consecutive_rto_count_; } | |
| 269 | |
| 270 // Used in Chromium, but not in the server. | |
| 271 size_t consecutive_tlp_count() const { return consecutive_tlp_count_; } | |
| 272 | 216 |
| 273 private: | 217 private: |
| 274 friend class test::QuicConnectionPeer; | 218 friend class test::QuicConnectionPeer; |
| 275 friend class test::QuicSentPacketManagerPeer; | 219 friend class test::QuicSentPacketManagerPeer; |
| 276 | 220 |
| 277 // The retransmission timer is a single timer which switches modes depending | 221 // The retransmission timer is a single timer which switches modes depending |
| 278 // upon connection state. | 222 // upon connection state. |
| 279 enum RetransmissionTimeoutMode { | 223 enum RetransmissionTimeoutMode { |
| 280 // A conventional TCP style RTO. | 224 // A conventional TCP style RTO. |
| 281 RTO_MODE, | 225 RTO_MODE, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 QuicPacketNumber acked_packet_number); | 315 QuicPacketNumber acked_packet_number); |
| 372 | 316 |
| 373 // Returns mutable TransmissionInfo associated with |packet_number|, which | 317 // Returns mutable TransmissionInfo associated with |packet_number|, which |
| 374 // must be unacked. | 318 // must be unacked. |
| 375 TransmissionInfo* GetMutableTransmissionInfo(QuicPacketNumber packet_number); | 319 TransmissionInfo* GetMutableTransmissionInfo(QuicPacketNumber packet_number); |
| 376 | 320 |
| 377 // Remove any packets no longer needed for retransmission, congestion, or | 321 // Remove any packets no longer needed for retransmission, congestion, or |
| 378 // RTT measurement purposes. | 322 // RTT measurement purposes. |
| 379 void RemoveObsoletePackets(); | 323 void RemoveObsoletePackets(); |
| 380 | 324 |
| 325 // Enables pacing if it has not already been enabled. |
| 326 void EnablePacing(); |
| 327 |
| 381 // Newly serialized retransmittable packets are added to this map, which | 328 // Newly serialized retransmittable packets are added to this map, which |
| 382 // contains owning pointers to any contained frames. If a packet is | 329 // contains owning pointers to any contained frames. If a packet is |
| 383 // retransmitted, this map will contain entries for both the old and the new | 330 // retransmitted, this map will contain entries for both the old and the new |
| 384 // packet. The old packet's retransmittable frames entry will be nullptr, | 331 // packet. The old packet's retransmittable frames entry will be nullptr, |
| 385 // while the new packet's entry will contain the frames to retransmit. | 332 // while the new packet's entry will contain the frames to retransmit. |
| 386 // If the old packet is acked before the new packet, then the old entry will | 333 // If the old packet is acked before the new packet, then the old entry will |
| 387 // be removed from the map and the new entry's retransmittable frames will be | 334 // be removed from the map and the new entry's retransmittable frames will be |
| 388 // set to nullptr. | 335 // set to nullptr. |
| 389 QuicUnackedPacketMap unacked_packets_; | 336 QuicUnackedPacketMap unacked_packets_; |
| 390 | 337 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 // Records bandwidth from server to client in normal operation, over periods | 401 // Records bandwidth from server to client in normal operation, over periods |
| 455 // of time with no loss events. | 402 // of time with no loss events. |
| 456 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; | 403 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; |
| 457 | 404 |
| 458 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 405 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
| 459 }; | 406 }; |
| 460 | 407 |
| 461 } // namespace net | 408 } // namespace net |
| 462 | 409 |
| 463 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 410 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
| OLD | NEW |