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

Unified Diff: net/quic/quic_sent_packet_manager.cc

Issue 293383008: Simplify QuicSentPacketManager MarkPacketHandled to take an iterator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_sent_packet_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_sent_packet_manager.cc
diff --git a/net/quic/quic_sent_packet_manager.cc b/net/quic/quic_sent_packet_manager.cc
index eefb320842ad808629f2e5d7bd1cf7faa20cc6ec..ce595610ea5f4bae8e4403e1e5ffa39676836812 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -204,7 +204,7 @@ void QuicSentPacketManager::HandleAckForSentPackets(
if (it->second.pending) {
packets_acked_[sequence_number] = it->second;
}
- it = MarkPacketHandled(sequence_number, delta_largest_observed);
+ it = MarkPacketHandled(it, delta_largest_observed);
}
// Discard any retransmittable frames associated with revived packets.
@@ -226,17 +226,6 @@ void QuicSentPacketManager::RetransmitUnackedPackets(
while (unacked_it != unacked_packets_.end()) {
const RetransmittableFrames* frames =
unacked_it->second.retransmittable_frames;
- // Only mark it as handled if it can't be retransmitted and there are no
- // pending retransmissions which would be cleared.
- if (frames == NULL && unacked_it->second.all_transmissions->size() == 1 &&
- retransmission_type == ALL_PACKETS) {
- unacked_it = MarkPacketHandled(unacked_it->first,
- QuicTime::Delta::Zero());
- continue;
- }
- // If it had no other transmissions, we handle it above. If it has
- // other transmissions, one of them must have retransmittable frames,
- // so that gets resolved the same way as other retransmissions.
// TODO(ianswett): Consider adding a new retransmission type which removes
// all these old packets from unacked and retransmits them as new sequence
// numbers with no connection to the previous ones.
@@ -343,14 +332,12 @@ void QuicSentPacketManager::MarkPacketRevived(
}
QuicUnackedPacketMap::const_iterator QuicSentPacketManager::MarkPacketHandled(
- QuicPacketSequenceNumber sequence_number,
+ QuicUnackedPacketMap::const_iterator it,
QuicTime::Delta delta_largest_observed) {
- if (!unacked_packets_.IsUnacked(sequence_number)) {
- LOG(DFATAL) << "Packet is not unacked: " << sequence_number;
- return unacked_packets_.end();
- }
- const TransmissionInfo& transmission_info =
- unacked_packets_.GetTransmissionInfo(sequence_number);
+ LOG_IF(DFATAL, it == unacked_packets_.end())
+ << "MarkPacketHandled must be passed a valid iterator entry.";
+ const QuicPacketSequenceNumber sequence_number = it->first;
+ const TransmissionInfo& transmission_info = it->second;
QuicPacketSequenceNumber newest_transmission =
*transmission_info.all_transmissions->rbegin();
« no previous file with comments | « net/quic/quic_sent_packet_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698