| 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 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 682 bool SelectMutualVersion(const QuicVersionVector& available_versions); | 682 bool SelectMutualVersion(const QuicVersionVector& available_versions); |
| 683 | 683 |
| 684 bool peer_ip_changed() const { return peer_ip_changed_; } | 684 bool peer_ip_changed() const { return peer_ip_changed_; } |
| 685 | 685 |
| 686 bool peer_port_changed() const { return peer_port_changed_; } | 686 bool peer_port_changed() const { return peer_port_changed_; } |
| 687 | 687 |
| 688 const IPAddressNumber& migrating_peer_ip() const { | 688 const IPAddressNumber& migrating_peer_ip() const { |
| 689 return migrating_peer_ip_; | 689 return migrating_peer_ip_; |
| 690 } | 690 } |
| 691 | 691 |
| 692 // Returns the current per-packet options for the connection. |
| 693 PerPacketOptions* per_packet_options() { return per_packet_options_; } |
| 694 // Sets the current per-packet options for the connection. The QuicConnection |
| 695 // does not take ownership of |options|; |options| must live for as long as |
| 696 // the QuicConnection is in use. |
| 697 void set_per_packet_options(PerPacketOptions* options) { |
| 698 per_packet_options_ = options; |
| 699 } |
| 700 |
| 692 private: | 701 private: |
| 693 friend class test::QuicConnectionPeer; | 702 friend class test::QuicConnectionPeer; |
| 694 friend class test::PacketSavingConnection; | 703 friend class test::PacketSavingConnection; |
| 695 | 704 |
| 696 typedef std::list<SerializedPacket> QueuedPacketList; | 705 typedef std::list<SerializedPacket> QueuedPacketList; |
| 697 typedef std::map<QuicFecGroupNumber, QuicFecGroup*> FecGroupMap; | 706 typedef std::map<QuicFecGroupNumber, QuicFecGroup*> FecGroupMap; |
| 698 | 707 |
| 699 // Writes the given packet to socket, encrypted with packet's | 708 // Writes the given packet to socket, encrypted with packet's |
| 700 // encryption_level. Returns true on successful write, and false if the writer | 709 // encryption_level. Returns true on successful write, and false if the writer |
| 701 // was blocked and the write needs to be tried again. Notifies the | 710 // was blocked and the write needs to be tried again. Notifies the |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 // frame is sent or received. Stops receiving packets on closed path. Drops | 816 // frame is sent or received. Stops receiving packets on closed path. Drops |
| 808 // receive side of a closed path, and packets with retransmittable frames on a | 817 // receive side of a closed path, and packets with retransmittable frames on a |
| 809 // closed path are marked as retransmissions which will be transmitted on | 818 // closed path are marked as retransmissions which will be transmitted on |
| 810 // other paths. | 819 // other paths. |
| 811 // TODO(fayang): complete OnPathClosed once QuicMultipathSentPacketManager and | 820 // TODO(fayang): complete OnPathClosed once QuicMultipathSentPacketManager and |
| 812 // QuicMultipathReceivedPacketManager are landed in QuicConnection. | 821 // QuicMultipathReceivedPacketManager are landed in QuicConnection. |
| 813 void OnPathClosed(QuicPathId path_id); | 822 void OnPathClosed(QuicPathId path_id); |
| 814 | 823 |
| 815 QuicFramer framer_; | 824 QuicFramer framer_; |
| 816 QuicConnectionHelperInterface* helper_; // Not owned. | 825 QuicConnectionHelperInterface* helper_; // Not owned. |
| 826 PerPacketOptions* per_packet_options_; // Not owned. |
| 817 QuicPacketWriter* writer_; // Owned or not depending on |owns_writer_|. | 827 QuicPacketWriter* writer_; // Owned or not depending on |owns_writer_|. |
| 818 bool owns_writer_; | 828 bool owns_writer_; |
| 819 // Encryption level for new packets. Should only be changed via | 829 // Encryption level for new packets. Should only be changed via |
| 820 // SetDefaultEncryptionLevel(). | 830 // SetDefaultEncryptionLevel(). |
| 821 EncryptionLevel encryption_level_; | 831 EncryptionLevel encryption_level_; |
| 822 bool has_forward_secure_encrypter_; | 832 bool has_forward_secure_encrypter_; |
| 823 // The packet number of the first packet which will be encrypted with the | 833 // The packet number of the first packet which will be encrypted with the |
| 824 // foward-secure encrypter, even if the peer has not started sending | 834 // foward-secure encrypter, even if the peer has not started sending |
| 825 // forward-secure packets. | 835 // forward-secure packets. |
| 826 QuicPacketNumber first_required_forward_secure_packet_; | 836 QuicPacketNumber first_required_forward_secure_packet_; |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 | 1029 |
| 1020 // If true, multipath is enabled for this connection. | 1030 // If true, multipath is enabled for this connection. |
| 1021 bool multipath_enabled_; | 1031 bool multipath_enabled_; |
| 1022 | 1032 |
| 1023 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 1033 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 1024 }; | 1034 }; |
| 1025 | 1035 |
| 1026 } // namespace net | 1036 } // namespace net |
| 1027 | 1037 |
| 1028 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 1038 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |