| 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/core/quic_sent_packet_manager.h" | 5 #include "net/quic/core/quic_sent_packet_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 698 return RTO_MODE; | 698 return RTO_MODE; |
| 699 } | 699 } |
| 700 | 700 |
| 701 void QuicSentPacketManager::InvokeLossDetection(QuicTime time) { | 701 void QuicSentPacketManager::InvokeLossDetection(QuicTime time) { |
| 702 if (FLAGS_quic_loss_recovery_use_largest_acked && !packets_acked_.empty()) { | 702 if (FLAGS_quic_loss_recovery_use_largest_acked && !packets_acked_.empty()) { |
| 703 DCHECK_LE(packets_acked_.front().first, packets_acked_.back().first); | 703 DCHECK_LE(packets_acked_.front().first, packets_acked_.back().first); |
| 704 largest_newly_acked_ = packets_acked_.back().first; | 704 largest_newly_acked_ = packets_acked_.back().first; |
| 705 } | 705 } |
| 706 loss_algorithm_->DetectLosses(unacked_packets_, time, rtt_stats_, | 706 loss_algorithm_->DetectLosses(unacked_packets_, time, rtt_stats_, |
| 707 largest_newly_acked_, &packets_lost_); | 707 largest_newly_acked_, &packets_lost_); |
| 708 for (const pair<QuicPacketNumber, QuicByteCount>& pair : packets_lost_) { | 708 for (const auto& pair : packets_lost_) { |
| 709 ++stats_->packets_lost; | 709 ++stats_->packets_lost; |
| 710 if (debug_delegate_ != nullptr) { | 710 if (debug_delegate_ != nullptr) { |
| 711 debug_delegate_->OnPacketLoss(pair.first, LOSS_RETRANSMISSION, time); | 711 debug_delegate_->OnPacketLoss(pair.first, LOSS_RETRANSMISSION, time); |
| 712 } | 712 } |
| 713 | 713 |
| 714 // TODO(ianswett): This could be optimized. | 714 // TODO(ianswett): This could be optimized. |
| 715 if (unacked_packets_.HasRetransmittableFrames(pair.first)) { | 715 if (unacked_packets_.HasRetransmittableFrames(pair.first)) { |
| 716 MarkForRetransmission(pair.first, LOSS_RETRANSMISSION); | 716 MarkForRetransmission(pair.first, LOSS_RETRANSMISSION); |
| 717 } else { | 717 } else { |
| 718 // Since we will not retransmit this, we need to remove it from | 718 // Since we will not retransmit this, we need to remove it from |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 997 | 997 |
| 998 void QuicSentPacketManager::RemoveObsoletePackets() { | 998 void QuicSentPacketManager::RemoveObsoletePackets() { |
| 999 unacked_packets_.RemoveObsoletePackets(); | 999 unacked_packets_.RemoveObsoletePackets(); |
| 1000 } | 1000 } |
| 1001 | 1001 |
| 1002 void QuicSentPacketManager::OnApplicationLimited() { | 1002 void QuicSentPacketManager::OnApplicationLimited() { |
| 1003 send_algorithm_->OnApplicationLimited(unacked_packets_.bytes_in_flight()); | 1003 send_algorithm_->OnApplicationLimited(unacked_packets_.bytes_in_flight()); |
| 1004 } | 1004 } |
| 1005 | 1005 |
| 1006 } // namespace net | 1006 } // namespace net |
| OLD | NEW |