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

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

Issue 185053006: Refactor of QUIC's rtt storage and calculation to have a single RttStats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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 | Annotate | Revision Log
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"
(...skipping 16 matching lines...) Expand all
27 } 27 }
28 28
29 // static 29 // static
30 void QuicSentPacketManagerPeer::SetLossAlgorithm( 30 void QuicSentPacketManagerPeer::SetLossAlgorithm(
31 QuicSentPacketManager* sent_packet_manager, 31 QuicSentPacketManager* sent_packet_manager,
32 LossDetectionInterface* loss_detector) { 32 LossDetectionInterface* loss_detector) {
33 sent_packet_manager->loss_algorithm_.reset(loss_detector); 33 sent_packet_manager->loss_algorithm_.reset(loss_detector);
34 } 34 }
35 35
36 // static 36 // static
37 RttStats* QuicSentPacketManagerPeer::GetRttStats(
38 QuicSentPacketManager* sent_packet_manager) {
39 return &sent_packet_manager->rtt_stats_;
40 }
41
42 // static
37 size_t QuicSentPacketManagerPeer::GetNackCount( 43 size_t QuicSentPacketManagerPeer::GetNackCount(
38 const QuicSentPacketManager* sent_packet_manager, 44 const QuicSentPacketManager* sent_packet_manager,
39 QuicPacketSequenceNumber sequence_number) { 45 QuicPacketSequenceNumber sequence_number) {
40 return sent_packet_manager->unacked_packets_. 46 return sent_packet_manager->unacked_packets_.
41 GetTransmissionInfo(sequence_number).nack_count; 47 GetTransmissionInfo(sequence_number).nack_count;
42 } 48 }
43 49
44 // static 50 // static
45 size_t QuicSentPacketManagerPeer::GetPendingRetransmissionCount( 51 size_t QuicSentPacketManagerPeer::GetPendingRetransmissionCount(
46 const QuicSentPacketManager* sent_packet_manager) { 52 const QuicSentPacketManager* sent_packet_manager) {
(...skipping 10 matching lines...) Expand all
57 QuicTime QuicSentPacketManagerPeer::GetSentTime( 63 QuicTime QuicSentPacketManagerPeer::GetSentTime(
58 const QuicSentPacketManager* sent_packet_manager, 64 const QuicSentPacketManager* sent_packet_manager,
59 QuicPacketSequenceNumber sequence_number) { 65 QuicPacketSequenceNumber sequence_number) {
60 DCHECK(sent_packet_manager->unacked_packets_.IsUnacked(sequence_number)); 66 DCHECK(sent_packet_manager->unacked_packets_.IsUnacked(sequence_number));
61 67
62 return sent_packet_manager->unacked_packets_.GetTransmissionInfo( 68 return sent_packet_manager->unacked_packets_.GetTransmissionInfo(
63 sequence_number).sent_time; 69 sequence_number).sent_time;
64 } 70 }
65 71
66 // static 72 // static
67 QuicTime::Delta QuicSentPacketManagerPeer::rtt(
68 QuicSentPacketManager* sent_packet_manager) {
69 return sent_packet_manager->rtt_sample_;
70 }
71
72 // static
73 bool QuicSentPacketManagerPeer::IsRetransmission( 73 bool QuicSentPacketManagerPeer::IsRetransmission(
74 QuicSentPacketManager* sent_packet_manager, 74 QuicSentPacketManager* sent_packet_manager,
75 QuicPacketSequenceNumber sequence_number) { 75 QuicPacketSequenceNumber sequence_number) {
76 DCHECK(sent_packet_manager->HasRetransmittableFrames(sequence_number)); 76 DCHECK(sent_packet_manager->HasRetransmittableFrames(sequence_number));
77 return sent_packet_manager->HasRetransmittableFrames(sequence_number) && 77 return sent_packet_manager->HasRetransmittableFrames(sequence_number) &&
78 sent_packet_manager->unacked_packets_.GetTransmissionInfo( 78 sent_packet_manager->unacked_packets_.GetTransmissionInfo(
79 sequence_number).all_transmissions->size() > 1; 79 sequence_number).all_transmissions->size() > 1;
80 } 80 }
81 81
82 // static 82 // static
(...skipping 24 matching lines...) Expand all
107 } 107 }
108 108
109 // static 109 // static
110 SequenceNumberSet QuicSentPacketManagerPeer::GetUnackedPackets( 110 SequenceNumberSet QuicSentPacketManagerPeer::GetUnackedPackets(
111 const QuicSentPacketManager* sent_packet_manager) { 111 const QuicSentPacketManager* sent_packet_manager) {
112 return sent_packet_manager->unacked_packets_.GetUnackedPackets(); 112 return sent_packet_manager->unacked_packets_.GetUnackedPackets();
113 } 113 }
114 114
115 } // namespace test 115 } // namespace test
116 } // namespace net 116 } // 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