OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // A test only class to enable simulations of send algorithms. | 5 // A test only class to enable simulations of send algorithms. |
6 | 6 |
7 #ifndef NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_SIMULATOR_H_ | 7 #ifndef NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_SIMULATOR_H_ |
8 #define NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_SIMULATOR_H_ | 8 #define NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_SIMULATOR_H_ |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "net/quic/congestion_control/send_algorithm_interface.h" | 13 #include "net/quic/congestion_control/send_algorithm_interface.h" |
14 #include "net/quic/quic_protocol.h" | 14 #include "net/quic/quic_protocol.h" |
15 #include "net/quic/quic_time.h" | 15 #include "net/quic/quic_time.h" |
16 #include "net/quic/test_tools/mock_clock.h" | 16 #include "net/quic/test_tools/mock_clock.h" |
17 #include "net/quic/test_tools/quic_test_utils.h" | 17 #include "net/quic/test_tools/quic_test_utils.h" |
18 | 18 |
19 namespace net { | 19 namespace net { |
20 | 20 |
21 class SendAlgorithmSimulator { | 21 class SendAlgorithmSimulator { |
22 public: | 22 public: |
23 struct SentPacket { | 23 struct SentPacket { |
24 SentPacket(QuicPacketSequenceNumber sequence_number, | 24 SentPacket(QuicPacketSequenceNumber sequence_number, |
25 QuicTime send_time, | 25 QuicTime send_time, |
26 QuicTime ack_time) : | 26 QuicTime ack_time) |
27 sequence_number(sequence_number), | 27 : sequence_number(sequence_number), |
28 send_time(send_time), | 28 send_time(send_time), |
29 ack_time(ack_time) {} | 29 ack_time(ack_time) {} |
30 QuicPacketSequenceNumber sequence_number; | 30 QuicPacketSequenceNumber sequence_number; |
31 QuicTime send_time; | 31 QuicTime send_time; |
32 QuicTime ack_time; | 32 QuicTime ack_time; |
33 }; | 33 }; |
34 | 34 |
35 // |rtt_stats| should be the same RttStats used by the |send_algorithm|. | 35 // |rtt_stats| should be the same RttStats used by the |send_algorithm|. |
36 SendAlgorithmSimulator(SendAlgorithmInterface* send_algorithm, | 36 SendAlgorithmSimulator(SendAlgorithmInterface* send_algorithm, |
37 MockClock* clock_, | 37 MockClock* clock_, |
38 RttStats* rtt_stats, | 38 RttStats* rtt_stats, |
39 QuicBandwidth bandwidth, | 39 QuicBandwidth bandwidth, |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 QuicByteCount min_cwnd_; | 124 QuicByteCount min_cwnd_; |
125 QuicByteCount max_cwnd_drop_; | 125 QuicByteCount max_cwnd_drop_; |
126 QuicByteCount last_cwnd_; | 126 QuicByteCount last_cwnd_; |
127 | 127 |
128 DISALLOW_COPY_AND_ASSIGN(SendAlgorithmSimulator); | 128 DISALLOW_COPY_AND_ASSIGN(SendAlgorithmSimulator); |
129 }; | 129 }; |
130 | 130 |
131 } // namespace net | 131 } // namespace net |
132 | 132 |
133 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_SIMULATOR_H_ | 133 #endif // NET_QUIC_CONGESTION_CONTROL_SEND_ALGORITHM_SIMULATOR_H_ |
OLD | NEW |