| 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 "net/quic/chromium/quic_utils_chromium.h" | 10 #include "net/quic/chromium/quic_utils_chromium.h" |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 QuicTransmissionInfo* info, | 457 QuicTransmissionInfo* info, |
| 458 QuicTime::Delta ack_delay_time) { | 458 QuicTime::Delta ack_delay_time) { |
| 459 QuicPacketNumber newest_transmission = | 459 QuicPacketNumber newest_transmission = |
| 460 GetNewestRetransmission(packet_number, *info); | 460 GetNewestRetransmission(packet_number, *info); |
| 461 // Remove the most recent packet, if it is pending retransmission. | 461 // Remove the most recent packet, if it is pending retransmission. |
| 462 pending_retransmissions_.erase(newest_transmission); | 462 pending_retransmissions_.erase(newest_transmission); |
| 463 | 463 |
| 464 // The AckListener needs to be notified about the most recent | 464 // The AckListener needs to be notified about the most recent |
| 465 // transmission, since that's the one only one it tracks. | 465 // transmission, since that's the one only one it tracks. |
| 466 if (newest_transmission == packet_number) { | 466 if (newest_transmission == packet_number) { |
| 467 unacked_packets_.NotifyStreamFramesAcked(*info, ack_delay_time); |
| 467 unacked_packets_.NotifyAndClearListeners(&info->ack_listeners, | 468 unacked_packets_.NotifyAndClearListeners(&info->ack_listeners, |
| 468 ack_delay_time); | 469 ack_delay_time); |
| 469 } else { | 470 } else { |
| 470 unacked_packets_.NotifyAndClearListeners(newest_transmission, | 471 unacked_packets_.NotifyAndClearListeners(newest_transmission, |
| 471 ack_delay_time); | 472 ack_delay_time); |
| 472 RecordSpuriousRetransmissions(*info, packet_number); | 473 RecordSpuriousRetransmissions(*info, packet_number); |
| 473 // Remove the most recent packet from flight if it's a crypto handshake | 474 // Remove the most recent packet from flight if it's a crypto handshake |
| 474 // packet, since they won't be acked now that one has been processed. | 475 // packet, since they won't be acked now that one has been processed. |
| 475 // Other crypto handshake packets won't be in flight, only the newest | 476 // Other crypto handshake packets won't be in flight, only the newest |
| 476 // transmission of a crypto packet is in flight at once. | 477 // transmission of a crypto packet is in flight at once. |
| 477 // TODO(ianswett): Instead of handling all crypto packets special, | 478 // TODO(ianswett): Instead of handling all crypto packets special, |
| 478 // only handle nullptr encrypted packets in a special way. | 479 // only handle nullptr encrypted packets in a special way. |
| 479 const QuicTransmissionInfo& newest_transmission_info = | 480 const QuicTransmissionInfo& newest_transmission_info = |
| 480 unacked_packets_.GetTransmissionInfo(newest_transmission); | 481 unacked_packets_.GetTransmissionInfo(newest_transmission); |
| 482 unacked_packets_.NotifyStreamFramesAcked(newest_transmission_info, |
| 483 ack_delay_time); |
| 481 if (HasCryptoHandshake(newest_transmission_info)) { | 484 if (HasCryptoHandshake(newest_transmission_info)) { |
| 482 unacked_packets_.RemoveFromInFlight(newest_transmission); | 485 unacked_packets_.RemoveFromInFlight(newest_transmission); |
| 483 } | 486 } |
| 484 } | 487 } |
| 485 | 488 |
| 486 if (network_change_visitor_ != nullptr && | 489 if (network_change_visitor_ != nullptr && |
| 487 info->bytes_sent > largest_mtu_acked_) { | 490 info->bytes_sent > largest_mtu_acked_) { |
| 488 largest_mtu_acked_ = info->bytes_sent; | 491 largest_mtu_acked_ = info->bytes_sent; |
| 489 network_change_visitor_->OnPathMtuIncreased(largest_mtu_acked_); | 492 network_change_visitor_->OnPathMtuIncreased(largest_mtu_acked_); |
| 490 } | 493 } |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 } | 958 } |
| 956 | 959 |
| 957 void QuicSentPacketManager::OnApplicationLimited() { | 960 void QuicSentPacketManager::OnApplicationLimited() { |
| 958 send_algorithm_->OnApplicationLimited(unacked_packets_.bytes_in_flight()); | 961 send_algorithm_->OnApplicationLimited(unacked_packets_.bytes_in_flight()); |
| 959 } | 962 } |
| 960 | 963 |
| 961 const SendAlgorithmInterface* QuicSentPacketManager::GetSendAlgorithm() const { | 964 const SendAlgorithmInterface* QuicSentPacketManager::GetSendAlgorithm() const { |
| 962 return send_algorithm_.get(); | 965 return send_algorithm_.get(); |
| 963 } | 966 } |
| 964 | 967 |
| 968 void QuicSentPacketManager::SetStreamNotifier( |
| 969 StreamNotifierInterface* stream_notifier) { |
| 970 unacked_packets_.SetStreamNotifier(stream_notifier); |
| 971 } |
| 972 |
| 965 } // namespace net | 973 } // namespace net |
| OLD | NEW |