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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 virtual QuicAckFrame* CreateAckFrame() OVERRIDE; | 350 virtual QuicAckFrame* CreateAckFrame() OVERRIDE; |
351 virtual QuicCongestionFeedbackFrame* CreateFeedbackFrame() OVERRIDE; | 351 virtual QuicCongestionFeedbackFrame* CreateFeedbackFrame() OVERRIDE; |
352 virtual QuicStopWaitingFrame* CreateStopWaitingFrame() OVERRIDE; | 352 virtual QuicStopWaitingFrame* CreateStopWaitingFrame() OVERRIDE; |
353 virtual bool OnSerializedPacket(const SerializedPacket& packet) OVERRIDE; | 353 virtual bool OnSerializedPacket(const SerializedPacket& packet) OVERRIDE; |
354 | 354 |
355 // Accessors | 355 // Accessors |
356 void set_visitor(QuicConnectionVisitorInterface* visitor) { | 356 void set_visitor(QuicConnectionVisitorInterface* visitor) { |
357 visitor_ = visitor; | 357 visitor_ = visitor; |
358 } | 358 } |
359 void set_debug_visitor(QuicConnectionDebugVisitor* debug_visitor) { | 359 void set_debug_visitor(QuicConnectionDebugVisitor* debug_visitor) { |
360 debug_visitor_ = debug_visitor; | 360 debug_visitor_.reset(debug_visitor); |
361 packet_generator_.set_debug_delegate(debug_visitor); | 361 packet_generator_.set_debug_delegate(debug_visitor); |
362 sent_packet_manager_.set_debug_delegate(debug_visitor); | 362 sent_packet_manager_.set_debug_delegate(debug_visitor); |
363 } | 363 } |
364 const IPEndPoint& self_address() const { return self_address_; } | 364 const IPEndPoint& self_address() const { return self_address_; } |
365 const IPEndPoint& peer_address() const { return peer_address_; } | 365 const IPEndPoint& peer_address() const { return peer_address_; } |
366 QuicConnectionId connection_id() const { return connection_id_; } | 366 QuicConnectionId connection_id() const { return connection_id_; } |
367 const QuicClock* clock() const { return clock_; } | 367 const QuicClock* clock() const { return clock_; } |
368 QuicRandom* random_generator() const { return random_generator_; } | 368 QuicRandom* random_generator() const { return random_generator_; } |
369 size_t max_packet_length() const; | 369 size_t max_packet_length() const; |
370 void set_max_packet_length(size_t length); | 370 void set_max_packet_length(size_t length); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 scoped_ptr<QuicAlarm> send_alarm_; | 712 scoped_ptr<QuicAlarm> send_alarm_; |
713 // An alarm that is scheduled when the connection can still write and there | 713 // An alarm that is scheduled when the connection can still write and there |
714 // may be more data to send. | 714 // may be more data to send. |
715 scoped_ptr<QuicAlarm> resume_writes_alarm_; | 715 scoped_ptr<QuicAlarm> resume_writes_alarm_; |
716 // An alarm that fires when the connection may have timed out. | 716 // An alarm that fires when the connection may have timed out. |
717 scoped_ptr<QuicAlarm> timeout_alarm_; | 717 scoped_ptr<QuicAlarm> timeout_alarm_; |
718 // An alarm that fires when a ping should be sent. | 718 // An alarm that fires when a ping should be sent. |
719 scoped_ptr<QuicAlarm> ping_alarm_; | 719 scoped_ptr<QuicAlarm> ping_alarm_; |
720 | 720 |
721 QuicConnectionVisitorInterface* visitor_; | 721 QuicConnectionVisitorInterface* visitor_; |
722 QuicConnectionDebugVisitor* debug_visitor_; | 722 scoped_ptr<QuicConnectionDebugVisitor> debug_visitor_; |
723 QuicPacketGenerator packet_generator_; | 723 QuicPacketGenerator packet_generator_; |
724 | 724 |
725 // Network idle time before we kill of this connection. | 725 // Network idle time before we kill of this connection. |
726 QuicTime::Delta idle_network_timeout_; | 726 QuicTime::Delta idle_network_timeout_; |
727 // Overall connection timeout. | 727 // Overall connection timeout. |
728 QuicTime::Delta overall_connection_timeout_; | 728 QuicTime::Delta overall_connection_timeout_; |
729 | 729 |
730 // Statistics for this session. | 730 // Statistics for this session. |
731 QuicConnectionStats stats_; | 731 QuicConnectionStats stats_; |
732 | 732 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 // If non-empty this contains the set of versions received in a | 776 // If non-empty this contains the set of versions received in a |
777 // version negotiation packet. | 777 // version negotiation packet. |
778 QuicVersionVector server_supported_versions_; | 778 QuicVersionVector server_supported_versions_; |
779 | 779 |
780 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 780 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
781 }; | 781 }; |
782 | 782 |
783 } // namespace net | 783 } // namespace net |
784 | 784 |
785 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 785 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
OLD | NEW |