| 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 #include "net/quic/quic_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 serialized_packet->is_fec_packet ? HAS_RETRANSMITTABLE_DATA | 576 serialized_packet->is_fec_packet ? HAS_RETRANSMITTABLE_DATA |
| 577 : has_retransmittable_data; | 577 : has_retransmittable_data; |
| 578 // TODO(ianswett): Remove sent_time, because it's unused. | 578 // TODO(ianswett): Remove sent_time, because it's unused. |
| 579 const bool in_flight = send_algorithm_->OnPacketSent( | 579 const bool in_flight = send_algorithm_->OnPacketSent( |
| 580 sent_time, unacked_packets_.bytes_in_flight(), packet_number, bytes, | 580 sent_time, unacked_packets_.bytes_in_flight(), packet_number, bytes, |
| 581 has_congestion_controlled_data); | 581 has_congestion_controlled_data); |
| 582 | 582 |
| 583 unacked_packets_.AddSentPacket(serialized_packet, original_packet_number, | 583 unacked_packets_.AddSentPacket(serialized_packet, original_packet_number, |
| 584 transmission_type, sent_time, bytes, | 584 transmission_type, sent_time, bytes, |
| 585 in_flight); | 585 in_flight); |
| 586 | |
| 587 // Take ownership of the retransmittable frames before exiting. | |
| 588 serialized_packet->retransmittable_frames = nullptr; | |
| 589 // Reset the retransmission timer anytime a pending packet is sent. | 586 // Reset the retransmission timer anytime a pending packet is sent. |
| 590 return in_flight; | 587 return in_flight; |
| 591 } | 588 } |
| 592 | 589 |
| 593 void QuicSentPacketManager::OnRetransmissionTimeout() { | 590 void QuicSentPacketManager::OnRetransmissionTimeout() { |
| 594 DCHECK(unacked_packets_.HasInFlightPackets()); | 591 DCHECK(unacked_packets_.HasInFlightPackets()); |
| 595 DCHECK_EQ(0u, pending_timer_transmission_count_); | 592 DCHECK_EQ(0u, pending_timer_transmission_count_); |
| 596 // Handshake retransmission, timer based loss detection, TLP, and RTO are | 593 // Handshake retransmission, timer based loss detection, TLP, and RTO are |
| 597 // implemented with a single alarm. The handshake alarm is set when the | 594 // implemented with a single alarm. The handshake alarm is set when the |
| 598 // handshake has not completed, the loss alarm is set when the loss detection | 595 // handshake has not completed, the loss alarm is set when the loss detection |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 TransmissionInfo* QuicSentPacketManager::GetMutableTransmissionInfo( | 972 TransmissionInfo* QuicSentPacketManager::GetMutableTransmissionInfo( |
| 976 QuicPacketNumber packet_number) { | 973 QuicPacketNumber packet_number) { |
| 977 return unacked_packets_.GetMutableTransmissionInfo(packet_number); | 974 return unacked_packets_.GetMutableTransmissionInfo(packet_number); |
| 978 } | 975 } |
| 979 | 976 |
| 980 void QuicSentPacketManager::RemoveObsoletePackets() { | 977 void QuicSentPacketManager::RemoveObsoletePackets() { |
| 981 unacked_packets_.RemoveObsoletePackets(); | 978 unacked_packets_.RemoveObsoletePackets(); |
| 982 } | 979 } |
| 983 | 980 |
| 984 } // namespace net | 981 } // namespace net |
| OLD | NEW |