| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 const CachedNetworkParameters& cached_network_params, | 126 const CachedNetworkParameters& cached_network_params, |
| 127 bool max_bandwidth_resumption); | 127 bool max_bandwidth_resumption); |
| 128 | 128 |
| 129 void SetNumOpenStreams(size_t num_streams); | 129 void SetNumOpenStreams(size_t num_streams); |
| 130 | 130 |
| 131 void SetHandshakeConfirmed() { handshake_confirmed_ = true; } | 131 void SetHandshakeConfirmed() { handshake_confirmed_ = true; } |
| 132 | 132 |
| 133 // Processes the incoming ack. | 133 // Processes the incoming ack. |
| 134 void OnIncomingAck(const QuicAckFrame& ack_frame, QuicTime ack_receive_time); | 134 void OnIncomingAck(const QuicAckFrame& ack_frame, QuicTime ack_receive_time); |
| 135 | 135 |
| 136 // Returns true if the non-FEC packet |packet_number| is unacked. | 136 // Returns true if packet |packet_number| is unacked. |
| 137 bool IsUnacked(QuicPacketNumber packet_number) const; | 137 bool IsUnacked(QuicPacketNumber packet_number) const; |
| 138 | 138 |
| 139 // Requests retransmission of all unacked packets of |retransmission_type|. | 139 // Requests retransmission of all unacked packets of |retransmission_type|. |
| 140 // The behavior of this method depends on the value of |retransmission_type|: | 140 // The behavior of this method depends on the value of |retransmission_type|: |
| 141 // ALL_UNACKED_RETRANSMISSION - All unacked packets will be retransmitted. | 141 // ALL_UNACKED_RETRANSMISSION - All unacked packets will be retransmitted. |
| 142 // This can happen, for example, after a version negotiation packet has been | 142 // This can happen, for example, after a version negotiation packet has been |
| 143 // received and all packets needs to be retransmitted with the new version. | 143 // received and all packets needs to be retransmitted with the new version. |
| 144 // ALL_INITIAL_RETRANSMISSION - Only initially encrypted packets will be | 144 // ALL_INITIAL_RETRANSMISSION - Only initially encrypted packets will be |
| 145 // retransmitted. This can happen, for example, when a CHLO has been rejected | 145 // retransmitted. This can happen, for example, when a CHLO has been rejected |
| 146 // and the previously encrypted data needs to be encrypted with a new key. | 146 // and the previously encrypted data needs to be encrypted with a new key. |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 void InvokeLossDetection(QuicTime time); | 330 void InvokeLossDetection(QuicTime time); |
| 331 | 331 |
| 332 // Invokes OnCongestionEvent if |rtt_updated| is true, there are pending acks, | 332 // Invokes OnCongestionEvent if |rtt_updated| is true, there are pending acks, |
| 333 // or pending losses. Clears pending acks and pending losses afterwards. | 333 // or pending losses. Clears pending acks and pending losses afterwards. |
| 334 // |bytes_in_flight| is the number of bytes in flight before the losses or | 334 // |bytes_in_flight| is the number of bytes in flight before the losses or |
| 335 // acks. | 335 // acks. |
| 336 void MaybeInvokeCongestionEvent(bool rtt_updated, | 336 void MaybeInvokeCongestionEvent(bool rtt_updated, |
| 337 QuicByteCount bytes_in_flight); | 337 QuicByteCount bytes_in_flight); |
| 338 | 338 |
| 339 // Called when frames of |packet_number| has been received but the packet | 339 // Called when frames of |packet_number| has been received but the packet |
| 340 // itself has not been received by the peer (e.g., packet is revived by FEC). | 340 // itself has not been received by the peer. Currently, this method is not |
| 341 // used. |
| 342 // TODO(fayang): Update the comment when multipath sent packet manager is |
| 343 // landed. |
| 341 // The packet needs no longer to be retransmitted, but the packet remains | 344 // The packet needs no longer to be retransmitted, but the packet remains |
| 342 // pending if it is and the congestion control does not consider the packet | 345 // pending if it is and the congestion control does not consider the packet |
| 343 // acked. | 346 // acked. |
| 344 void MarkPacketNotRetransmittable(QuicPacketNumber packet_number, | 347 void MarkPacketNotRetransmittable(QuicPacketNumber packet_number, |
| 345 QuicTime::Delta ack_delay_time); | 348 QuicTime::Delta ack_delay_time); |
| 346 | 349 |
| 347 // Removes the retransmittability and in flight properties from the packet at | 350 // Removes the retransmittability and in flight properties from the packet at |
| 348 // |info| due to receipt by the peer. | 351 // |info| due to receipt by the peer. |
| 349 void MarkPacketHandled(QuicPacketNumber packet_number, | 352 void MarkPacketHandled(QuicPacketNumber packet_number, |
| 350 TransmissionInfo* info, | 353 TransmissionInfo* info, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 368 QuicPacketNumber acked_packet_number); | 371 QuicPacketNumber acked_packet_number); |
| 369 | 372 |
| 370 // Returns mutable TransmissionInfo associated with |packet_number|, which | 373 // Returns mutable TransmissionInfo associated with |packet_number|, which |
| 371 // must be unacked. | 374 // must be unacked. |
| 372 TransmissionInfo* GetMutableTransmissionInfo(QuicPacketNumber packet_number); | 375 TransmissionInfo* GetMutableTransmissionInfo(QuicPacketNumber packet_number); |
| 373 | 376 |
| 374 // Remove any packets no longer needed for retransmission, congestion, or | 377 // Remove any packets no longer needed for retransmission, congestion, or |
| 375 // RTT measurement purposes. | 378 // RTT measurement purposes. |
| 376 void RemoveObsoletePackets(); | 379 void RemoveObsoletePackets(); |
| 377 | 380 |
| 378 // Newly serialized retransmittable and fec packets are added to this map, | 381 // Newly serialized retransmittable packets are added to this map, which |
| 379 // which contains owning pointers to any contained frames. If a packet is | 382 // contains owning pointers to any contained frames. If a packet is |
| 380 // retransmitted, this map will contain entries for both the old and the new | 383 // retransmitted, this map will contain entries for both the old and the new |
| 381 // packet. The old packet's retransmittable frames entry will be nullptr, | 384 // packet. The old packet's retransmittable frames entry will be nullptr, |
| 382 // while the new packet's entry will contain the frames to retransmit. | 385 // while the new packet's entry will contain the frames to retransmit. |
| 383 // If the old packet is acked before the new packet, then the old entry will | 386 // If the old packet is acked before the new packet, then the old entry will |
| 384 // be removed from the map and the new entry's retransmittable frames will be | 387 // be removed from the map and the new entry's retransmittable frames will be |
| 385 // set to nullptr. | 388 // set to nullptr. |
| 386 QuicUnackedPacketMap unacked_packets_; | 389 QuicUnackedPacketMap unacked_packets_; |
| 387 | 390 |
| 388 // Pending retransmissions which have not been packetized and sent yet. | 391 // Pending retransmissions which have not been packetized and sent yet. |
| 389 PendingRetransmissionMap pending_retransmissions_; | 392 PendingRetransmissionMap pending_retransmissions_; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 // Records bandwidth from server to client in normal operation, over periods | 449 // Records bandwidth from server to client in normal operation, over periods |
| 447 // of time with no loss events. | 450 // of time with no loss events. |
| 448 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; | 451 QuicSustainedBandwidthRecorder sustained_bandwidth_recorder_; |
| 449 | 452 |
| 450 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); | 453 DISALLOW_COPY_AND_ASSIGN(QuicSentPacketManager); |
| 451 }; | 454 }; |
| 452 | 455 |
| 453 } // namespace net | 456 } // namespace net |
| 454 | 457 |
| 455 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ | 458 #endif // NET_QUIC_QUIC_SENT_PACKET_MANAGER_H_ |
| OLD | NEW |