Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / net / quic / congestion_control / tcp_cubic_sender.cc
index a978cf6..25183ef 100644 (file)
@@ -24,7 +24,7 @@ const QuicByteCount kDefaultReceiveWindow = 64000;
 const int64 kInitialCongestionWindow = 10;
 const int kMaxBurstLength = 3;
 // Constants used for RTT calculation.
-const int kInitialRttMs = 60;  // At a typical RTT 60 ms.
+const int kInitialRttMs = 100;  // At a typical RTT 100 ms.
 const float kAlpha = 0.125f;
 const float kOneMinusAlpha = (1 - kAlpha);
 const float kBeta = 0.25f;
@@ -40,7 +40,6 @@ TcpCubicSender::TcpCubicSender(
       reno_(reno),
       congestion_window_count_(0),
       receive_window_(kDefaultReceiveWindow),
-      last_received_accumulated_number_of_lost_packets_(0),
       bytes_in_flight_(0),
       prr_out_(0),
       prr_delivered_(0),
@@ -77,18 +76,6 @@ void TcpCubicSender::OnIncomingQuicCongestionFeedbackFrame(
     const QuicCongestionFeedbackFrame& feedback,
     QuicTime feedback_receive_time,
     const SentPacketsMap& /*sent_packets*/) {
-  if (last_received_accumulated_number_of_lost_packets_ !=
-      feedback.tcp.accumulated_number_of_lost_packets) {
-    int recovered_lost_packets =
-        last_received_accumulated_number_of_lost_packets_ -
-        feedback.tcp.accumulated_number_of_lost_packets;
-    last_received_accumulated_number_of_lost_packets_ =
-        feedback.tcp.accumulated_number_of_lost_packets;
-    if (recovered_lost_packets > 0) {
-      // Assume the loss could be as late as the last acked packet.
-      OnPacketLost(largest_acked_sequence_number_, feedback_receive_time);
-    }
-  }
   receive_window_ = feedback.tcp.receive_window;
 }
 
@@ -353,7 +340,8 @@ void TcpCubicSender::UpdateRtt(QuicTime::Delta rtt) {
   } else {
     mean_deviation_ = QuicTime::Delta::FromMicroseconds(
         kOneMinusBeta * mean_deviation_.ToMicroseconds() +
-        kBeta * abs(smoothed_rtt_.ToMicroseconds() - rtt.ToMicroseconds()));
+        kBeta *
+            std::abs(smoothed_rtt_.ToMicroseconds() - rtt.ToMicroseconds()));
     smoothed_rtt_ = QuicTime::Delta::FromMicroseconds(
         kOneMinusAlpha * smoothed_rtt_.ToMicroseconds() +
         kAlpha * rtt.ToMicroseconds());