| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 QuicTime detection_time) {} | 88 QuicTime detection_time) {} |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 // Interface which gets callbacks from the QuicSentPacketManager when | 91 // Interface which gets callbacks from the QuicSentPacketManager when |
| 92 // network-related state changes. Implementations must not mutate the | 92 // network-related state changes. Implementations must not mutate the |
| 93 // state of the packet manager as a result of these callbacks. | 93 // state of the packet manager as a result of these callbacks. |
| 94 class NET_EXPORT_PRIVATE NetworkChangeVisitor { | 94 class NET_EXPORT_PRIVATE NetworkChangeVisitor { |
| 95 public: | 95 public: |
| 96 virtual ~NetworkChangeVisitor() {} | 96 virtual ~NetworkChangeVisitor() {} |
| 97 | 97 |
| 98 // Called when congestion window may have changed. | 98 // Called when congestion window or RTT may have changed. |
| 99 virtual void OnCongestionWindowChange() = 0; | 99 virtual void OnCongestionChange() = 0; |
| 100 | |
| 101 // Called when RTT may have changed, including when an RTT is read from | |
| 102 // the config. | |
| 103 virtual void OnRttChange() = 0; | |
| 104 | 100 |
| 105 // Called with the path may be degrading. Note that the path may only be | 101 // Called with the path may be degrading. Note that the path may only be |
| 106 // temporarily degrading. | 102 // temporarily degrading. |
| 107 // TODO(jri): With multipath, this method should probably have a path_id | 103 // TODO(jri): With multipath, this method should probably have a path_id |
| 108 // parameter, and should maybe result in the path being marked as inactive. | 104 // parameter, and should maybe result in the path being marked as inactive. |
| 109 virtual void OnPathDegrading() = 0; | 105 virtual void OnPathDegrading() = 0; |
| 110 }; | 106 }; |
| 111 | 107 |
| 112 QuicSentPacketManager(Perspective perspective, | 108 QuicSentPacketManager(Perspective perspective, |
| 113 QuicPathId path_id, | 109 QuicPathId path_id, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 bool HasUnackedPackets() const; | 167 bool HasUnackedPackets() const; |
| 172 | 168 |
| 173 // Returns the smallest packet number of a serialized packet which has not | 169 // Returns the smallest packet number of a serialized packet which has not |
| 174 // been acked by the peer. | 170 // been acked by the peer. |
| 175 QuicPacketNumber GetLeastUnacked() const; | 171 QuicPacketNumber GetLeastUnacked() const; |
| 176 | 172 |
| 177 // Called when we have sent bytes to the peer. This informs the manager both | 173 // Called when we have sent bytes to the peer. This informs the manager both |
| 178 // the number of bytes sent and if they were retransmitted. Returns true if | 174 // the number of bytes sent and if they were retransmitted. Returns true if |
| 179 // the sender should reset the retransmission timer. | 175 // the sender should reset the retransmission timer. |
| 180 virtual bool OnPacketSent(SerializedPacket* serialized_packet, | 176 virtual bool OnPacketSent(SerializedPacket* serialized_packet, |
| 177 QuicPathId /*original_path_id*/, |
| 181 QuicPacketNumber original_packet_number, | 178 QuicPacketNumber original_packet_number, |
| 182 QuicTime sent_time, | 179 QuicTime sent_time, |
| 183 TransmissionType transmission_type, | 180 TransmissionType transmission_type, |
| 184 HasRetransmittableData has_retransmittable_data); | 181 HasRetransmittableData has_retransmittable_data); |
| 185 | 182 |
| 186 // Called when the retransmission timer expires. | 183 // Called when the retransmission timer expires. |
| 187 virtual void OnRetransmissionTimeout(); | 184 virtual void OnRetransmissionTimeout(); |
| 188 | 185 |
| 189 // Calculate the time until we can send the next packet to the wire. | 186 // Calculate the time until we can send the next packet to the wire. |
| 190 // Note 1: When kUnknownWaitTime is returned, there is no need to poll | 187 // Note 1: When kUnknownWaitTime is returned, there is no need to poll |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 void CancelRetransmissionsForStream(QuicStreamId stream_id); | 230 void CancelRetransmissionsForStream(QuicStreamId stream_id); |
| 234 | 231 |
| 235 // Enables pacing if it has not already been enabled. | 232 // Enables pacing if it has not already been enabled. |
| 236 void EnablePacing(); | 233 void EnablePacing(); |
| 237 | 234 |
| 238 // Called when peer address changes and the connection migrates. | 235 // Called when peer address changes and the connection migrates. |
| 239 void OnConnectionMigration(PeerAddressChangeType type); | 236 void OnConnectionMigration(PeerAddressChangeType type); |
| 240 | 237 |
| 241 bool using_pacing() const { return using_pacing_; } | 238 bool using_pacing() const { return using_pacing_; } |
| 242 | 239 |
| 240 bool handshake_confirmed() const { return handshake_confirmed_; } |
| 241 |
| 243 void set_debug_delegate(DebugDelegate* debug_delegate) { | 242 void set_debug_delegate(DebugDelegate* debug_delegate) { |
| 244 debug_delegate_ = debug_delegate; | 243 debug_delegate_ = debug_delegate; |
| 245 } | 244 } |
| 246 | 245 |
| 247 QuicPacketNumber largest_observed() const { | 246 QuicPacketNumber largest_observed() const { |
| 248 return unacked_packets_.largest_observed(); | 247 return unacked_packets_.largest_observed(); |
| 249 } | 248 } |
| 250 | 249 |
| 251 QuicPacketNumber largest_sent_packet() const { | 250 QuicPacketNumber largest_sent_packet() const { |
| 252 return unacked_packets_.largest_sent_packet(); | 251 return unacked_packets_.largest_sent_packet(); |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 // Records bandwidth from server to client in normal operation, over periods | 450 // Records bandwidth from server to client in normal operation, over periods |
| 452 // of time with no loss events. | 451 // of time with no loss events. |
| 453 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; | 452 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; |
| 454 | 453 |
| 455 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 454 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
| 456 }; | 455 }; |
| 457 | 456 |
| 458 } // namespace net | 457 } // namespace net |
| 459 | 458 |
| 460 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 459 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
| OLD | NEW |