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_SENT_ENTROPY_MANAGER_H_ | 8 #ifndef NET_QUIC_QUIC_SENT_ENTROPY_MANAGER_H_ |
9 #define NET_QUIC_QUIC_SENT_ENTROPY_MANAGER_H_ | 9 #define NET_QUIC_QUIC_SENT_ENTROPY_MANAGER_H_ |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 // up to |sequence_number| removing sequence numbers from |missing_packets|. | 34 // up to |sequence_number| removing sequence numbers from |missing_packets|. |
35 bool IsValidEntropy(QuicPacketSequenceNumber sequence_number, | 35 bool IsValidEntropy(QuicPacketSequenceNumber sequence_number, |
36 const SequenceNumberSet& missing_packets, | 36 const SequenceNumberSet& missing_packets, |
37 QuicPacketEntropyHash entropy_hash) const; | 37 QuicPacketEntropyHash entropy_hash) const; |
38 | 38 |
39 // Removes not required entries from |packets_entropy_| before | 39 // Removes not required entries from |packets_entropy_| before |
40 // |sequence_number|. | 40 // |sequence_number|. |
41 void ClearEntropyBefore(QuicPacketSequenceNumber sequence_number); | 41 void ClearEntropyBefore(QuicPacketSequenceNumber sequence_number); |
42 | 42 |
43 private: | 43 private: |
44 typedef linked_hash_map<QuicPacketSequenceNumber, | 44 typedef linked_hash_map< |
45 std::pair<QuicPacketEntropyHash, | 45 QuicPacketSequenceNumber, |
46 QuicPacketEntropyHash> > SentEntropyMap; | 46 std::pair<QuicPacketEntropyHash, QuicPacketEntropyHash> > SentEntropyMap; |
47 | 47 |
48 // Linked hash map from sequence numbers to the sent entropy hash up to the | 48 // Linked hash map from sequence numbers to the sent entropy hash up to the |
49 // sequence number in the key. | 49 // sequence number in the key. |
50 SentEntropyMap packets_entropy_; | 50 SentEntropyMap packets_entropy_; |
51 | 51 |
52 // Cumulative hash of entropy of all sent packets. | 52 // Cumulative hash of entropy of all sent packets. |
53 QuicPacketEntropyHash packets_entropy_hash_; | 53 QuicPacketEntropyHash packets_entropy_hash_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(QuicSentEntropyManager); | 55 DISALLOW_COPY_AND_ASSIGN(QuicSentEntropyManager); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace net | 58 } // namespace net |
59 | 59 |
60 #endif // NET_QUIC_QUIC_SENT_ENTROPY_MANAGER_H_ | 60 #endif // NET_QUIC_QUIC_SENT_ENTROPY_MANAGER_H_ |
OLD | NEW |