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 |
11 #include "net/quic/congestion_control/receive_algorithm_interface.h" | 11 #include "net/quic/congestion_control/receive_algorithm_interface.h" |
12 #include "net/quic/quic_framer.h" | 12 #include "net/quic/quic_framer.h" |
13 #include "net/quic/quic_protocol.h" | 13 #include "net/quic/quic_protocol.h" |
14 | 14 |
15 namespace net { | 15 namespace net { |
16 | 16 |
17 namespace test { | 17 namespace test { |
18 class QuicConnectionPeer; | 18 class QuicConnectionPeer; |
19 class QuicReceivedPacketManagerPeer; | 19 class QuicReceivedPacketManagerPeer; |
20 } // namespace test | 20 } // namespace test |
21 | 21 |
22 // Records all received packets by a connection and tracks their entropy. | 22 // Records all received packets by a connection and tracks their entropy. |
23 // Also calculates the correct entropy for the framer when it truncates an ack | 23 // Also calculates the correct entropy for the framer when it truncates an ack |
24 // frame being serialized. | 24 // frame being serialized. |
25 class NET_EXPORT_PRIVATE QuicReceivedPacketManager : | 25 class NET_EXPORT_PRIVATE QuicReceivedPacketManager : |
26 public QuicReceivedEntropyHashCalculatorInterface { | 26 public QuicReceivedEntropyHashCalculatorInterface { |
27 public: | 27 public: |
28 explicit QuicReceivedPacketManager(CongestionFeedbackType congestion_type); | 28 explicit QuicReceivedPacketManager(CongestionFeedbackType congestion_type); |
29 virtual ~QuicReceivedPacketManager(); | 29 virtual ~QuicReceivedPacketManager() OVERRIDE; |
30 | 30 |
31 // Updates the internal state concerning which packets have been received. | 31 // Updates the internal state concerning which packets have been received. |
32 // bytes: the packet size in bytes including Quic Headers. | 32 // bytes: the packet size in bytes including Quic Headers. |
33 // header: the packet header. | 33 // header: the packet header. |
34 // timestamp: the arrival time of the packet. | 34 // timestamp: the arrival time of the packet. |
35 // revived: true if the packet was lost and then recovered with help of a | 35 // revived: true if the packet was lost and then recovered with help of a |
36 // FEC packet. | 36 // FEC packet. |
37 void RecordPacketReceived(QuicByteCount bytes, | 37 void RecordPacketReceived(QuicByteCount bytes, |
38 const QuicPacketHeader& header, | 38 const QuicPacketHeader& header, |
39 QuicTime receipt_time, | 39 QuicTime receipt_time, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // no sequence numbers have been received since UpdateReceivedPacketInfo. | 144 // no sequence numbers have been received since UpdateReceivedPacketInfo. |
145 // Needed for calculating delta_time_largest_observed. | 145 // Needed for calculating delta_time_largest_observed. |
146 QuicTime time_largest_observed_; | 146 QuicTime time_largest_observed_; |
147 | 147 |
148 scoped_ptr<ReceiveAlgorithmInterface> receive_algorithm_; | 148 scoped_ptr<ReceiveAlgorithmInterface> receive_algorithm_; |
149 }; | 149 }; |
150 | 150 |
151 } // namespace net | 151 } // namespace net |
152 | 152 |
153 #endif // NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_ | 153 #endif // NET_QUIC_QUIC_RECEIVED_PACKET_MANAGER_H_ |
OLD | NEW |