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 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 | 934 |
935 QuicPacketCount QuicSentPacketManager::GetSlowStartThresholdInTcpMss() const { | 935 QuicPacketCount QuicSentPacketManager::GetSlowStartThresholdInTcpMss() const { |
936 return send_algorithm_->GetSlowStartThreshold() / kDefaultTCPMSS; | 936 return send_algorithm_->GetSlowStartThreshold() / kDefaultTCPMSS; |
937 } | 937 } |
938 | 938 |
939 void QuicSentPacketManager::OnSerializedPacket( | 939 void QuicSentPacketManager::OnSerializedPacket( |
940 const SerializedPacket& serialized_packet) { | 940 const SerializedPacket& serialized_packet) { |
941 ack_notifier_manager_.OnSerializedPacket(serialized_packet); | 941 ack_notifier_manager_.OnSerializedPacket(serialized_packet); |
942 } | 942 } |
943 | 943 |
| 944 void QuicSentPacketManager::CancelRetransmissionsForStream( |
| 945 QuicStreamId stream_id) { |
| 946 unacked_packets_.CancelRetransmissionsForStream(stream_id); |
| 947 PendingRetransmissionMap::iterator it = pending_retransmissions_.begin(); |
| 948 while (it != pending_retransmissions_.end()) { |
| 949 if (HasRetransmittableFrames(it->first)) { |
| 950 ++it; |
| 951 continue; |
| 952 } |
| 953 it = pending_retransmissions_.erase(it); |
| 954 } |
| 955 } |
| 956 |
944 void QuicSentPacketManager::EnablePacing() { | 957 void QuicSentPacketManager::EnablePacing() { |
945 // TODO(ianswett): Replace with a method which wraps the send algorithm in a | 958 // TODO(ianswett): Replace with a method which wraps the send algorithm in a |
946 // pacer every time a new algorithm is set. | 959 // pacer every time a new algorithm is set. |
947 if (using_pacing_) { | 960 if (using_pacing_) { |
948 return; | 961 return; |
949 } | 962 } |
950 | 963 |
951 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as | 964 // Set up a pacing sender with a 1 millisecond alarm granularity, the same as |
952 // the default granularity of the Linux kernel's FQ qdisc. | 965 // the default granularity of the Linux kernel's FQ qdisc. |
953 using_pacing_ = true; | 966 using_pacing_ = true; |
954 send_algorithm_.reset( | 967 send_algorithm_.reset( |
955 new PacingSender(send_algorithm_.release(), | 968 new PacingSender(send_algorithm_.release(), |
956 QuicTime::Delta::FromMilliseconds(1), | 969 QuicTime::Delta::FromMilliseconds(1), |
957 kInitialUnpacedBurst)); | 970 kInitialUnpacedBurst)); |
958 } | 971 } |
959 | 972 |
960 } // namespace net | 973 } // namespace net |
OLD | NEW |