| 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/loss_detection_interface.h" |
| 9 #include "net/quic/congestion_control/send_algorithm_interface.h" | 9 #include "net/quic/congestion_control/send_algorithm_interface.h" |
| 10 #include "net/quic/quic_protocol.h" | 10 #include "net/quic/quic_protocol.h" |
| 11 #include "net/quic/quic_sent_packet_manager.h" | 11 #include "net/quic/quic_sent_packet_manager.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 namespace test { | 14 namespace test { |
| 15 | 15 |
| 16 // static | 16 // static |
| 17 void QuicSentPacketManagerPeer::SetMaxTailLossProbes( | 17 void QuicSentPacketManagerPeer::SetMaxTailLossProbes( |
| 18 QuicSentPacketManager* sent_packet_manager, size_t max_tail_loss_probes) { | 18 QuicSentPacketManager* sent_packet_manager, size_t max_tail_loss_probes) { |
| 19 sent_packet_manager->max_tail_loss_probes_ = max_tail_loss_probes; | 19 sent_packet_manager->max_tail_loss_probes_ = max_tail_loss_probes; |
| 20 } | 20 } |
| 21 | 21 |
| 22 // static | 22 // static |
| 23 void QuicSentPacketManagerPeer::SetSendAlgorithm( | 23 void QuicSentPacketManagerPeer::SetSendAlgorithm( |
| 24 QuicSentPacketManager* sent_packet_manager, | 24 QuicSentPacketManager* sent_packet_manager, |
| 25 SendAlgorithmInterface* send_algorithm) { | 25 SendAlgorithmInterface* send_algorithm) { |
| 26 sent_packet_manager->send_algorithm_.reset(send_algorithm); | 26 sent_packet_manager->send_algorithm_.reset(send_algorithm); |
| 27 } | 27 } |
| 28 | 28 |
| 29 // static | 29 // static |
| 30 void QuicSentPacketManagerPeer::SetIsServer( |
| 31 QuicSentPacketManager* sent_packet_manager, |
| 32 bool is_server) { |
| 33 sent_packet_manager->is_server_ = is_server; |
| 34 } |
| 35 |
| 36 // static |
| 30 const LossDetectionInterface* QuicSentPacketManagerPeer::GetLossAlgorithm( | 37 const LossDetectionInterface* QuicSentPacketManagerPeer::GetLossAlgorithm( |
| 31 QuicSentPacketManager* sent_packet_manager) { | 38 QuicSentPacketManager* sent_packet_manager) { |
| 32 return sent_packet_manager->loss_algorithm_.get(); | 39 return sent_packet_manager->loss_algorithm_.get(); |
| 33 } | 40 } |
| 34 | 41 |
| 35 // static | 42 // static |
| 36 const SendAlgorithmInterface* | 43 const SendAlgorithmInterface* |
| 37 QuicSentPacketManagerPeer::GetCongestionControlAlgorithm( | 44 QuicSentPacketManagerPeer::GetCongestionControlAlgorithm( |
| 38 const QuicSentPacketManager& sent_packet_manager) { | 45 const QuicSentPacketManager& sent_packet_manager) { |
| 39 return sent_packet_manager.send_algorithm_.get(); | 46 return sent_packet_manager.send_algorithm_.get(); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 } | 148 } |
| 142 | 149 |
| 143 // static | 150 // static |
| 144 QuicSustainedBandwidthRecorder& QuicSentPacketManagerPeer::GetBandwidthRecorder( | 151 QuicSustainedBandwidthRecorder& QuicSentPacketManagerPeer::GetBandwidthRecorder( |
| 145 QuicSentPacketManager* sent_packet_manager) { | 152 QuicSentPacketManager* sent_packet_manager) { |
| 146 return sent_packet_manager->sustained_bandwidth_recorder_; | 153 return sent_packet_manager->sustained_bandwidth_recorder_; |
| 147 } | 154 } |
| 148 | 155 |
| 149 } // namespace test | 156 } // namespace test |
| 150 } // namespace net | 157 } // namespace net |
| OLD | NEW |