| 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "net/quic/congestion_control/tcp_receiver.h" | 6 #include "net/quic/congestion_control/tcp_receiver.h" |
| 7 | 7 |
| 8 namespace net { | 8 namespace net { |
| 9 | 9 |
| 10 // Originally 64K bytes, but increased it to 256K to support higher bitrates. |
| 10 // static | 11 // static |
| 11 // Originally 64K bytes for TCP, setting it to 256K to support higher bitrates. | |
| 12 const QuicByteCount TcpReceiver::kReceiveWindowTCP = 256000; | 12 const QuicByteCount TcpReceiver::kReceiveWindowTCP = 256000; |
| 13 | 13 |
| 14 TcpReceiver::TcpReceiver() | 14 TcpReceiver::TcpReceiver() |
| 15 : accumulated_number_of_recoverd_lost_packets_(0), | 15 : accumulated_number_of_recoverd_lost_packets_(0), |
| 16 receive_window_(kReceiveWindowTCP) { | 16 receive_window_(kReceiveWindowTCP) { |
| 17 } | 17 } |
| 18 | 18 |
| 19 bool TcpReceiver::GenerateCongestionFeedback( | 19 bool TcpReceiver::GenerateCongestionFeedback( |
| 20 QuicCongestionFeedbackFrame* feedback) { | 20 QuicCongestionFeedbackFrame* feedback) { |
| 21 feedback->type = kTCP; | 21 feedback->type = kTCP; |
| 22 feedback->tcp.accumulated_number_of_lost_packets = | 22 feedback->tcp.accumulated_number_of_lost_packets = |
| 23 accumulated_number_of_recoverd_lost_packets_; | 23 accumulated_number_of_recoverd_lost_packets_; |
| 24 feedback->tcp.receive_window = receive_window_; | 24 feedback->tcp.receive_window = receive_window_; |
| 25 return true; | 25 return true; |
| 26 } | 26 } |
| 27 | 27 |
| 28 void TcpReceiver::RecordIncomingPacket(QuicByteCount bytes, | 28 void TcpReceiver::RecordIncomingPacket(QuicByteCount bytes, |
| 29 QuicPacketSequenceNumber sequence_number, | 29 QuicPacketSequenceNumber sequence_number, |
| 30 QuicTime timestamp, | 30 QuicTime timestamp, |
| 31 bool revived) { | 31 bool revived) { |
| 32 if (revived) { | 32 if (revived) { |
| 33 ++accumulated_number_of_recoverd_lost_packets_; | 33 ++accumulated_number_of_recoverd_lost_packets_; |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 } // namespace net | 37 } // namespace net |
| OLD | NEW |