| OLD | NEW |
| 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/quic_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 MarkPacketRevived(*revived_it, delta_largest_observed); | 303 MarkPacketRevived(*revived_it, delta_largest_observed); |
| 304 } | 304 } |
| 305 } | 305 } |
| 306 | 306 |
| 307 bool QuicSentPacketManager::HasRetransmittableFrames( | 307 bool QuicSentPacketManager::HasRetransmittableFrames( |
| 308 QuicPacketSequenceNumber sequence_number) const { | 308 QuicPacketSequenceNumber sequence_number) const { |
| 309 return unacked_packets_.HasRetransmittableFrames(sequence_number); | 309 return unacked_packets_.HasRetransmittableFrames(sequence_number); |
| 310 } | 310 } |
| 311 | 311 |
| 312 void QuicSentPacketManager::RetransmitUnackedPackets( | 312 void QuicSentPacketManager::RetransmitUnackedPackets( |
| 313 RetransmissionType retransmission_type) { | 313 TransmissionType retransmission_type) { |
| 314 DCHECK(retransmission_type == ALL_UNACKED_RETRANSMISSION || |
| 315 retransmission_type == ALL_INITIAL_RETRANSMISSION); |
| 314 QuicPacketSequenceNumber sequence_number = unacked_packets_.GetLeastUnacked(); | 316 QuicPacketSequenceNumber sequence_number = unacked_packets_.GetLeastUnacked(); |
| 315 for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin(); | 317 for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin(); |
| 316 it != unacked_packets_.end(); ++it, ++sequence_number) { | 318 it != unacked_packets_.end(); ++it, ++sequence_number) { |
| 317 const RetransmittableFrames* frames = it->retransmittable_frames; | 319 const RetransmittableFrames* frames = it->retransmittable_frames; |
| 318 // TODO(ianswett): Consider adding a new retransmission type which removes | 320 if (frames != NULL && (retransmission_type == ALL_UNACKED_RETRANSMISSION || |
| 319 // all these old packets from unacked and retransmits them as new sequence | |
| 320 // numbers with no connection to the previous ones. | |
| 321 if (frames != NULL && (retransmission_type == ALL_PACKETS || | |
| 322 frames->encryption_level() == ENCRYPTION_INITIAL)) { | 321 frames->encryption_level() == ENCRYPTION_INITIAL)) { |
| 323 MarkForRetransmission(sequence_number, ALL_UNACKED_RETRANSMISSION); | 322 MarkForRetransmission(sequence_number, retransmission_type); |
| 324 } | 323 } |
| 325 } | 324 } |
| 326 } | 325 } |
| 327 | 326 |
| 328 void QuicSentPacketManager::NeuterUnencryptedPackets() { | 327 void QuicSentPacketManager::NeuterUnencryptedPackets() { |
| 329 QuicPacketSequenceNumber sequence_number = unacked_packets_.GetLeastUnacked(); | 328 QuicPacketSequenceNumber sequence_number = unacked_packets_.GetLeastUnacked(); |
| 330 for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin(); | 329 for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin(); |
| 331 it != unacked_packets_.end(); ++it, ++sequence_number) { | 330 it != unacked_packets_.end(); ++it, ++sequence_number) { |
| 332 const RetransmittableFrames* frames = it->retransmittable_frames; | 331 const RetransmittableFrames* frames = it->retransmittable_frames; |
| 333 if (frames != NULL && frames->encryption_level() == ENCRYPTION_NONE) { | 332 if (frames != NULL && frames->encryption_level() == ENCRYPTION_NONE) { |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 | 871 |
| 873 // Set up a pacing sender with a 5 millisecond alarm granularity. | 872 // Set up a pacing sender with a 5 millisecond alarm granularity. |
| 874 using_pacing_ = true; | 873 using_pacing_ = true; |
| 875 send_algorithm_.reset( | 874 send_algorithm_.reset( |
| 876 new PacingSender(send_algorithm_.release(), | 875 new PacingSender(send_algorithm_.release(), |
| 877 QuicTime::Delta::FromMilliseconds(5), | 876 QuicTime::Delta::FromMilliseconds(5), |
| 878 kInitialUnpacedBurst)); | 877 kInitialUnpacedBurst)); |
| 879 } | 878 } |
| 880 | 879 |
| 881 } // namespace net | 880 } // namespace net |
| OLD | NEW |