| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 // as a result of these callbacks. | 149 // as a result of these callbacks. |
| 150 class NET_EXPORT_PRIVATE QuicConnectionDebugVisitor | 150 class NET_EXPORT_PRIVATE QuicConnectionDebugVisitor |
| 151 : public QuicPacketGenerator::DebugDelegate, | 151 : public QuicPacketGenerator::DebugDelegate, |
| 152 public QuicSentPacketManager::DebugDelegate { | 152 public QuicSentPacketManager::DebugDelegate { |
| 153 public: | 153 public: |
| 154 ~QuicConnectionDebugVisitor() override {} | 154 ~QuicConnectionDebugVisitor() override {} |
| 155 | 155 |
| 156 // Called when a packet has been sent. | 156 // Called when a packet has been sent. |
| 157 virtual void OnPacketSent(const SerializedPacket& serialized_packet, | 157 virtual void OnPacketSent(const SerializedPacket& serialized_packet, |
| 158 QuicPacketNumber original_packet_number, | 158 QuicPacketNumber original_packet_number, |
| 159 EncryptionLevel level, | |
| 160 TransmissionType transmission_type, | 159 TransmissionType transmission_type, |
| 161 size_t encrypted_length, | 160 size_t encrypted_length, |
| 162 QuicTime sent_time) {} | 161 QuicTime sent_time) {} |
| 163 | 162 |
| 164 // Called when a packet has been received, but before it is | 163 // Called when a packet has been received, but before it is |
| 165 // validated or parsed. | 164 // validated or parsed. |
| 166 virtual void OnPacketReceived(const IPEndPoint& self_address, | 165 virtual void OnPacketReceived(const IPEndPoint& self_address, |
| 167 const IPEndPoint& peer_address, | 166 const IPEndPoint& peer_address, |
| 168 const QuicEncryptedPacket& packet) {} | 167 const QuicEncryptedPacket& packet) {} |
| 169 | 168 |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 // Return the id of the cipher of the primary decrypter of the framer. | 625 // Return the id of the cipher of the primary decrypter of the framer. |
| 627 uint32 cipher_id() const { return framer_.decrypter()->cipher_id(); } | 626 uint32 cipher_id() const { return framer_.decrypter()->cipher_id(); } |
| 628 | 627 |
| 629 std::vector<QuicEncryptedPacket*>* termination_packets() { | 628 std::vector<QuicEncryptedPacket*>* termination_packets() { |
| 630 return termination_packets_.get(); | 629 return termination_packets_.get(); |
| 631 } | 630 } |
| 632 | 631 |
| 633 protected: | 632 protected: |
| 634 // Packets which have not been written to the wire. | 633 // Packets which have not been written to the wire. |
| 635 struct QueuedPacket { | 634 struct QueuedPacket { |
| 635 explicit QueuedPacket(SerializedPacket packet); |
| 636 QueuedPacket(SerializedPacket packet, | 636 QueuedPacket(SerializedPacket packet, |
| 637 EncryptionLevel level); | |
| 638 QueuedPacket(SerializedPacket packet, | |
| 639 EncryptionLevel level, | |
| 640 TransmissionType transmission_type, | 637 TransmissionType transmission_type, |
| 641 QuicPacketNumber original_packet_number); | 638 QuicPacketNumber original_packet_number); |
| 642 | 639 |
| 643 SerializedPacket serialized_packet; | 640 SerializedPacket serialized_packet; |
| 644 const EncryptionLevel encryption_level; | |
| 645 TransmissionType transmission_type; | 641 TransmissionType transmission_type; |
| 646 // The packet's original packet number if it is a retransmission. | 642 // The packet's original packet number if it is a retransmission. |
| 647 // Otherwise it must be 0. | 643 // Otherwise it must be 0. |
| 648 QuicPacketNumber original_packet_number; | 644 QuicPacketNumber original_packet_number; |
| 649 }; | 645 }; |
| 650 | 646 |
| 651 // Do any work which logically would be done in OnPacket but can not be | 647 // Do any work which logically would be done in OnPacket but can not be |
| 652 // safely done until the packet is validated. Returns true if the packet | 648 // safely done until the packet is validated. Returns true if the packet |
| 653 // can be handled, false otherwise. Also migrates the connection if the packet | 649 // can be handled, false otherwise. Also migrates the connection if the packet |
| 654 // can be handled and peer address changes. | 650 // can be handled and peer address changes. |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 | 983 |
| 988 // Whether a GoAway has been received. | 984 // Whether a GoAway has been received. |
| 989 bool goaway_received_; | 985 bool goaway_received_; |
| 990 | 986 |
| 991 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 987 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 992 }; | 988 }; |
| 993 | 989 |
| 994 } // namespace net | 990 } // namespace net |
| 995 | 991 |
| 996 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 992 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |