| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/core/congestion_control/bbr_sender.h" | 5 #include "net/quic/core/congestion_control/bbr_sender.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 Perspective::IS_CLIENT, | 74 Perspective::IS_CLIENT, |
| 75 42), | 75 42), |
| 76 receiver_(&simulator_, | 76 receiver_(&simulator_, |
| 77 "Receiver", | 77 "Receiver", |
| 78 "BBR sender", | 78 "BBR sender", |
| 79 Perspective::IS_SERVER, | 79 Perspective::IS_SERVER, |
| 80 42) { | 80 42) { |
| 81 FLAGS_quic_bbr_faster_startup = true; | 81 FLAGS_quic_bbr_faster_startup = true; |
| 82 | 82 |
| 83 rtt_stats_ = bbr_sender_.connection()->sent_packet_manager().GetRttStats(); | 83 rtt_stats_ = bbr_sender_.connection()->sent_packet_manager().GetRttStats(); |
| 84 sender_ = new BbrSender(simulator_.GetClock(), rtt_stats_, | 84 sender_ = new BbrSender(rtt_stats_, |
| 85 QuicSentPacketManagerPeer::GetUnackedPacketMap( | 85 QuicSentPacketManagerPeer::GetUnackedPacketMap( |
| 86 QuicConnectionPeer::GetSentPacketManager( | 86 QuicConnectionPeer::GetSentPacketManager( |
| 87 bbr_sender_.connection(), kDefaultPathId)), | 87 bbr_sender_.connection(), kDefaultPathId)), |
| 88 kInitialCongestionWindowPackets, | 88 kInitialCongestionWindowPackets, |
| 89 kDefaultMaxCongestionWindowPackets, &random_); | 89 kDefaultMaxCongestionWindowPackets, &random_); |
| 90 QuicConnectionPeer::SetSendAlgorithm(bbr_sender_.connection(), | 90 QuicConnectionPeer::SetSendAlgorithm(bbr_sender_.connection(), |
| 91 kDefaultPathId, sender_); | 91 kDefaultPathId, sender_); |
| 92 | 92 |
| 93 clock_ = simulator_.GetClock(); | 93 clock_ = simulator_.GetClock(); |
| 94 simulator_.set_random_generator(&random_); | 94 simulator_.set_random_generator(&random_); |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 // Send another packet. | 459 // Send another packet. |
| 460 bbr_sender_.AddBytesToTransfer(1000); | 460 bbr_sender_.AddBytesToTransfer(1000); |
| 461 simulator_result = simulator_.RunUntilOrTimeout( | 461 simulator_result = simulator_.RunUntilOrTimeout( |
| 462 [this]() { return receiver_.bytes_received() == 2000; }, timeout); | 462 [this]() { return receiver_.bytes_received() == 2000; }, timeout); |
| 463 ASSERT_TRUE(simulator_result); | 463 ASSERT_TRUE(simulator_result); |
| 464 EXPECT_GE(sender_->PacingRate(0), initial_rate); | 464 EXPECT_GE(sender_->PacingRate(0), initial_rate); |
| 465 } | 465 } |
| 466 | 466 |
| 467 } // namespace test | 467 } // namespace test |
| 468 } // namespace net | 468 } // namespace net |
| OLD | NEW |