OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_connection.h" | 5 #include "net/quic/quic_connection.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1821 visitor_->OnCongestionWindowChange(clock_->ApproximateNow()); | 1821 visitor_->OnCongestionWindowChange(clock_->ApproximateNow()); |
1822 } | 1822 } |
1823 | 1823 |
1824 void QuicConnection::OnRttChange() { | 1824 void QuicConnection::OnRttChange() { |
1825 // Uses the connection's smoothed RTT. If zero, uses initial_rtt. | 1825 // Uses the connection's smoothed RTT. If zero, uses initial_rtt. |
1826 QuicTime::Delta rtt = sent_packet_manager_.GetRttStats()->smoothed_rtt(); | 1826 QuicTime::Delta rtt = sent_packet_manager_.GetRttStats()->smoothed_rtt(); |
1827 if (rtt.IsZero()) { | 1827 if (rtt.IsZero()) { |
1828 rtt = QuicTime::Delta::FromMicroseconds( | 1828 rtt = QuicTime::Delta::FromMicroseconds( |
1829 sent_packet_manager_.GetRttStats()->initial_rtt_us()); | 1829 sent_packet_manager_.GetRttStats()->initial_rtt_us()); |
1830 } | 1830 } |
| 1831 if (debug_visitor_) |
| 1832 debug_visitor_->OnRttChanged(rtt); |
1831 packet_generator_.OnRttChange(rtt); | 1833 packet_generator_.OnRttChange(rtt); |
1832 } | 1834 } |
1833 | 1835 |
1834 void QuicConnection::OnHandshakeComplete() { | 1836 void QuicConnection::OnHandshakeComplete() { |
1835 sent_packet_manager_.SetHandshakeConfirmed(); | 1837 sent_packet_manager_.SetHandshakeConfirmed(); |
1836 // The client should immediately ack the SHLO to confirm the handshake is | 1838 // The client should immediately ack the SHLO to confirm the handshake is |
1837 // complete with the server. | 1839 // complete with the server. |
1838 if (perspective_ == Perspective::IS_CLIENT && !ack_queued_) { | 1840 if (perspective_ == Perspective::IS_CLIENT && !ack_queued_) { |
1839 ack_alarm_->Cancel(); | 1841 ack_alarm_->Cancel(); |
1840 ack_alarm_->Set(clock_->ApproximateNow()); | 1842 ack_alarm_->Set(clock_->ApproximateNow()); |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2451 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; | 2453 packet_number_of_last_sent_packet_ + packets_between_mtu_probes_ + 1; |
2452 ++mtu_probe_count_; | 2454 ++mtu_probe_count_; |
2453 | 2455 |
2454 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; | 2456 DVLOG(2) << "Sending a path MTU discovery packet #" << mtu_probe_count_; |
2455 SendMtuDiscoveryPacket(mtu_discovery_target_); | 2457 SendMtuDiscoveryPacket(mtu_discovery_target_); |
2456 | 2458 |
2457 DCHECK(!mtu_discovery_alarm_->IsSet()); | 2459 DCHECK(!mtu_discovery_alarm_->IsSet()); |
2458 } | 2460 } |
2459 | 2461 |
2460 } // namespace net | 2462 } // namespace net |
OLD | NEW |