| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/quic_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 } | 780 } |
| 781 | 781 |
| 782 const RttStats* QuicSentPacketManager::GetRttStats() const { | 782 const RttStats* QuicSentPacketManager::GetRttStats() const { |
| 783 return &rtt_stats_; | 783 return &rtt_stats_; |
| 784 } | 784 } |
| 785 | 785 |
| 786 QuicBandwidth QuicSentPacketManager::BandwidthEstimate() const { | 786 QuicBandwidth QuicSentPacketManager::BandwidthEstimate() const { |
| 787 return send_algorithm_->BandwidthEstimate(); | 787 return send_algorithm_->BandwidthEstimate(); |
| 788 } | 788 } |
| 789 | 789 |
| 790 bool QuicSentPacketManager::HasReliableBandwidthEstimate() const { |
| 791 return send_algorithm_->HasReliableBandwidthEstimate(); |
| 792 } |
| 793 |
| 790 QuicByteCount QuicSentPacketManager::GetCongestionWindow() const { | 794 QuicByteCount QuicSentPacketManager::GetCongestionWindow() const { |
| 791 return send_algorithm_->GetCongestionWindow(); | 795 return send_algorithm_->GetCongestionWindow(); |
| 792 } | 796 } |
| 793 | 797 |
| 794 void QuicSentPacketManager::MaybeEnablePacing() { | 798 void QuicSentPacketManager::MaybeEnablePacing() { |
| 795 if (!FLAGS_enable_quic_pacing) { | 799 if (!FLAGS_enable_quic_pacing) { |
| 796 return; | 800 return; |
| 797 } | 801 } |
| 798 | 802 |
| 799 if (using_pacing_) { | 803 if (using_pacing_) { |
| 800 return; | 804 return; |
| 801 } | 805 } |
| 802 | 806 |
| 803 // Set up a pacing sender with a 5 millisecond alarm granularity. | 807 // Set up a pacing sender with a 5 millisecond alarm granularity. |
| 804 using_pacing_ = true; | 808 using_pacing_ = true; |
| 805 send_algorithm_.reset( | 809 send_algorithm_.reset( |
| 806 new PacingSender(send_algorithm_.release(), | 810 new PacingSender(send_algorithm_.release(), |
| 807 QuicTime::Delta::FromMilliseconds(5))); | 811 QuicTime::Delta::FromMilliseconds(5))); |
| 808 } | 812 } |
| 809 | 813 |
| 810 } // namespace net | 814 } // namespace net |
| OLD | NEW |