Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: net/quic/test_tools/quic_sent_packet_manager_peer.cc

Issue 683113005: Update from chromium https://crrev.com/302282 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 size_t QuicSentPacketManagerPeer::GetMaxTailLossProbes(
18 QuicSentPacketManager* sent_packet_manager) {
19 return sent_packet_manager->max_tail_loss_probes_;
20 }
21
22 // static
17 void QuicSentPacketManagerPeer::SetMaxTailLossProbes( 23 void QuicSentPacketManagerPeer::SetMaxTailLossProbes(
18 QuicSentPacketManager* sent_packet_manager, size_t max_tail_loss_probes) { 24 QuicSentPacketManager* sent_packet_manager, size_t max_tail_loss_probes) {
19 sent_packet_manager->max_tail_loss_probes_ = max_tail_loss_probes; 25 sent_packet_manager->max_tail_loss_probes_ = max_tail_loss_probes;
20 } 26 }
21 27
22 // static 28 // static
23 void QuicSentPacketManagerPeer::SetSendAlgorithm( 29 QuicByteCount QuicSentPacketManagerPeer::GetReceiveWindow(
24 QuicSentPacketManager* sent_packet_manager, 30 QuicSentPacketManager* sent_packet_manager) {
25 SendAlgorithmInterface* send_algorithm) { 31 return sent_packet_manager->receive_buffer_bytes_;
26 sent_packet_manager->send_algorithm_.reset(send_algorithm);
27 } 32 }
28 33
29 // static 34 // static
30 void QuicSentPacketManagerPeer::SetIsServer( 35 void QuicSentPacketManagerPeer::SetIsServer(
31 QuicSentPacketManager* sent_packet_manager, 36 QuicSentPacketManager* sent_packet_manager,
32 bool is_server) { 37 bool is_server) {
33 sent_packet_manager->is_server_ = is_server; 38 sent_packet_manager->is_server_ = is_server;
34 } 39 }
35 40
36 // static 41 // static
42 const SendAlgorithmInterface*
43 QuicSentPacketManagerPeer::GetSendAlgorithm(
44 const QuicSentPacketManager& sent_packet_manager) {
45 return sent_packet_manager.send_algorithm_.get();
46 }
47
48 // static
49 void QuicSentPacketManagerPeer::SetSendAlgorithm(
50 QuicSentPacketManager* sent_packet_manager,
51 SendAlgorithmInterface* send_algorithm) {
52 sent_packet_manager->send_algorithm_.reset(send_algorithm);
53 }
54
55 // static
37 const LossDetectionInterface* QuicSentPacketManagerPeer::GetLossAlgorithm( 56 const LossDetectionInterface* QuicSentPacketManagerPeer::GetLossAlgorithm(
38 QuicSentPacketManager* sent_packet_manager) { 57 QuicSentPacketManager* sent_packet_manager) {
39 return sent_packet_manager->loss_algorithm_.get(); 58 return sent_packet_manager->loss_algorithm_.get();
40 } 59 }
41 60
42 // static 61 // static
43 const SendAlgorithmInterface*
44 QuicSentPacketManagerPeer::GetCongestionControlAlgorithm(
45 const QuicSentPacketManager& sent_packet_manager) {
46 return sent_packet_manager.send_algorithm_.get();
47 }
48
49 // static
50 void QuicSentPacketManagerPeer::SetLossAlgorithm( 62 void QuicSentPacketManagerPeer::SetLossAlgorithm(
51 QuicSentPacketManager* sent_packet_manager, 63 QuicSentPacketManager* sent_packet_manager,
52 LossDetectionInterface* loss_detector) { 64 LossDetectionInterface* loss_detector) {
53 sent_packet_manager->loss_algorithm_.reset(loss_detector); 65 sent_packet_manager->loss_algorithm_.reset(loss_detector);
54 } 66 }
55 67
56 // static 68 // static
57 RttStats* QuicSentPacketManagerPeer::GetRttStats( 69 RttStats* QuicSentPacketManagerPeer::GetRttStats(
58 QuicSentPacketManager* sent_packet_manager) { 70 QuicSentPacketManager* sent_packet_manager) {
59 return &sent_packet_manager->rtt_stats_; 71 return &sent_packet_manager->rtt_stats_;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 160 }
149 161
150 // static 162 // static
151 QuicSustainedBandwidthRecorder& QuicSentPacketManagerPeer::GetBandwidthRecorder( 163 QuicSustainedBandwidthRecorder& QuicSentPacketManagerPeer::GetBandwidthRecorder(
152 QuicSentPacketManager* sent_packet_manager) { 164 QuicSentPacketManager* sent_packet_manager) {
153 return sent_packet_manager->sustained_bandwidth_recorder_; 165 return sent_packet_manager->sustained_bandwidth_recorder_;
154 } 166 }
155 167
156 } // namespace test 168 } // namespace test
157 } // namespace net 169 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_sent_packet_manager_peer.h ('k') | net/quic/test_tools/quic_test_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698