| 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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 | 571 |
| 572 // If a packet can be revived from the current FEC group, then | 572 // If a packet can be revived from the current FEC group, then |
| 573 // revive and process the packet. | 573 // revive and process the packet. |
| 574 void MaybeProcessRevivedPacket(); | 574 void MaybeProcessRevivedPacket(); |
| 575 | 575 |
| 576 void ProcessAckFrame(const QuicAckFrame& incoming_ack); | 576 void ProcessAckFrame(const QuicAckFrame& incoming_ack); |
| 577 | 577 |
| 578 // Update the |sent_info| for an outgoing ack. | 578 // Update the |sent_info| for an outgoing ack. |
| 579 void UpdateSentPacketInfo(SentPacketInfo* sent_info); | 579 void UpdateSentPacketInfo(SentPacketInfo* sent_info); |
| 580 | 580 |
| 581 // Queues an ack or sets the ack alarm when an incoming packet arrives that |
| 582 // should be acked. |
| 583 void MaybeQueueAck(); |
| 584 |
| 581 // Checks if the last packet should instigate an ack. | 585 // Checks if the last packet should instigate an ack. |
| 582 bool ShouldLastPacketInstigateAck(); | 586 bool ShouldLastPacketInstigateAck(); |
| 583 | 587 |
| 584 // Sends any packets which are a response to the last packet, including both | 588 // Sends any packets which are a response to the last packet, including both |
| 585 // acks and pending writes if an ack opened the congestion window. | 589 // acks and pending writes if an ack opened the congestion window. |
| 586 void MaybeSendInResponseToPacket(bool send_ack_immediately, | 590 void MaybeSendInResponseToPacket(); |
| 587 bool last_packet_should_instigate_ack); | |
| 588 | 591 |
| 589 // Get the FEC group associate with the last processed packet or NULL, if the | 592 // Get the FEC group associate with the last processed packet or NULL, if the |
| 590 // group has already been deleted. | 593 // group has already been deleted. |
| 591 QuicFecGroup* GetFecGroup(); | 594 QuicFecGroup* GetFecGroup(); |
| 592 | 595 |
| 593 // Closes any FEC groups protecting packets before |sequence_number|. | 596 // Closes any FEC groups protecting packets before |sequence_number|. |
| 594 void CloseFecGroupsBefore(QuicPacketSequenceNumber sequence_number); | 597 void CloseFecGroupsBefore(QuicPacketSequenceNumber sequence_number); |
| 595 | 598 |
| 596 QuicConnectionHelperInterface* helper_; // Not owned. | 599 QuicConnectionHelperInterface* helper_; // Not owned. |
| 597 QuicPacketWriter* writer_; // Not owned. | 600 QuicPacketWriter* writer_; // Not owned. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 scoped_ptr<PendingWrite> pending_write_; | 643 scoped_ptr<PendingWrite> pending_write_; |
| 641 | 644 |
| 642 // Contains the connection close packet if the connection has been closed. | 645 // Contains the connection close packet if the connection has been closed. |
| 643 scoped_ptr<QuicEncryptedPacket> connection_close_packet_; | 646 scoped_ptr<QuicEncryptedPacket> connection_close_packet_; |
| 644 | 647 |
| 645 FecGroupMap group_map_; | 648 FecGroupMap group_map_; |
| 646 | 649 |
| 647 QuicReceivedPacketManager received_packet_manager_; | 650 QuicReceivedPacketManager received_packet_manager_; |
| 648 QuicSentEntropyManager sent_entropy_manager_; | 651 QuicSentEntropyManager sent_entropy_manager_; |
| 649 | 652 |
| 653 // Indicates whether an ack should be sent the next time we try to write. |
| 654 bool ack_queued_; |
| 655 |
| 650 // An alarm that fires when an ACK should be sent to the peer. | 656 // An alarm that fires when an ACK should be sent to the peer. |
| 651 scoped_ptr<QuicAlarm> ack_alarm_; | 657 scoped_ptr<QuicAlarm> ack_alarm_; |
| 652 // An alarm that fires when a packet needs to be retransmitted. | 658 // An alarm that fires when a packet needs to be retransmitted. |
| 653 scoped_ptr<QuicAlarm> retransmission_alarm_; | 659 scoped_ptr<QuicAlarm> retransmission_alarm_; |
| 654 // An alarm that is scheduled when the sent scheduler requires a | 660 // An alarm that is scheduled when the sent scheduler requires a |
| 655 // a delay before sending packets and fires when the packet may be sent. | 661 // a delay before sending packets and fires when the packet may be sent. |
| 656 scoped_ptr<QuicAlarm> send_alarm_; | 662 scoped_ptr<QuicAlarm> send_alarm_; |
| 657 // An alarm that is scheduled when the connection can still write and there | 663 // An alarm that is scheduled when the connection can still write and there |
| 658 // may be more data to send. | 664 // may be more data to send. |
| 659 scoped_ptr<QuicAlarm> resume_writes_alarm_; | 665 scoped_ptr<QuicAlarm> resume_writes_alarm_; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 // If non-empty this contains the set of versions received in a | 716 // If non-empty this contains the set of versions received in a |
| 711 // version negotiation packet. | 717 // version negotiation packet. |
| 712 QuicVersionVector server_supported_versions_; | 718 QuicVersionVector server_supported_versions_; |
| 713 | 719 |
| 714 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 720 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 715 }; | 721 }; |
| 716 | 722 |
| 717 } // namespace net | 723 } // namespace net |
| 718 | 724 |
| 719 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 725 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |