| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 // Manages the packet entropy calculation for both sent and received packets | 5 // Manages the packet entropy calculation for both sent and received packets |
| 6 // for a connection. | 6 // for a connection. |
| 7 | 7 |
| 8 #ifndef NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_ | 8 #ifndef NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_ |
| 9 #define NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_ | 9 #define NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_ |
| 10 | 10 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // first_gap_. | 89 // first_gap_. |
| 90 QuicPacketSequenceNumber first_gap_; | 90 QuicPacketSequenceNumber first_gap_; |
| 91 | 91 |
| 92 // Sequence number of the largest observed packet. | 92 // Sequence number of the largest observed packet. |
| 93 QuicPacketSequenceNumber largest_observed_; | 93 QuicPacketSequenceNumber largest_observed_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(EntropyTracker); | 95 DISALLOW_COPY_AND_ASSIGN(EntropyTracker); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 explicit QuicReceivedPacketManager(QuicConnectionStats* stats); | 98 explicit QuicReceivedPacketManager(QuicConnectionStats* stats); |
| 99 virtual ~QuicReceivedPacketManager(); | 99 ~QuicReceivedPacketManager() override; |
| 100 | 100 |
| 101 // Updates the internal state concerning which packets have been received. | 101 // Updates the internal state concerning which packets have been received. |
| 102 // bytes: the packet size in bytes including Quic Headers. | 102 // bytes: the packet size in bytes including Quic Headers. |
| 103 // header: the packet header. | 103 // header: the packet header. |
| 104 // timestamp: the arrival time of the packet. | 104 // timestamp: the arrival time of the packet. |
| 105 void RecordPacketReceived(QuicByteCount bytes, | 105 void RecordPacketReceived(QuicByteCount bytes, |
| 106 const QuicPacketHeader& header, | 106 const QuicPacketHeader& header, |
| 107 QuicTime receipt_time); | 107 QuicTime receipt_time); |
| 108 | 108 |
| 109 void RecordPacketRevived(QuicPacketSequenceNumber sequence_number); | 109 void RecordPacketRevived(QuicPacketSequenceNumber sequence_number); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 121 // Should be called before sending an ACK packet, to decide if we need | 121 // Should be called before sending an ACK packet, to decide if we need |
| 122 // to attach a QuicCongestionFeedbackFrame block. | 122 // to attach a QuicCongestionFeedbackFrame block. |
| 123 // Returns false if no QuicCongestionFeedbackFrame block is needed. | 123 // Returns false if no QuicCongestionFeedbackFrame block is needed. |
| 124 // Otherwise fills in feedback and returns true. | 124 // Otherwise fills in feedback and returns true. |
| 125 virtual bool GenerateCongestionFeedback( | 125 virtual bool GenerateCongestionFeedback( |
| 126 QuicCongestionFeedbackFrame* feedback); | 126 QuicCongestionFeedbackFrame* feedback); |
| 127 | 127 |
| 128 // QuicReceivedEntropyHashCalculatorInterface | 128 // QuicReceivedEntropyHashCalculatorInterface |
| 129 // Called by QuicFramer, when the outgoing ack gets truncated, to recalculate | 129 // Called by QuicFramer, when the outgoing ack gets truncated, to recalculate |
| 130 // the received entropy hash for the truncated ack frame. | 130 // the received entropy hash for the truncated ack frame. |
| 131 virtual QuicPacketEntropyHash EntropyHash( | 131 QuicPacketEntropyHash EntropyHash( |
| 132 QuicPacketSequenceNumber sequence_number) const override; | 132 QuicPacketSequenceNumber sequence_number) const override; |
| 133 | 133 |
| 134 // Updates internal state based on |stop_waiting|. | 134 // Updates internal state based on |stop_waiting|. |
| 135 void UpdatePacketInformationSentByPeer( | 135 void UpdatePacketInformationSentByPeer( |
| 136 const QuicStopWaitingFrame& stop_waiting); | 136 const QuicStopWaitingFrame& stop_waiting); |
| 137 | 137 |
| 138 // Returns true when there are new missing packets to be reported within 3 | 138 // Returns true when there are new missing packets to be reported within 3 |
| 139 // packets of the largest observed. | 139 // packets of the largest observed. |
| 140 bool HasNewMissingPackets(); | 140 bool HasNewMissingPackets(); |
| 141 | 141 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 QuicConnectionStats* stats_; | 173 QuicConnectionStats* stats_; |
| 174 | 174 |
| 175 PacketTimeList received_packet_times_; | 175 PacketTimeList received_packet_times_; |
| 176 | 176 |
| 177 DISALLOW_COPY_AND_ASSIGN(QuicReceivedPacketManager); | 177 DISALLOW_COPY_AND_ASSIGN(QuicReceivedPacketManager); |
| 178 }; | 178 }; |
| 179 | 179 |
| 180 } // namespace net | 180 } // namespace net |
| 181 | 181 |
| 182 #endif // NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_ | 182 #endif // NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_ |
| OLD | NEW |