| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 // of the new alarm, which will not yet be "set" to fire. | 224 // of the new alarm, which will not yet be "set" to fire. |
| 225 virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) = 0; | 225 virtual QuicAlarm* CreateAlarm(QuicAlarm::Delegate* delegate) = 0; |
| 226 }; | 226 }; |
| 227 | 227 |
| 228 class NET_EXPORT_PRIVATE QuicConnection | 228 class NET_EXPORT_PRIVATE QuicConnection |
| 229 : public QuicFramerVisitorInterface, | 229 : public QuicFramerVisitorInterface, |
| 230 public QuicBlockedWriterInterface, | 230 public QuicBlockedWriterInterface, |
| 231 public QuicPacketGenerator::DelegateInterface, | 231 public QuicPacketGenerator::DelegateInterface, |
| 232 public QuicSentPacketManager::NetworkChangeVisitor { | 232 public QuicSentPacketManager::NetworkChangeVisitor { |
| 233 public: | 233 public: |
| 234 enum PacketType { | |
| 235 NORMAL, | |
| 236 QUEUED, | |
| 237 CONNECTION_CLOSE | |
| 238 }; | |
| 239 | |
| 240 enum AckBundling { | 234 enum AckBundling { |
| 241 NO_ACK = 0, | 235 NO_ACK = 0, |
| 242 SEND_ACK = 1, | 236 SEND_ACK = 1, |
| 243 BUNDLE_PENDING_ACK = 2, | 237 BUNDLE_PENDING_ACK = 2, |
| 244 }; | 238 }; |
| 245 | 239 |
| 246 class PacketWriterFactory { | 240 class PacketWriterFactory { |
| 247 public: | 241 public: |
| 248 virtual ~PacketWriterFactory() {} | 242 virtual ~PacketWriterFactory() {} |
| 249 | 243 |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 QueuedPacket(SerializedPacket packet, | 563 QueuedPacket(SerializedPacket packet, |
| 570 EncryptionLevel level, | 564 EncryptionLevel level, |
| 571 TransmissionType transmission_type); | 565 TransmissionType transmission_type); |
| 572 | 566 |
| 573 QuicPacketSequenceNumber sequence_number; | 567 QuicPacketSequenceNumber sequence_number; |
| 574 QuicPacket* packet; | 568 QuicPacket* packet; |
| 575 const EncryptionLevel encryption_level; | 569 const EncryptionLevel encryption_level; |
| 576 TransmissionType transmission_type; | 570 TransmissionType transmission_type; |
| 577 HasRetransmittableData retransmittable; | 571 HasRetransmittableData retransmittable; |
| 578 IsHandshake handshake; | 572 IsHandshake handshake; |
| 579 PacketType type; | 573 bool is_connection_close; |
| 580 QuicByteCount length; | 574 QuicByteCount length; |
| 581 }; | 575 }; |
| 582 | 576 |
| 583 typedef std::list<QueuedPacket> QueuedPacketList; | 577 typedef std::list<QueuedPacket> QueuedPacketList; |
| 584 typedef std::map<QuicFecGroupNumber, QuicFecGroup*> FecGroupMap; | 578 typedef std::map<QuicFecGroupNumber, QuicFecGroup*> FecGroupMap; |
| 585 | 579 |
| 586 // Writes the given packet to socket, encrypted with packet's | 580 // Writes the given packet to socket, encrypted with packet's |
| 587 // encryption_level. Returns true on successful write. Behavior is undefined | 581 // encryption_level. Returns true on successful write. Behavior is undefined |
| 588 // if connection is not established or broken. A return value of true means | 582 // if connection is not established or broken. A return value of true means |
| 589 // the packet was transmitted and may be destroyed. If the packet is | 583 // the packet was transmitted and may be destroyed. If the packet is |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 // If non-empty this contains the set of versions received in a | 804 // If non-empty this contains the set of versions received in a |
| 811 // version negotiation packet. | 805 // version negotiation packet. |
| 812 QuicVersionVector server_supported_versions_; | 806 QuicVersionVector server_supported_versions_; |
| 813 | 807 |
| 814 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 808 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 815 }; | 809 }; |
| 816 | 810 |
| 817 } // namespace net | 811 } // namespace net |
| 818 | 812 |
| 819 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 813 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |