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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override; | 363 bool OnGoAwayFrame(const QuicGoAwayFrame& frame) override; |
364 bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override; | 364 bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override; |
365 bool OnBlockedFrame(const QuicBlockedFrame& frame) override; | 365 bool OnBlockedFrame(const QuicBlockedFrame& frame) override; |
366 void OnFecData(const QuicFecData& fec) override; | 366 void OnFecData(const QuicFecData& fec) override; |
367 void OnPacketComplete() override; | 367 void OnPacketComplete() override; |
368 | 368 |
369 // QuicPacketGenerator::DelegateInterface | 369 // QuicPacketGenerator::DelegateInterface |
370 bool ShouldGeneratePacket(TransmissionType transmission_type, | 370 bool ShouldGeneratePacket(TransmissionType transmission_type, |
371 HasRetransmittableData retransmittable, | 371 HasRetransmittableData retransmittable, |
372 IsHandshake handshake) override; | 372 IsHandshake handshake) override; |
373 QuicAckFrame* CreateAckFrame() override; | 373 void PopulateAckFrame(QuicAckFrame* ack) override; |
374 QuicStopWaitingFrame* CreateStopWaitingFrame() override; | 374 void PopulateStopWaitingFrame(QuicStopWaitingFrame* stop_waiting) override; |
375 void OnSerializedPacket(const SerializedPacket& packet) override; | 375 void OnSerializedPacket(const SerializedPacket& packet) override; |
376 | 376 |
377 // QuicSentPacketManager::NetworkChangeVisitor | 377 // QuicSentPacketManager::NetworkChangeVisitor |
378 void OnCongestionWindowChange() override; | 378 void OnCongestionWindowChange() override; |
379 void OnRttChange() override; | 379 void OnRttChange() override; |
380 | 380 |
381 // Called by the crypto stream when the handshake completes. In the server's | 381 // Called by the crypto stream when the handshake completes. In the server's |
382 // case this is when the SHLO has been ACKed. Clients call this on receipt of | 382 // case this is when the SHLO has been ACKed. Clients call this on receipt of |
383 // the SHLO. | 383 // the SHLO. |
384 void OnHandshakeComplete(); | 384 void OnHandshakeComplete(); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 void MaybeProcessUndecryptablePackets(); | 622 void MaybeProcessUndecryptablePackets(); |
623 | 623 |
624 // If a packet can be revived from the current FEC group, then | 624 // If a packet can be revived from the current FEC group, then |
625 // revive and process the packet. | 625 // revive and process the packet. |
626 void MaybeProcessRevivedPacket(); | 626 void MaybeProcessRevivedPacket(); |
627 | 627 |
628 void ProcessAckFrame(const QuicAckFrame& incoming_ack); | 628 void ProcessAckFrame(const QuicAckFrame& incoming_ack); |
629 | 629 |
630 void ProcessStopWaitingFrame(const QuicStopWaitingFrame& stop_waiting); | 630 void ProcessStopWaitingFrame(const QuicStopWaitingFrame& stop_waiting); |
631 | 631 |
632 // Update |stop_waiting| for an outgoing ack. | |
633 void UpdateStopWaiting(QuicStopWaitingFrame* stop_waiting); | |
634 | |
635 // Queues an ack or sets the ack alarm when an incoming packet arrives that | 632 // Queues an ack or sets the ack alarm when an incoming packet arrives that |
636 // should be acked. | 633 // should be acked. |
637 void MaybeQueueAck(); | 634 void MaybeQueueAck(); |
638 | 635 |
639 // Checks if the last packet should instigate an ack. | 636 // Checks if the last packet should instigate an ack. |
640 bool ShouldLastPacketInstigateAck() const; | 637 bool ShouldLastPacketInstigateAck() const; |
641 | 638 |
642 // Checks if the peer is waiting for packets that have been given up on, and | 639 // Checks if the peer is waiting for packets that have been given up on, and |
643 // therefore an ack frame should be sent with a larger least_unacked. | 640 // therefore an ack frame should be sent with a larger least_unacked. |
644 void UpdateStopWaitingCount(); | 641 void UpdateStopWaitingCount(); |
(...skipping 18 matching lines...) Expand all Loading... |
663 | 660 |
664 // Sets the ping alarm to the appropriate value, if any. | 661 // Sets the ping alarm to the appropriate value, if any. |
665 void SetPingAlarm(); | 662 void SetPingAlarm(); |
666 | 663 |
667 // On arrival of a new packet, checks to see if the socket addresses have | 664 // On arrival of a new packet, checks to see if the socket addresses have |
668 // changed since the last packet we saw on this connection. | 665 // changed since the last packet we saw on this connection. |
669 void CheckForAddressMigration(const IPEndPoint& self_address, | 666 void CheckForAddressMigration(const IPEndPoint& self_address, |
670 const IPEndPoint& peer_address); | 667 const IPEndPoint& peer_address); |
671 | 668 |
672 HasRetransmittableData IsRetransmittable(const QueuedPacket& packet); | 669 HasRetransmittableData IsRetransmittable(const QueuedPacket& packet); |
673 bool IsConnectionClose(QueuedPacket packet); | 670 bool IsConnectionClose(const QueuedPacket& packet); |
674 | 671 |
675 QuicFramer framer_; | 672 QuicFramer framer_; |
676 QuicConnectionHelperInterface* helper_; // Not owned. | 673 QuicConnectionHelperInterface* helper_; // Not owned. |
677 QuicPacketWriter* writer_; // Owned or not depending on |owns_writer_|. | 674 QuicPacketWriter* writer_; // Owned or not depending on |owns_writer_|. |
678 bool owns_writer_; | 675 bool owns_writer_; |
679 // Encryption level for new packets. Should only be changed via | 676 // Encryption level for new packets. Should only be changed via |
680 // SetDefaultEncryptionLevel(). | 677 // SetDefaultEncryptionLevel(). |
681 EncryptionLevel encryption_level_; | 678 EncryptionLevel encryption_level_; |
682 bool has_forward_secure_encrypter_; | 679 bool has_forward_secure_encrypter_; |
683 // The sequence number of the first packet which will be encrypted with the | 680 // The sequence number of the first packet which will be encrypted with the |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 | 836 |
840 // True if this is a secure QUIC connection. | 837 // True if this is a secure QUIC connection. |
841 bool is_secure_; | 838 bool is_secure_; |
842 | 839 |
843 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 840 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
844 }; | 841 }; |
845 | 842 |
846 } // namespace net | 843 } // namespace net |
847 | 844 |
848 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 845 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
OLD | NEW |