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/core/congestion_control/loss_detection_interface.h" | 8 #include "net/quic/core/congestion_control/loss_detection_interface.h" |
9 #include "net/quic/core/congestion_control/send_algorithm_interface.h" | 9 #include "net/quic/core/congestion_control/send_algorithm_interface.h" |
10 #include "net/quic/core/quic_flags.h" | 10 #include "net/quic/core/quic_flags.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // static | 61 // static |
62 SendAlgorithmInterface* QuicSentPacketManagerPeer::GetSendAlgorithm( | 62 SendAlgorithmInterface* QuicSentPacketManagerPeer::GetSendAlgorithm( |
63 const QuicSentPacketManager& sent_packet_manager) { | 63 const QuicSentPacketManager& sent_packet_manager) { |
64 return sent_packet_manager.send_algorithm_.get(); | 64 return sent_packet_manager.send_algorithm_.get(); |
65 } | 65 } |
66 | 66 |
67 // static | 67 // static |
68 void QuicSentPacketManagerPeer::SetSendAlgorithm( | 68 void QuicSentPacketManagerPeer::SetSendAlgorithm( |
69 QuicSentPacketManager* sent_packet_manager, | 69 QuicSentPacketManager* sent_packet_manager, |
70 SendAlgorithmInterface* send_algorithm) { | 70 SendAlgorithmInterface* send_algorithm) { |
71 sent_packet_manager->send_algorithm_.reset(send_algorithm); | 71 sent_packet_manager->SetSendAlgorithm(send_algorithm); |
72 sent_packet_manager->using_inline_pacing_ = false; | |
73 } | 72 } |
74 | 73 |
75 // static | 74 // static |
76 const LossDetectionInterface* QuicSentPacketManagerPeer::GetLossAlgorithm( | 75 const LossDetectionInterface* QuicSentPacketManagerPeer::GetLossAlgorithm( |
77 QuicSentPacketManager* sent_packet_manager) { | 76 QuicSentPacketManager* sent_packet_manager) { |
78 return sent_packet_manager->loss_algorithm_.get(); | 77 return sent_packet_manager->loss_algorithm_; |
79 } | 78 } |
80 | 79 |
81 // static | 80 // static |
82 void QuicSentPacketManagerPeer::SetLossAlgorithm( | 81 void QuicSentPacketManagerPeer::SetLossAlgorithm( |
83 QuicSentPacketManager* sent_packet_manager, | 82 QuicSentPacketManager* sent_packet_manager, |
84 LossDetectionInterface* loss_detector) { | 83 LossDetectionInterface* loss_detector) { |
85 sent_packet_manager->loss_algorithm_.reset(loss_detector); | 84 sent_packet_manager->loss_algorithm_ = loss_detector; |
86 } | 85 } |
87 | 86 |
88 // static | 87 // static |
89 bool QuicSentPacketManagerPeer::HasPendingPackets( | 88 bool QuicSentPacketManagerPeer::HasPendingPackets( |
90 const QuicSentPacketManager* sent_packet_manager) { | 89 const QuicSentPacketManager* sent_packet_manager) { |
91 return sent_packet_manager->unacked_packets_.HasInFlightPackets(); | 90 return sent_packet_manager->unacked_packets_.HasInFlightPackets(); |
92 } | 91 } |
93 | 92 |
94 // static | 93 // static |
95 QuicTime QuicSentPacketManagerPeer::GetSentTime( | 94 QuicTime QuicSentPacketManagerPeer::GetSentTime( |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 // static | 202 // static |
204 bool QuicSentPacketManagerPeer::HasRetransmittableFrames( | 203 bool QuicSentPacketManagerPeer::HasRetransmittableFrames( |
205 QuicSentPacketManager* sent_packet_manager, | 204 QuicSentPacketManager* sent_packet_manager, |
206 QuicPacketNumber packet_number) { | 205 QuicPacketNumber packet_number) { |
207 return sent_packet_manager->unacked_packets_.HasRetransmittableFrames( | 206 return sent_packet_manager->unacked_packets_.HasRetransmittableFrames( |
208 packet_number); | 207 packet_number); |
209 } | 208 } |
210 | 209 |
211 } // namespace test | 210 } // namespace test |
212 } // namespace net | 211 } // namespace net |
OLD | NEW |