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

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

Issue 515303003: Landing Recent QUIC Changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix for 409191 Created 6 years, 3 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
« no previous file with comments | « net/quic/quic_unacked_packet_map_test.cc ('k') | net/tools/quic/quic_client_session_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 sequence_number).sent_time; 82 sequence_number).sent_time;
83 } 83 }
84 84
85 // static 85 // static
86 bool QuicSentPacketManagerPeer::IsRetransmission( 86 bool QuicSentPacketManagerPeer::IsRetransmission(
87 QuicSentPacketManager* sent_packet_manager, 87 QuicSentPacketManager* sent_packet_manager,
88 QuicPacketSequenceNumber sequence_number) { 88 QuicPacketSequenceNumber sequence_number) {
89 DCHECK(sent_packet_manager->HasRetransmittableFrames(sequence_number)); 89 DCHECK(sent_packet_manager->HasRetransmittableFrames(sequence_number));
90 return sent_packet_manager->HasRetransmittableFrames(sequence_number) && 90 return sent_packet_manager->HasRetransmittableFrames(sequence_number) &&
91 sent_packet_manager->unacked_packets_.GetTransmissionInfo( 91 sent_packet_manager->unacked_packets_.GetTransmissionInfo(
92 sequence_number).all_transmissions->size() > 1; 92 sequence_number).all_transmissions != NULL;
93 } 93 }
94 94
95 // static 95 // static
96 void QuicSentPacketManagerPeer::MarkForRetransmission( 96 void QuicSentPacketManagerPeer::MarkForRetransmission(
97 QuicSentPacketManager* sent_packet_manager, 97 QuicSentPacketManager* sent_packet_manager,
98 QuicPacketSequenceNumber sequence_number, 98 QuicPacketSequenceNumber sequence_number,
99 TransmissionType transmission_type) { 99 TransmissionType transmission_type) {
100 sent_packet_manager->MarkForRetransmission(sequence_number, 100 sent_packet_manager->MarkForRetransmission(sequence_number,
101 transmission_type); 101 transmission_type);
102 } 102 }
(...skipping 10 matching lines...) Expand all
113 return sent_packet_manager->unacked_packets_.HasPendingCryptoPackets(); 113 return sent_packet_manager->unacked_packets_.HasPendingCryptoPackets();
114 } 114 }
115 115
116 // static 116 // static
117 size_t QuicSentPacketManagerPeer::GetNumRetransmittablePackets( 117 size_t QuicSentPacketManagerPeer::GetNumRetransmittablePackets(
118 const QuicSentPacketManager* sent_packet_manager) { 118 const QuicSentPacketManager* sent_packet_manager) {
119 size_t num_unacked_packets = 0; 119 size_t num_unacked_packets = 0;
120 for (QuicUnackedPacketMap::const_iterator it = 120 for (QuicUnackedPacketMap::const_iterator it =
121 sent_packet_manager->unacked_packets_.begin(); 121 sent_packet_manager->unacked_packets_.begin();
122 it != sent_packet_manager->unacked_packets_.end(); ++it) { 122 it != sent_packet_manager->unacked_packets_.end(); ++it) {
123 if (it->second.retransmittable_frames != NULL) { 123 if (it->retransmittable_frames != NULL) {
124 ++num_unacked_packets; 124 ++num_unacked_packets;
125 } 125 }
126 } 126 }
127 return num_unacked_packets; 127 return num_unacked_packets;
128 } 128 }
129 129
130 // static 130 // static
131 QuicByteCount QuicSentPacketManagerPeer::GetBytesInFlight( 131 QuicByteCount QuicSentPacketManagerPeer::GetBytesInFlight(
132 const QuicSentPacketManager* sent_packet_manager) { 132 const QuicSentPacketManager* sent_packet_manager) {
133 return sent_packet_manager->unacked_packets_.bytes_in_flight(); 133 return sent_packet_manager->unacked_packets_.bytes_in_flight();
134 } 134 }
135 135
136 // static 136 // static
137 QuicSentPacketManager::NetworkChangeVisitor* 137 QuicSentPacketManager::NetworkChangeVisitor*
138 QuicSentPacketManagerPeer::GetNetworkChangeVisitor( 138 QuicSentPacketManagerPeer::GetNetworkChangeVisitor(
139 const QuicSentPacketManager* sent_packet_manager) { 139 const QuicSentPacketManager* sent_packet_manager) {
140 return sent_packet_manager->network_change_visitor_; 140 return sent_packet_manager->network_change_visitor_;
141 } 141 }
142 142
143 // static 143 // static
144 QuicSustainedBandwidthRecorder& QuicSentPacketManagerPeer::GetBandwidthRecorder( 144 QuicSustainedBandwidthRecorder& QuicSentPacketManagerPeer::GetBandwidthRecorder(
145 QuicSentPacketManager* sent_packet_manager) { 145 QuicSentPacketManager* sent_packet_manager) {
146 return sent_packet_manager->sustained_bandwidth_recorder_; 146 return sent_packet_manager->sustained_bandwidth_recorder_;
147 } 147 }
148 148
149 } // namespace test 149 } // namespace test
150 } // namespace net 150 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_unacked_packet_map_test.cc ('k') | net/tools/quic/quic_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698