OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/quic_unacked_packet_map.h" | 5 #include "net/quic/quic_unacked_packet_map.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
9 #include "net/quic/quic_connection_stats.h" | 9 #include "net/quic/quic_connection_stats.h" |
10 #include "net/quic/quic_utils_chromium.h" | 10 #include "net/quic/quic_utils_chromium.h" |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 DCHECK_GE(sequence_number, least_unacked_); | 293 DCHECK_GE(sequence_number, least_unacked_); |
294 DCHECK_LT(sequence_number, least_unacked_ + unacked_packets_.size()); | 294 DCHECK_LT(sequence_number, least_unacked_ + unacked_packets_.size()); |
295 TransmissionInfo* info = &unacked_packets_[sequence_number - least_unacked_]; | 295 TransmissionInfo* info = &unacked_packets_[sequence_number - least_unacked_]; |
296 if (info->in_flight) { | 296 if (info->in_flight) { |
297 LOG_IF(DFATAL, bytes_in_flight_ < info->bytes_sent); | 297 LOG_IF(DFATAL, bytes_in_flight_ < info->bytes_sent); |
298 bytes_in_flight_ -= info->bytes_sent; | 298 bytes_in_flight_ -= info->bytes_sent; |
299 info->in_flight = false; | 299 info->in_flight = false; |
300 } | 300 } |
301 } | 301 } |
302 | 302 |
303 void QuicUnackedPacketMap::StopRetransmissionForStream(QuicStreamId stream_id) { | 303 void QuicUnackedPacketMap::CancelRetransmissionsForStream( |
| 304 QuicStreamId stream_id) { |
304 if (stream_id == kCryptoStreamId || stream_id == kHeadersStreamId) { | 305 if (stream_id == kCryptoStreamId || stream_id == kHeadersStreamId) { |
305 LOG(DFATAL) << "Special streams must always retransmit data: " << stream_id; | 306 LOG(DFATAL) << "Special streams must always retransmit data: " << stream_id; |
306 return; | 307 return; |
307 } | 308 } |
308 QuicPacketSequenceNumber sequence_number = least_unacked_; | 309 QuicPacketSequenceNumber sequence_number = least_unacked_; |
309 for (UnackedPacketMap::const_iterator it = unacked_packets_.begin(); | 310 for (UnackedPacketMap::const_iterator it = unacked_packets_.begin(); |
310 it != unacked_packets_.end(); ++it, ++sequence_number) { | 311 it != unacked_packets_.end(); ++it, ++sequence_number) { |
311 RetransmittableFrames* retransmittable_frames = it->retransmittable_frames; | 312 RetransmittableFrames* retransmittable_frames = it->retransmittable_frames; |
312 if (!retransmittable_frames) { | 313 if (!retransmittable_frames) { |
313 continue; | 314 continue; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 } | 385 } |
385 } | 386 } |
386 return false; | 387 return false; |
387 } | 388 } |
388 | 389 |
389 QuicPacketSequenceNumber QuicUnackedPacketMap::GetLeastUnacked() const { | 390 QuicPacketSequenceNumber QuicUnackedPacketMap::GetLeastUnacked() const { |
390 return least_unacked_; | 391 return least_unacked_; |
391 } | 392 } |
392 | 393 |
393 } // namespace net | 394 } // namespace net |
OLD | NEW |