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