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_server_session_base.h" | 5 #include "net/quic/quic_server_session_base.h" |
6 | 6 |
7 #include <cstdint> | 7 #include <cstdint> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 // Bandwidth estimate has now changed sufficiently but not enough time has | 452 // Bandwidth estimate has now changed sufficiently but not enough time has |
453 // passed to send a Server Config Update. | 453 // passed to send a Server Config Update. |
454 bandwidth_estimate_kbytes_per_second = | 454 bandwidth_estimate_kbytes_per_second = |
455 bandwidth_estimate_kbytes_per_second * 1.6; | 455 bandwidth_estimate_kbytes_per_second * 1.6; |
456 session_->OnCongestionWindowChange(now); | 456 session_->OnCongestionWindowChange(now); |
457 | 457 |
458 // Bandwidth estimate has now changed sufficiently and enough time has passed, | 458 // Bandwidth estimate has now changed sufficiently and enough time has passed, |
459 // but not enough packets have been sent. | 459 // but not enough packets have been sent. |
460 int64_t srtt_ms = | 460 int64_t srtt_ms = |
461 sent_packet_manager->GetRttStats()->smoothed_rtt().ToMilliseconds(); | 461 sent_packet_manager->GetRttStats()->smoothed_rtt().ToMilliseconds(); |
462 now = now.Add(QuicTime::Delta::FromMilliseconds( | 462 now = now + QuicTime::Delta::FromMilliseconds( |
463 kMinIntervalBetweenServerConfigUpdatesRTTs * srtt_ms)); | 463 kMinIntervalBetweenServerConfigUpdatesRTTs * srtt_ms); |
464 session_->OnCongestionWindowChange(now); | 464 session_->OnCongestionWindowChange(now); |
465 | 465 |
466 // The connection no longer has pending data to be written. | 466 // The connection no longer has pending data to be written. |
467 session_->OnCanWrite(); | 467 session_->OnCanWrite(); |
468 EXPECT_FALSE(session_->HasDataToWrite()); | 468 EXPECT_FALSE(session_->HasDataToWrite()); |
469 session_->OnCongestionWindowChange(now); | 469 session_->OnCongestionWindowChange(now); |
470 | 470 |
471 // Bandwidth estimate has now changed sufficiently, enough time has passed, | 471 // Bandwidth estimate has now changed sufficiently, enough time has passed, |
472 // and enough packets have been sent. | 472 // and enough packets have been sent. |
473 QuicConnectionPeer::SetPacketNumberOfLastSentPacket( | 473 QuicConnectionPeer::SetPacketNumberOfLastSentPacket( |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 EXPECT_FALSE( | 564 EXPECT_FALSE( |
565 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); | 565 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); |
566 session_->OnConfigNegotiated(); | 566 session_->OnConfigNegotiated(); |
567 EXPECT_FALSE( | 567 EXPECT_FALSE( |
568 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); | 568 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); |
569 } | 569 } |
570 | 570 |
571 } // namespace | 571 } // namespace |
572 } // namespace test | 572 } // namespace test |
573 } // namespace net | 573 } // namespace net |
OLD | NEW |