| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/congestion_control/tcp_cubic_sender.h" | 5 #include "net/quic/congestion_control/tcp_cubic_sender.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "net/quic/congestion_control/rtt_stats.h" | 10 #include "net/quic/congestion_control/rtt_stats.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 if (is_server && config.HasReceivedInitialCongestionWindow()) { | 61 if (is_server && config.HasReceivedInitialCongestionWindow()) { |
| 62 // Set the initial window size. | 62 // Set the initial window size. |
| 63 congestion_window_ = min(kMaxInitialWindow, | 63 congestion_window_ = min(kMaxInitialWindow, |
| 64 config.ReceivedInitialCongestionWindow()); | 64 config.ReceivedInitialCongestionWindow()); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 | 67 |
| 68 void TcpCubicSender::OnIncomingQuicCongestionFeedbackFrame( | 68 void TcpCubicSender::OnIncomingQuicCongestionFeedbackFrame( |
| 69 const QuicCongestionFeedbackFrame& feedback, | 69 const QuicCongestionFeedbackFrame& feedback, |
| 70 QuicTime feedback_receive_time) { | 70 QuicTime feedback_receive_time) { |
| 71 receive_window_ = feedback.tcp.receive_window; | 71 if (feedback.type == kTCP) { |
| 72 receive_window_ = feedback.tcp.receive_window; |
| 73 } |
| 72 } | 74 } |
| 73 | 75 |
| 74 void TcpCubicSender::OnCongestionEvent( | 76 void TcpCubicSender::OnCongestionEvent( |
| 75 bool rtt_updated, | 77 bool rtt_updated, |
| 76 QuicByteCount bytes_in_flight, | 78 QuicByteCount bytes_in_flight, |
| 77 const CongestionMap& acked_packets, | 79 const CongestionMap& acked_packets, |
| 78 const CongestionMap& lost_packets) { | 80 const CongestionMap& lost_packets) { |
| 79 if (rtt_updated && InSlowStart() && | 81 if (rtt_updated && InSlowStart() && |
| 80 hybrid_slow_start_.ShouldExitSlowStart(rtt_stats_->latest_rtt(), | 82 hybrid_slow_start_.ShouldExitSlowStart(rtt_stats_->latest_rtt(), |
| 81 rtt_stats_->min_rtt(), | 83 rtt_stats_->min_rtt(), |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 return QuicTime::Delta::Zero(); | 345 return QuicTime::Delta::Zero(); |
| 344 } | 346 } |
| 345 return QuicTime::Delta::Infinite(); | 347 return QuicTime::Delta::Infinite(); |
| 346 } | 348 } |
| 347 | 349 |
| 348 CongestionControlType TcpCubicSender::GetCongestionControlType() const { | 350 CongestionControlType TcpCubicSender::GetCongestionControlType() const { |
| 349 return reno_ ? kReno : kCubic; | 351 return reno_ ? kReno : kCubic; |
| 350 } | 352 } |
| 351 | 353 |
| 352 } // namespace net | 354 } // namespace net |
| OLD | NEW |