| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "net/quic/congestion_control/pacing_sender.h" | 9 #include "net/quic/congestion_control/pacing_sender.h" |
| 10 #include "net/quic/quic_ack_notifier_manager.h" | 10 #include "net/quic/quic_ack_notifier_manager.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 void QuicSentPacketManager::ClearPreviousRetransmissions(size_t num_to_clear) { | 248 void QuicSentPacketManager::ClearPreviousRetransmissions(size_t num_to_clear) { |
| 249 UnackedPacketMap::iterator it = unacked_packets_.begin(); | 249 UnackedPacketMap::iterator it = unacked_packets_.begin(); |
| 250 while (it != unacked_packets_.end() && num_to_clear > 0) { | 250 while (it != unacked_packets_.end() && num_to_clear > 0) { |
| 251 QuicPacketSequenceNumber sequence_number = it->first; | 251 QuicPacketSequenceNumber sequence_number = it->first; |
| 252 // If this is not a previous transmission then there is no point | 252 // If this is not a previous transmission then there is no point |
| 253 // in clearing out any further packets, because it will not affect | 253 // in clearing out any further packets, because it will not affect |
| 254 // the high water mark. | 254 // the high water mark. |
| 255 SequenceNumberSet* previous_transmissions = | 255 SequenceNumberSet* previous_transmissions = |
| 256 it->second.previous_transmissions; | 256 it->second.previous_transmissions; |
| 257 if (previous_transmissions == NULL) { | 257 if (previous_transmissions == NULL) { |
| 258 if (it->second.retransmittable_frames == NULL) { |
| 259 // This is a current transmission, but a previous transmission has |
| 260 // been acked, so it's safe to remove. |
| 261 it = MarkPacketHandled(sequence_number, NOT_RECEIVED_BY_PEER); |
| 262 --num_to_clear; |
| 263 continue; |
| 264 } |
| 258 break; | 265 break; |
| 259 } | 266 } |
| 260 QuicPacketSequenceNumber newest_transmission = | 267 QuicPacketSequenceNumber newest_transmission = |
| 261 *previous_transmissions->rbegin(); | 268 *previous_transmissions->rbegin(); |
| 262 if (sequence_number == newest_transmission) { | 269 if (sequence_number == newest_transmission) { |
| 263 break; | 270 break; |
| 264 } | 271 } |
| 265 | 272 |
| 266 DCHECK(it->second.retransmittable_frames == NULL); | 273 DCHECK(it->second.retransmittable_frames == NULL); |
| 267 previous_transmissions->erase(sequence_number); | 274 previous_transmissions->erase(sequence_number); |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 } | 972 } |
| 966 previous_transmissions->erase(sequence_number); | 973 previous_transmissions->erase(sequence_number); |
| 967 if (previous_transmissions->size() == 1) { | 974 if (previous_transmissions->size() == 1) { |
| 968 QuicPacketSequenceNumber current = *previous_transmissions->begin(); | 975 QuicPacketSequenceNumber current = *previous_transmissions->begin(); |
| 969 unacked_packets_[current].previous_transmissions = NULL; | 976 unacked_packets_[current].previous_transmissions = NULL; |
| 970 delete previous_transmissions; | 977 delete previous_transmissions; |
| 971 } | 978 } |
| 972 } | 979 } |
| 973 | 980 |
| 974 } // namespace net | 981 } // namespace net |
| OLD | NEW |