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

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

Issue 282323003: Minor cleanup of QuicUnackedPacketMap to simplify the implementation of (Closed) Base URL: https://chromium.googlesource.com/chromium/src
Patch Set: Created 6 years, 7 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.cc ('k') | no next file » | 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 // static 103 // static
104 bool QuicSentPacketManagerPeer::HasUnackedCryptoPackets( 104 bool QuicSentPacketManagerPeer::HasUnackedCryptoPackets(
105 const QuicSentPacketManager* sent_packet_manager) { 105 const QuicSentPacketManager* sent_packet_manager) {
106 return sent_packet_manager->unacked_packets_.HasPendingCryptoPackets(); 106 return sent_packet_manager->unacked_packets_.HasPendingCryptoPackets();
107 } 107 }
108 108
109 // static 109 // static
110 size_t QuicSentPacketManagerPeer::GetNumRetransmittablePackets( 110 size_t QuicSentPacketManagerPeer::GetNumRetransmittablePackets(
111 const QuicSentPacketManager* sent_packet_manager) { 111 const QuicSentPacketManager* sent_packet_manager) {
112 return sent_packet_manager->unacked_packets_.GetNumRetransmittablePackets(); 112 size_t num_unacked_packets = 0;
113 for (QuicUnackedPacketMap::const_iterator it =
114 sent_packet_manager->unacked_packets_.begin();
115 it != sent_packet_manager->unacked_packets_.end(); ++it) {
116 if (it->second.retransmittable_frames != NULL) {
117 ++num_unacked_packets;
118 }
119 }
120 return num_unacked_packets;
113 } 121 }
114 122
115 // static 123 // static
116 QuicByteCount QuicSentPacketManagerPeer::GetBytesInFlight( 124 QuicByteCount QuicSentPacketManagerPeer::GetBytesInFlight(
117 const QuicSentPacketManager* sent_packet_manager) { 125 const QuicSentPacketManager* sent_packet_manager) {
118 return sent_packet_manager->unacked_packets_.bytes_in_flight(); 126 return sent_packet_manager->unacked_packets_.bytes_in_flight();
119 } 127 }
120 128
121 } // namespace test 129 } // namespace test
122 } // namespace net 130 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_unacked_packet_map.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698