| 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 1778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1789 QuicTime::Delta rtt = sent_packet_manager_.GetRttStats()->smoothed_rtt(); | 1789 QuicTime::Delta rtt = sent_packet_manager_.GetRttStats()->smoothed_rtt(); |
| 1790 if (rtt.IsZero()) { | 1790 if (rtt.IsZero()) { |
| 1791 rtt = QuicTime::Delta::FromMicroseconds( | 1791 rtt = QuicTime::Delta::FromMicroseconds( |
| 1792 sent_packet_manager_.GetRttStats()->initial_rtt_us()); | 1792 sent_packet_manager_.GetRttStats()->initial_rtt_us()); |
| 1793 } | 1793 } |
| 1794 if (debug_visitor_) | 1794 if (debug_visitor_) |
| 1795 debug_visitor_->OnRttChanged(rtt); | 1795 debug_visitor_->OnRttChanged(rtt); |
| 1796 packet_generator_.OnRttChange(rtt); | 1796 packet_generator_.OnRttChange(rtt); |
| 1797 } | 1797 } |
| 1798 | 1798 |
| 1799 void QuicConnection::OnPathDegrading() { |
| 1800 visitor_->OnPathDegrading(); |
| 1801 } |
| 1802 |
| 1799 void QuicConnection::OnHandshakeComplete() { | 1803 void QuicConnection::OnHandshakeComplete() { |
| 1800 sent_packet_manager_.SetHandshakeConfirmed(); | 1804 sent_packet_manager_.SetHandshakeConfirmed(); |
| 1801 // The client should immediately ack the SHLO to confirm the handshake is | 1805 // The client should immediately ack the SHLO to confirm the handshake is |
| 1802 // complete with the server. | 1806 // complete with the server. |
| 1803 if (perspective_ == Perspective::IS_CLIENT && !ack_queued_ && | 1807 if (perspective_ == Perspective::IS_CLIENT && !ack_queued_ && |
| 1804 ack_frame_updated()) { | 1808 ack_frame_updated()) { |
| 1805 ack_alarm_->Cancel(); | 1809 ack_alarm_->Cancel(); |
| 1806 ack_alarm_->Set(clock_->ApproximateNow()); | 1810 ack_alarm_->Set(clock_->ApproximateNow()); |
| 1807 } | 1811 } |
| 1808 } | 1812 } |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2448 void QuicConnection::OnPathClosed(QuicPathId path_id) { | 2452 void QuicConnection::OnPathClosed(QuicPathId path_id) { |
| 2449 // Stop receiving packets on this path. | 2453 // Stop receiving packets on this path. |
| 2450 framer_.OnPathClosed(path_id); | 2454 framer_.OnPathClosed(path_id); |
| 2451 } | 2455 } |
| 2452 | 2456 |
| 2453 bool QuicConnection::ack_frame_updated() const { | 2457 bool QuicConnection::ack_frame_updated() const { |
| 2454 return received_packet_manager_.ack_frame_updated(); | 2458 return received_packet_manager_.ack_frame_updated(); |
| 2455 } | 2459 } |
| 2456 | 2460 |
| 2457 } // namespace net | 2461 } // namespace net |
| OLD | NEW |