Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Side by Side Diff: net/quic/congestion_control/tcp_cubic_sender.cc

Issue 530343003: Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Final_0828
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 const QuicCongestionFeedbackFrame& feedback, 81 const QuicCongestionFeedbackFrame& feedback,
82 QuicTime feedback_receive_time) { 82 QuicTime feedback_receive_time) {
83 if (feedback.type == kTCP) { 83 if (feedback.type == kTCP) {
84 receive_window_ = feedback.tcp.receive_window; 84 receive_window_ = feedback.tcp.receive_window;
85 } 85 }
86 } 86 }
87 87
88 void TcpCubicSender::OnCongestionEvent( 88 void TcpCubicSender::OnCongestionEvent(
89 bool rtt_updated, 89 bool rtt_updated,
90 QuicByteCount bytes_in_flight, 90 QuicByteCount bytes_in_flight,
91 const CongestionMap& acked_packets, 91 const CongestionVector& acked_packets,
92 const CongestionMap& lost_packets) { 92 const CongestionVector& lost_packets) {
93 if (rtt_updated && InSlowStart() && 93 if (rtt_updated && InSlowStart() &&
94 hybrid_slow_start_.ShouldExitSlowStart(rtt_stats_->latest_rtt(), 94 hybrid_slow_start_.ShouldExitSlowStart(rtt_stats_->latest_rtt(),
95 rtt_stats_->min_rtt(), 95 rtt_stats_->min_rtt(),
96 congestion_window_)) { 96 congestion_window_)) {
97 slowstart_threshold_ = congestion_window_; 97 slowstart_threshold_ = congestion_window_;
98 } 98 }
99 for (CongestionMap::const_iterator it = lost_packets.begin(); 99 for (CongestionVector::const_iterator it = lost_packets.begin();
100 it != lost_packets.end(); ++it) { 100 it != lost_packets.end(); ++it) {
101 OnPacketLost(it->first, bytes_in_flight); 101 OnPacketLost(it->first, bytes_in_flight);
102 } 102 }
103 for (CongestionMap::const_iterator it = acked_packets.begin(); 103 for (CongestionVector::const_iterator it = acked_packets.begin();
104 it != acked_packets.end(); ++it) { 104 it != acked_packets.end(); ++it) {
105 OnPacketAcked(it->first, it->second.bytes_sent, bytes_in_flight); 105 OnPacketAcked(it->first, it->second.bytes_sent, bytes_in_flight);
106 } 106 }
107 } 107 }
108 108
109 void TcpCubicSender::OnPacketAcked( 109 void TcpCubicSender::OnPacketAcked(
110 QuicPacketSequenceNumber acked_sequence_number, 110 QuicPacketSequenceNumber acked_sequence_number,
111 QuicByteCount acked_bytes, 111 QuicByteCount acked_bytes,
112 QuicByteCount bytes_in_flight) { 112 QuicByteCount bytes_in_flight) {
113 largest_acked_sequence_number_ = max(acked_sequence_number, 113 largest_acked_sequence_number_ = max(acked_sequence_number,
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 return QuicTime::Delta::Zero(); 354 return QuicTime::Delta::Zero();
355 } 355 }
356 return QuicTime::Delta::Infinite(); 356 return QuicTime::Delta::Infinite();
357 } 357 }
358 358
359 CongestionControlType TcpCubicSender::GetCongestionControlType() const { 359 CongestionControlType TcpCubicSender::GetCongestionControlType() const {
360 return reno_ ? kReno : kCubic; 360 return reno_ ? kReno : kCubic;
361 } 361 }
362 362
363 } // namespace net 363 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/congestion_control/tcp_cubic_sender.h ('k') | net/quic/congestion_control/tcp_cubic_sender_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698