| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // on the hash provided by a StopWaiting frame. Clears older packet | 57 // on the hash provided by a StopWaiting frame. Clears older packet |
| 58 // entropy entries and performs garbage collection up to the first gap. | 58 // entropy entries and performs garbage collection up to the first gap. |
| 59 void SetCumulativeEntropyUpTo(QuicPacketSequenceNumber sequence_number, | 59 void SetCumulativeEntropyUpTo(QuicPacketSequenceNumber sequence_number, |
| 60 QuicPacketEntropyHash entropy_hash); | 60 QuicPacketEntropyHash entropy_hash); |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 friend class test::EntropyTrackerPeer; | 63 friend class test::EntropyTrackerPeer; |
| 64 | 64 |
| 65 // A deque indexed by sequence number storing the packet's hash and whether | 65 // A deque indexed by sequence number storing the packet's hash and whether |
| 66 // a hash was recorded for that sequence number. | 66 // a hash was recorded for that sequence number. |
| 67 typedef std::deque<std::pair<QuicPacketEntropyHash, bool>> | 67 typedef std::deque<std::pair<QuicPacketEntropyHash, bool> > |
| 68 ReceivedEntropyHashes; | 68 ReceivedEntropyHashes; |
| 69 | 69 |
| 70 // Recomputes first_gap_ and removes packets_entropy_ entries that are no | 70 // Recomputes first_gap_ and removes packets_entropy_ entries that are no |
| 71 // longer needed to compute EntropyHash. | 71 // longer needed to compute EntropyHash. |
| 72 void AdvanceFirstGapAndGarbageCollectEntropyMap(); | 72 void AdvanceFirstGapAndGarbageCollectEntropyMap(); |
| 73 | 73 |
| 74 // Map of received sequence numbers to their corresponding entropy. | 74 // Map of received sequence numbers to their corresponding entropy. |
| 75 // Stores an entry for every received packet whose sequence_number is larger | 75 // Stores an entry for every received packet whose sequence_number is larger |
| 76 // than first_gap_. Packets without the entropy bit set have an entropy | 76 // than first_gap_. Packets without the entropy bit set have an entropy |
| 77 // value of 0. | 77 // value of 0. |
| (...skipping 95 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 |