| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/inter_arrival_sender.h" | 5 #include "net/quic/congestion_control/inter_arrival_sender.h" |
| 6 | 6 |
| 7 namespace net { | 7 namespace net { |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 const int64 kProbeBitrateKBytesPerSecond = 1200; // 9.6 Mbit/s | 10 const int64 kProbeBitrateKBytesPerSecond = 1200; // 9.6 Mbit/s |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 } | 317 } |
| 318 return smoothed_rtt_; | 318 return smoothed_rtt_; |
| 319 } | 319 } |
| 320 | 320 |
| 321 QuicTime::Delta InterArrivalSender::RetransmissionDelay() { | 321 QuicTime::Delta InterArrivalSender::RetransmissionDelay() { |
| 322 // TODO(pwestin): Calculate and return retransmission delay. | 322 // TODO(pwestin): Calculate and return retransmission delay. |
| 323 // Use 2 * the smoothed RTT for now. | 323 // Use 2 * the smoothed RTT for now. |
| 324 return smoothed_rtt_.Add(smoothed_rtt_); | 324 return smoothed_rtt_.Add(smoothed_rtt_); |
| 325 } | 325 } |
| 326 | 326 |
| 327 QuicByteCount InterArrivalSender::GetCongestionWindow() { |
| 328 return 0; |
| 329 } |
| 330 |
| 331 void InterArrivalSender::SetCongestionWindow(QuicByteCount window) { |
| 332 } |
| 333 |
| 327 void InterArrivalSender::EstimateNewBandwidth(QuicTime feedback_receive_time, | 334 void InterArrivalSender::EstimateNewBandwidth(QuicTime feedback_receive_time, |
| 328 QuicBandwidth sent_bandwidth) { | 335 QuicBandwidth sent_bandwidth) { |
| 329 QuicBandwidth new_bandwidth = bitrate_ramp_up_->GetNewBitrate(sent_bandwidth); | 336 QuicBandwidth new_bandwidth = bitrate_ramp_up_->GetNewBitrate(sent_bandwidth); |
| 330 if (current_bandwidth_ == new_bandwidth) { | 337 if (current_bandwidth_ == new_bandwidth) { |
| 331 return; | 338 return; |
| 332 } | 339 } |
| 333 current_bandwidth_ = new_bandwidth; | 340 current_bandwidth_ = new_bandwidth; |
| 334 state_machine_->IncreaseBitrateDecision(); | 341 state_machine_->IncreaseBitrateDecision(); |
| 335 | 342 |
| 336 QuicBandwidth channel_estimate = QuicBandwidth::Zero(); | 343 QuicBandwidth channel_estimate = QuicBandwidth::Zero(); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 bitrate_ramp_up_->Reset(new_rate, current_bandwidth_, channel_estimate); | 506 bitrate_ramp_up_->Reset(new_rate, current_bandwidth_, channel_estimate); |
| 500 if (new_rate != current_bandwidth_) { | 507 if (new_rate != current_bandwidth_) { |
| 501 current_bandwidth_ = new_rate; | 508 current_bandwidth_ = new_rate; |
| 502 paced_sender_->UpdateBandwidthEstimate(feedback_receive_time, | 509 paced_sender_->UpdateBandwidthEstimate(feedback_receive_time, |
| 503 current_bandwidth_); | 510 current_bandwidth_); |
| 504 state_machine_->DecreaseBitrateDecision(); | 511 state_machine_->DecreaseBitrateDecision(); |
| 505 } | 512 } |
| 506 } | 513 } |
| 507 | 514 |
| 508 } // namespace net | 515 } // namespace net |
| OLD | NEW |