| 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 | 380 |
| 381 // Called by the crypto stream when the handshake completes. In the server's | 381 // Called by the crypto stream when the handshake completes. In the server's |
| 382 // case this is when the SHLO has been ACKed. Clients call this on receipt of | 382 // case this is when the SHLO has been ACKed. Clients call this on receipt of |
| 383 // the SHLO. | 383 // the SHLO. |
| 384 void OnHandshakeComplete(); | 384 void OnHandshakeComplete(); |
| 385 | 385 |
| 386 // Accessors | 386 // Accessors |
| 387 void set_visitor(QuicConnectionVisitorInterface* visitor) { | 387 void set_visitor(QuicConnectionVisitorInterface* visitor) { |
| 388 visitor_ = visitor; | 388 visitor_ = visitor; |
| 389 } | 389 } |
| 390 // This method takes ownership of |debug_visitor|. | |
| 391 void set_debug_visitor(QuicConnectionDebugVisitor* debug_visitor) { | 390 void set_debug_visitor(QuicConnectionDebugVisitor* debug_visitor) { |
| 392 debug_visitor_.reset(debug_visitor); | 391 debug_visitor_ = debug_visitor; |
| 393 packet_generator_.set_debug_delegate(debug_visitor); | 392 packet_generator_.set_debug_delegate(debug_visitor); |
| 394 sent_packet_manager_.set_debug_delegate(debug_visitor); | 393 sent_packet_manager_.set_debug_delegate(debug_visitor); |
| 395 } | 394 } |
| 396 const IPEndPoint& self_address() const { return self_address_; } | 395 const IPEndPoint& self_address() const { return self_address_; } |
| 397 const IPEndPoint& peer_address() const { return peer_address_; } | 396 const IPEndPoint& peer_address() const { return peer_address_; } |
| 398 QuicConnectionId connection_id() const { return connection_id_; } | 397 QuicConnectionId connection_id() const { return connection_id_; } |
| 399 const QuicClock* clock() const { return clock_; } | 398 const QuicClock* clock() const { return clock_; } |
| 400 QuicRandom* random_generator() const { return random_generator_; } | 399 QuicRandom* random_generator() const { return random_generator_; } |
| 401 QuicByteCount max_packet_length() const; | 400 QuicByteCount max_packet_length() const; |
| 402 void set_max_packet_length(QuicByteCount length); | 401 void set_max_packet_length(QuicByteCount length); |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 // a delay before sending packets and fires when the packet may be sent. | 760 // a delay before sending packets and fires when the packet may be sent. |
| 762 scoped_ptr<QuicAlarm> send_alarm_; | 761 scoped_ptr<QuicAlarm> send_alarm_; |
| 763 // An alarm that is scheduled when the connection can still write and there | 762 // An alarm that is scheduled when the connection can still write and there |
| 764 // may be more data to send. | 763 // may be more data to send. |
| 765 scoped_ptr<QuicAlarm> resume_writes_alarm_; | 764 scoped_ptr<QuicAlarm> resume_writes_alarm_; |
| 766 // An alarm that fires when the connection may have timed out. | 765 // An alarm that fires when the connection may have timed out. |
| 767 scoped_ptr<QuicAlarm> timeout_alarm_; | 766 scoped_ptr<QuicAlarm> timeout_alarm_; |
| 768 // An alarm that fires when a ping should be sent. | 767 // An alarm that fires when a ping should be sent. |
| 769 scoped_ptr<QuicAlarm> ping_alarm_; | 768 scoped_ptr<QuicAlarm> ping_alarm_; |
| 770 | 769 |
| 770 // Neither visitor is owned by this class. |
| 771 QuicConnectionVisitorInterface* visitor_; | 771 QuicConnectionVisitorInterface* visitor_; |
| 772 scoped_ptr<QuicConnectionDebugVisitor> debug_visitor_; | 772 QuicConnectionDebugVisitor* debug_visitor_; |
| 773 |
| 773 QuicPacketGenerator packet_generator_; | 774 QuicPacketGenerator packet_generator_; |
| 774 | 775 |
| 775 // An alarm that fires when an FEC packet should be sent. | 776 // An alarm that fires when an FEC packet should be sent. |
| 776 scoped_ptr<QuicAlarm> fec_alarm_; | 777 scoped_ptr<QuicAlarm> fec_alarm_; |
| 777 | 778 |
| 778 // Network idle time before we kill of this connection. | 779 // Network idle time before we kill of this connection. |
| 779 QuicTime::Delta idle_network_timeout_; | 780 QuicTime::Delta idle_network_timeout_; |
| 780 // Overall connection timeout. | 781 // Overall connection timeout. |
| 781 QuicTime::Delta overall_connection_timeout_; | 782 QuicTime::Delta overall_connection_timeout_; |
| 782 | 783 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 836 | 837 |
| 837 // True if this is a secure QUIC connection. | 838 // True if this is a secure QUIC connection. |
| 838 bool is_secure_; | 839 bool is_secure_; |
| 839 | 840 |
| 840 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 841 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 841 }; | 842 }; |
| 842 | 843 |
| 843 } // namespace net | 844 } // namespace net |
| 844 | 845 |
| 845 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 846 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |