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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 void ClearLastFrames(); | 594 void ClearLastFrames(); |
595 | 595 |
596 // Writes as many queued packets as possible. The connection must not be | 596 // Writes as many queued packets as possible. The connection must not be |
597 // blocked when this is called. | 597 // blocked when this is called. |
598 void WriteQueuedPackets(); | 598 void WriteQueuedPackets(); |
599 | 599 |
600 // Writes as many pending retransmissions as possible. | 600 // Writes as many pending retransmissions as possible. |
601 void WritePendingRetransmissions(); | 601 void WritePendingRetransmissions(); |
602 | 602 |
603 // Returns true if the packet should be discarded and not sent. | 603 // Returns true if the packet should be discarded and not sent. |
604 bool ShouldDiscardPacket(EncryptionLevel level, | 604 bool ShouldDiscardPacket(const QueuedPacket& packet); |
605 QuicPacketSequenceNumber sequence_number, | |
606 HasRetransmittableData retransmittable); | |
607 | 605 |
608 // Queues |packet| in the hopes that it can be decrypted in the | 606 // Queues |packet| in the hopes that it can be decrypted in the |
609 // future, when a new key is installed. | 607 // future, when a new key is installed. |
610 void QueueUndecryptablePacket(const QuicEncryptedPacket& packet); | 608 void QueueUndecryptablePacket(const QuicEncryptedPacket& packet); |
611 | 609 |
612 // Attempts to process any queued undecryptable packets. | 610 // Attempts to process any queued undecryptable packets. |
613 void MaybeProcessUndecryptablePackets(); | 611 void MaybeProcessUndecryptablePackets(); |
614 | 612 |
615 // If a packet can be revived from the current FEC group, then | 613 // If a packet can be revived from the current FEC group, then |
616 // revive and process the packet. | 614 // revive and process the packet. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 void CloseFecGroupsBefore(QuicPacketSequenceNumber sequence_number); | 648 void CloseFecGroupsBefore(QuicPacketSequenceNumber sequence_number); |
651 | 649 |
652 // Sets the ping alarm to the appropriate value, if any. | 650 // Sets the ping alarm to the appropriate value, if any. |
653 void SetPingAlarm(); | 651 void SetPingAlarm(); |
654 | 652 |
655 // On arrival of a new packet, checks to see if the socket addresses have | 653 // On arrival of a new packet, checks to see if the socket addresses have |
656 // changed since the last packet we saw on this connection. | 654 // changed since the last packet we saw on this connection. |
657 void CheckForAddressMigration(const IPEndPoint& self_address, | 655 void CheckForAddressMigration(const IPEndPoint& self_address, |
658 const IPEndPoint& peer_address); | 656 const IPEndPoint& peer_address); |
659 | 657 |
660 HasRetransmittableData IsRetransmittable(QueuedPacket packet); | 658 HasRetransmittableData IsRetransmittable(const QueuedPacket& packet); |
661 bool IsConnectionClose(QueuedPacket packet); | 659 bool IsConnectionClose(QueuedPacket packet); |
662 | 660 |
663 QuicFramer framer_; | 661 QuicFramer framer_; |
664 QuicConnectionHelperInterface* helper_; // Not owned. | 662 QuicConnectionHelperInterface* helper_; // Not owned. |
665 QuicPacketWriter* writer_; // Owned or not depending on |owns_writer_|. | 663 QuicPacketWriter* writer_; // Owned or not depending on |owns_writer_|. |
666 bool owns_writer_; | 664 bool owns_writer_; |
667 EncryptionLevel encryption_level_; | 665 EncryptionLevel encryption_level_; |
668 const QuicClock* clock_; | 666 const QuicClock* clock_; |
669 QuicRandom* random_generator_; | 667 QuicRandom* random_generator_; |
670 | 668 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 // If non-empty this contains the set of versions received in a | 800 // If non-empty this contains the set of versions received in a |
803 // version negotiation packet. | 801 // version negotiation packet. |
804 QuicVersionVector server_supported_versions_; | 802 QuicVersionVector server_supported_versions_; |
805 | 803 |
806 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 804 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
807 }; | 805 }; |
808 | 806 |
809 } // namespace net | 807 } // namespace net |
810 | 808 |
811 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 809 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
OLD | NEW |