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/tools/quic/quic_server_session_base.h" | 5 #include "net/tools/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 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 &crypto_config_, &compressed_certs_cache_, session_.get()); | 410 &crypto_config_, &compressed_certs_cache_, session_.get()); |
411 QuicServerSessionBasePeer::SetCryptoStream(session_.get(), crypto_stream); | 411 QuicServerSessionBasePeer::SetCryptoStream(session_.get(), crypto_stream); |
412 | 412 |
413 // Set some initial bandwidth values. | 413 // Set some initial bandwidth values. |
414 QuicSentPacketManager* sent_packet_manager = | 414 QuicSentPacketManager* sent_packet_manager = |
415 QuicConnectionPeer::GetSentPacketManager(session_->connection()); | 415 QuicConnectionPeer::GetSentPacketManager(session_->connection()); |
416 QuicSustainedBandwidthRecorder& bandwidth_recorder = | 416 QuicSustainedBandwidthRecorder& bandwidth_recorder = |
417 QuicSentPacketManagerPeer::GetBandwidthRecorder(sent_packet_manager); | 417 QuicSentPacketManagerPeer::GetBandwidthRecorder(sent_packet_manager); |
418 // Seed an rtt measurement equal to the initial default rtt. | 418 // Seed an rtt measurement equal to the initial default rtt. |
419 RttStats* rtt_stats = | 419 RttStats* rtt_stats = |
420 QuicSentPacketManagerPeer::GetRttStats(sent_packet_manager); | 420 const_cast<RttStats*>(sent_packet_manager->GetRttStats()); |
421 rtt_stats->UpdateRtt( | 421 rtt_stats->UpdateRtt( |
422 QuicTime::Delta::FromMicroseconds(rtt_stats->initial_rtt_us()), | 422 QuicTime::Delta::FromMicroseconds(rtt_stats->initial_rtt_us()), |
423 QuicTime::Delta::Zero(), QuicTime::Zero()); | 423 QuicTime::Delta::Zero(), QuicTime::Zero()); |
424 QuicSustainedBandwidthRecorderPeer::SetBandwidthEstimate( | 424 QuicSustainedBandwidthRecorderPeer::SetBandwidthEstimate( |
425 &bandwidth_recorder, bandwidth_estimate_kbytes_per_second); | 425 &bandwidth_recorder, bandwidth_estimate_kbytes_per_second); |
426 QuicSustainedBandwidthRecorderPeer::SetMaxBandwidthEstimate( | 426 QuicSustainedBandwidthRecorderPeer::SetMaxBandwidthEstimate( |
427 &bandwidth_recorder, max_bandwidth_estimate_kbytes_per_second, | 427 &bandwidth_recorder, max_bandwidth_estimate_kbytes_per_second, |
428 max_bandwidth_estimate_timestamp); | 428 max_bandwidth_estimate_timestamp); |
429 // Queue up some pending data. | 429 // Queue up some pending data. |
430 session_->MarkConnectionLevelWriteBlocked(kCryptoStreamId); | 430 session_->MarkConnectionLevelWriteBlocked(kCryptoStreamId); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 EXPECT_FALSE( | 549 EXPECT_FALSE( |
550 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); | 550 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); |
551 session_->OnConfigNegotiated(); | 551 session_->OnConfigNegotiated(); |
552 EXPECT_FALSE( | 552 EXPECT_FALSE( |
553 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); | 553 QuicServerSessionBasePeer::IsBandwidthResumptionEnabled(session_.get())); |
554 } | 554 } |
555 | 555 |
556 } // namespace | 556 } // namespace |
557 } // namespace test | 557 } // namespace test |
558 } // namespace net | 558 } // namespace net |
OLD | NEW |