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 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" | 5 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" |
6 | 6 |
7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "net/quic/congestion_control/loss_detection_interface.h" |
8 #include "net/quic/congestion_control/send_algorithm_interface.h" | 9 #include "net/quic/congestion_control/send_algorithm_interface.h" |
9 #include "net/quic/quic_protocol.h" | 10 #include "net/quic/quic_protocol.h" |
10 #include "net/quic/quic_sent_packet_manager.h" | 11 #include "net/quic/quic_sent_packet_manager.h" |
11 | 12 |
12 namespace net { | 13 namespace net { |
13 namespace test { | 14 namespace test { |
14 | 15 |
15 // static | 16 // static |
16 void QuicSentPacketManagerPeer::SetMaxTailLossProbes( | 17 void QuicSentPacketManagerPeer::SetMaxTailLossProbes( |
17 QuicSentPacketManager* sent_packet_manager, size_t max_tail_loss_probes) { | 18 QuicSentPacketManager* sent_packet_manager, size_t max_tail_loss_probes) { |
18 sent_packet_manager->max_tail_loss_probes_ = max_tail_loss_probes; | 19 sent_packet_manager->max_tail_loss_probes_ = max_tail_loss_probes; |
19 } | 20 } |
20 | 21 |
21 // static | 22 // static |
22 void QuicSentPacketManagerPeer::SetSendAlgorithm( | 23 void QuicSentPacketManagerPeer::SetSendAlgorithm( |
23 QuicSentPacketManager* sent_packet_manager, | 24 QuicSentPacketManager* sent_packet_manager, |
24 SendAlgorithmInterface* send_algorithm) { | 25 SendAlgorithmInterface* send_algorithm) { |
25 sent_packet_manager->send_algorithm_.reset(send_algorithm); | 26 sent_packet_manager->send_algorithm_.reset(send_algorithm); |
26 } | 27 } |
27 | 28 |
28 // static | 29 // static |
| 30 void QuicSentPacketManagerPeer::SetLossAlgorithm( |
| 31 QuicSentPacketManager* sent_packet_manager, |
| 32 LossDetectionInterface* loss_detector) { |
| 33 sent_packet_manager->loss_algorithm_.reset(loss_detector); |
| 34 } |
| 35 |
| 36 // static |
29 size_t QuicSentPacketManagerPeer::GetNackCount( | 37 size_t QuicSentPacketManagerPeer::GetNackCount( |
30 const QuicSentPacketManager* sent_packet_manager, | 38 const QuicSentPacketManager* sent_packet_manager, |
31 QuicPacketSequenceNumber sequence_number) { | 39 QuicPacketSequenceNumber sequence_number) { |
32 return sent_packet_manager->unacked_packets_. | 40 return sent_packet_manager->unacked_packets_. |
33 GetTransmissionInfo(sequence_number).nack_count; | 41 GetTransmissionInfo(sequence_number).nack_count; |
34 } | 42 } |
35 | 43 |
36 // static | 44 // static |
37 size_t QuicSentPacketManagerPeer::GetPendingRetransmissionCount( | 45 size_t QuicSentPacketManagerPeer::GetPendingRetransmissionCount( |
38 const QuicSentPacketManager* sent_packet_manager) { | 46 const QuicSentPacketManager* sent_packet_manager) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 107 } |
100 | 108 |
101 // static | 109 // static |
102 SequenceNumberSet QuicSentPacketManagerPeer::GetUnackedPackets( | 110 SequenceNumberSet QuicSentPacketManagerPeer::GetUnackedPackets( |
103 const QuicSentPacketManager* sent_packet_manager) { | 111 const QuicSentPacketManager* sent_packet_manager) { |
104 return sent_packet_manager->unacked_packets_.GetUnackedPackets(); | 112 return sent_packet_manager->unacked_packets_.GetUnackedPackets(); |
105 } | 113 } |
106 | 114 |
107 } // namespace test | 115 } // namespace test |
108 } // namespace net | 116 } // namespace net |
OLD | NEW |