| 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 // The entity that handles framing writes for a Quic client or server. | 5 // The entity that handles framing writes for a Quic client or server. |
| 6 // Each QuicSession will have a connection associated with it. | 6 // Each QuicSession will have a connection associated with it. |
| 7 // | 7 // |
| 8 // On the server side, the Dispatcher handles the raw reads, and hands off | 8 // On the server side, the Dispatcher handles the raw reads, and hands off |
| 9 // packets via ProcessUdpPacket for framing and processing. | 9 // packets via ProcessUdpPacket for framing and processing. |
| 10 // | 10 // |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // Interface which gets callbacks from the QuicConnection at interesting | 161 // Interface which gets callbacks from the QuicConnection at interesting |
| 162 // points. Implementations must not mutate the state of the connection | 162 // points. Implementations must not mutate the state of the connection |
| 163 // as a result of these callbacks. | 163 // as a result of these callbacks. |
| 164 class NET_EXPORT_PRIVATE QuicConnectionDebugVisitor | 164 class NET_EXPORT_PRIVATE QuicConnectionDebugVisitor |
| 165 : public QuicSentPacketManager::DebugDelegate { | 165 : public QuicSentPacketManager::DebugDelegate { |
| 166 public: | 166 public: |
| 167 ~QuicConnectionDebugVisitor() override {} | 167 ~QuicConnectionDebugVisitor() override {} |
| 168 | 168 |
| 169 // Called when a packet has been sent. | 169 // Called when a packet has been sent. |
| 170 virtual void OnPacketSent(const SerializedPacket& serialized_packet, | 170 virtual void OnPacketSent(const SerializedPacket& serialized_packet, |
| 171 QuicPathId original_path_id, |
| 171 QuicPacketNumber original_packet_number, | 172 QuicPacketNumber original_packet_number, |
| 172 TransmissionType transmission_type, | 173 TransmissionType transmission_type, |
| 173 QuicTime sent_time) {} | 174 QuicTime sent_time) {} |
| 174 | 175 |
| 175 // Called when a packet has been received, but before it is | 176 // Called when a packet has been received, but before it is |
| 176 // validated or parsed. | 177 // validated or parsed. |
| 177 virtual void OnPacketReceived(const IPEndPoint& self_address, | 178 virtual void OnPacketReceived(const IPEndPoint& self_address, |
| 178 const IPEndPoint& peer_address, | 179 const IPEndPoint& peer_address, |
| 179 const QuicEncryptedPacket& packet) {} | 180 const QuicEncryptedPacket& packet) {} |
| 180 | 181 |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 const QuicFrame GetUpdatedAckFrame() override; | 454 const QuicFrame GetUpdatedAckFrame() override; |
| 454 void PopulateStopWaitingFrame(QuicStopWaitingFrame* stop_waiting) override; | 455 void PopulateStopWaitingFrame(QuicStopWaitingFrame* stop_waiting) override; |
| 455 | 456 |
| 456 // QuicPacketCreator::DelegateInterface | 457 // QuicPacketCreator::DelegateInterface |
| 457 void OnSerializedPacket(SerializedPacket* packet) override; | 458 void OnSerializedPacket(SerializedPacket* packet) override; |
| 458 void OnUnrecoverableError(QuicErrorCode error, | 459 void OnUnrecoverableError(QuicErrorCode error, |
| 459 const std::string& error_details, | 460 const std::string& error_details, |
| 460 ConnectionCloseSource source) override; | 461 ConnectionCloseSource source) override; |
| 461 | 462 |
| 462 // QuicSentPacketManager::NetworkChangeVisitor | 463 // QuicSentPacketManager::NetworkChangeVisitor |
| 463 void OnCongestionWindowChange() override; | 464 void OnCongestionChange() override; |
| 464 void OnRttChange() override; | |
| 465 void OnPathDegrading() override; | 465 void OnPathDegrading() override; |
| 466 | 466 |
| 467 // Called by the crypto stream when the handshake completes. In the server's | 467 // Called by the crypto stream when the handshake completes. In the server's |
| 468 // case this is when the SHLO has been ACKed. Clients call this on receipt of | 468 // case this is when the SHLO has been ACKed. Clients call this on receipt of |
| 469 // the SHLO. | 469 // the SHLO. |
| 470 void OnHandshakeComplete(); | 470 void OnHandshakeComplete(); |
| 471 | 471 |
| 472 // Accessors | 472 // Accessors |
| 473 void set_visitor(QuicConnectionVisitorInterface* visitor) { | 473 void set_visitor(QuicConnectionVisitorInterface* visitor) { |
| 474 visitor_ = visitor; | 474 visitor_ = visitor; |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 958 | 958 |
| 959 // An alarm that fires when an ACK should be sent to the peer. | 959 // An alarm that fires when an ACK should be sent to the peer. |
| 960 QuicArenaScopedPtr<QuicAlarm> ack_alarm_; | 960 QuicArenaScopedPtr<QuicAlarm> ack_alarm_; |
| 961 // An alarm that fires when a packet needs to be retransmitted. | 961 // An alarm that fires when a packet needs to be retransmitted. |
| 962 QuicArenaScopedPtr<QuicAlarm> retransmission_alarm_; | 962 QuicArenaScopedPtr<QuicAlarm> retransmission_alarm_; |
| 963 // An alarm that is scheduled when the SentPacketManager requires a delay | 963 // An alarm that is scheduled when the SentPacketManager requires a delay |
| 964 // before sending packets and fires when the packet may be sent. | 964 // before sending packets and fires when the packet may be sent. |
| 965 QuicArenaScopedPtr<QuicAlarm> send_alarm_; | 965 QuicArenaScopedPtr<QuicAlarm> send_alarm_; |
| 966 // An alarm that is scheduled when the connection can still write and there | 966 // An alarm that is scheduled when the connection can still write and there |
| 967 // may be more data to send. | 967 // may be more data to send. |
| 968 // TODO(ianswett): Remove resume_writes_alarm when deprecating |
| 969 // FLAGS_quic_only_one_sending_alarm |
| 968 QuicArenaScopedPtr<QuicAlarm> resume_writes_alarm_; | 970 QuicArenaScopedPtr<QuicAlarm> resume_writes_alarm_; |
| 969 // An alarm that fires when the connection may have timed out. | 971 // An alarm that fires when the connection may have timed out. |
| 970 QuicArenaScopedPtr<QuicAlarm> timeout_alarm_; | 972 QuicArenaScopedPtr<QuicAlarm> timeout_alarm_; |
| 971 // An alarm that fires when a ping should be sent. | 973 // An alarm that fires when a ping should be sent. |
| 972 QuicArenaScopedPtr<QuicAlarm> ping_alarm_; | 974 QuicArenaScopedPtr<QuicAlarm> ping_alarm_; |
| 973 // An alarm that fires when an MTU probe should be sent. | 975 // An alarm that fires when an MTU probe should be sent. |
| 974 QuicArenaScopedPtr<QuicAlarm> mtu_discovery_alarm_; | 976 QuicArenaScopedPtr<QuicAlarm> mtu_discovery_alarm_; |
| 975 | 977 |
| 976 // Neither visitor is owned by this class. | 978 // Neither visitor is owned by this class. |
| 977 QuicConnectionVisitorInterface* visitor_; | 979 QuicConnectionVisitorInterface* visitor_; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 | 1058 |
| 1057 // If true, multipath is enabled for this connection. | 1059 // If true, multipath is enabled for this connection. |
| 1058 bool multipath_enabled_; | 1060 bool multipath_enabled_; |
| 1059 | 1061 |
| 1060 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 1062 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 1061 }; | 1063 }; |
| 1062 | 1064 |
| 1063 } // namespace net | 1065 } // namespace net |
| 1064 | 1066 |
| 1065 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 1067 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |