Index: net/quic/quic_unacked_packet_map.cc |
diff --git a/net/quic/quic_unacked_packet_map.cc b/net/quic/quic_unacked_packet_map.cc |
index 8d0a4b79ed2af7a9f12a871dc84724bb86f5c88e..44276b97523d320067cbd783342f9913727e5cba 100644 |
--- a/net/quic/quic_unacked_packet_map.cc |
+++ b/net/quic/quic_unacked_packet_map.cc |
@@ -20,7 +20,8 @@ QuicUnackedPacketMap::TransmissionInfo::TransmissionInfo() |
bytes_sent(0), |
nack_count(0), |
all_transmissions(NULL), |
- pending(false) { } |
+ pending(false) { |
+} |
QuicUnackedPacketMap::TransmissionInfo::TransmissionInfo( |
RetransmittableFrames* retransmittable_frames, |
@@ -59,7 +60,8 @@ QuicUnackedPacketMap::QuicUnackedPacketMap() |
QuicUnackedPacketMap::~QuicUnackedPacketMap() { |
for (UnackedPacketMap::iterator it = unacked_packets_.begin(); |
- it != unacked_packets_.end(); ++it) { |
+ it != unacked_packets_.end(); |
+ ++it) { |
delete it->second.retransmittable_frames; |
// Only delete all_transmissions once, for the newest packet. |
if (it->first == *it->second.all_transmissions->rbegin()) { |
@@ -73,12 +75,11 @@ QuicUnackedPacketMap::~QuicUnackedPacketMap() { |
void QuicUnackedPacketMap::AddPacket( |
const SerializedPacket& serialized_packet) { |
if (!unacked_packets_.empty()) { |
- bool is_old_packet = unacked_packets_.rbegin()->first >= |
- serialized_packet.sequence_number; |
- LOG_IF(DFATAL, is_old_packet) << "Old packet serialized: " |
- << serialized_packet.sequence_number |
- << " vs: " |
- << unacked_packets_.rbegin()->first; |
+ bool is_old_packet = |
+ unacked_packets_.rbegin()->first >= serialized_packet.sequence_number; |
+ LOG_IF(DFATAL, is_old_packet) |
+ << "Old packet serialized: " << serialized_packet.sequence_number |
+ << " vs: " << unacked_packets_.rbegin()->first; |
} |
unacked_packets_[serialized_packet.sequence_number] = |
@@ -86,8 +87,8 @@ void QuicUnackedPacketMap::AddPacket( |
serialized_packet.sequence_number, |
serialized_packet.sequence_number_length); |
if (serialized_packet.retransmittable_frames != NULL && |
- serialized_packet.retransmittable_frames->HasCryptoHandshake() |
- == IS_HANDSHAKE) { |
+ serialized_packet.retransmittable_frames->HasCryptoHandshake() == |
+ IS_HANDSHAKE) { |
++pending_crypto_packet_count_; |
} |
} |
@@ -103,9 +104,9 @@ void QuicUnackedPacketMap::OnRetransmittedPacket( |
TransmissionInfo* transmission_info = |
FindOrNull(unacked_packets_, old_sequence_number); |
RetransmittableFrames* frames = transmission_info->retransmittable_frames; |
- LOG_IF(DFATAL, frames == NULL) << "Attempt to retransmit packet with no " |
- << "retransmittable frames: " |
- << old_sequence_number; |
+ LOG_IF(DFATAL, frames == NULL) |
+ << "Attempt to retransmit packet with no " |
+ << "retransmittable frames: " << old_sequence_number; |
// We keep the old packet in the unacked packet list until it, or one of |
// the retransmissions of it are acked. |
@@ -170,8 +171,8 @@ void QuicUnackedPacketMap::RemovePacket( |
delete transmission_info.all_transmissions; |
} |
if (transmission_info.retransmittable_frames != NULL) { |
- if (transmission_info.retransmittable_frames->HasCryptoHandshake() |
- == IS_HANDSHAKE) { |
+ if (transmission_info.retransmittable_frames->HasCryptoHandshake() == |
+ IS_HANDSHAKE) { |
--pending_crypto_packet_count_; |
} |
delete transmission_info.retransmittable_frames; |
@@ -193,8 +194,8 @@ void QuicUnackedPacketMap::NeuterPacket( |
transmission_info->all_transmissions->insert(sequence_number); |
} |
if (transmission_info->retransmittable_frames != NULL) { |
- if (transmission_info->retransmittable_frames->HasCryptoHandshake() |
- == IS_HANDSHAKE) { |
+ if (transmission_info->retransmittable_frames->HasCryptoHandshake() == |
+ IS_HANDSHAKE) { |
--pending_crypto_packet_count_; |
} |
delete transmission_info->retransmittable_frames; |
@@ -206,8 +207,8 @@ void QuicUnackedPacketMap::NeuterPacket( |
bool QuicUnackedPacketMap::IsSentAndNotPending( |
const TransmissionInfo& transmission_info) { |
return !transmission_info.pending && |
- transmission_info.sent_time != QuicTime::Zero() && |
- transmission_info.bytes_sent == 0; |
+ transmission_info.sent_time != QuicTime::Zero() && |
+ transmission_info.bytes_sent == 0; |
} |
bool QuicUnackedPacketMap::IsUnacked( |
@@ -242,8 +243,9 @@ bool QuicUnackedPacketMap::HasUnackedPackets() const { |
} |
bool QuicUnackedPacketMap::HasPendingPackets() const { |
- for (UnackedPacketMap::const_reverse_iterator it = |
- unacked_packets_.rbegin(); it != unacked_packets_.rend(); ++it) { |
+ for (UnackedPacketMap::const_reverse_iterator it = unacked_packets_.rbegin(); |
+ it != unacked_packets_.rend(); |
+ ++it) { |
if (it->second.pending) { |
return true; |
} |
@@ -252,8 +254,8 @@ bool QuicUnackedPacketMap::HasPendingPackets() const { |
} |
const QuicUnackedPacketMap::TransmissionInfo& |
- QuicUnackedPacketMap::GetTransmissionInfo( |
- QuicPacketSequenceNumber sequence_number) const { |
+QuicUnackedPacketMap::GetTransmissionInfo( |
+ QuicPacketSequenceNumber sequence_number) const { |
return unacked_packets_.find(sequence_number)->second; |
} |
@@ -291,7 +293,8 @@ size_t QuicUnackedPacketMap::GetNumUnackedPackets() const { |
bool QuicUnackedPacketMap::HasMultiplePendingPackets() const { |
size_t num_pending = 0; |
for (UnackedPacketMap::const_reverse_iterator it = unacked_packets_.rbegin(); |
- it != unacked_packets_.rend(); ++it) { |
+ it != unacked_packets_.rend(); |
+ ++it) { |
if (it->second.pending) { |
++num_pending; |
} |
@@ -307,8 +310,9 @@ bool QuicUnackedPacketMap::HasPendingCryptoPackets() const { |
} |
bool QuicUnackedPacketMap::HasUnackedRetransmittableFrames() const { |
- for (UnackedPacketMap::const_reverse_iterator it = |
- unacked_packets_.rbegin(); it != unacked_packets_.rend(); ++it) { |
+ for (UnackedPacketMap::const_reverse_iterator it = unacked_packets_.rbegin(); |
+ it != unacked_packets_.rend(); |
+ ++it) { |
if (it->second.pending && it->second.retransmittable_frames) { |
return true; |
} |
@@ -319,7 +323,8 @@ bool QuicUnackedPacketMap::HasUnackedRetransmittableFrames() const { |
size_t QuicUnackedPacketMap::GetNumRetransmittablePackets() const { |
size_t num_unacked_packets = 0; |
for (UnackedPacketMap::const_iterator it = unacked_packets_.begin(); |
- it != unacked_packets_.end(); ++it) { |
+ it != unacked_packets_.end(); |
+ ++it) { |
if (it->second.retransmittable_frames != NULL) { |
++num_unacked_packets; |
} |
@@ -327,8 +332,8 @@ size_t QuicUnackedPacketMap::GetNumRetransmittablePackets() const { |
return num_unacked_packets; |
} |
-QuicPacketSequenceNumber |
-QuicUnackedPacketMap::GetLeastUnackedSentPacket() const { |
+QuicPacketSequenceNumber QuicUnackedPacketMap::GetLeastUnackedSentPacket() |
+ const { |
if (unacked_packets_.empty()) { |
// If there are no unacked packets, return 0. |
return 0; |
@@ -340,7 +345,8 @@ QuicUnackedPacketMap::GetLeastUnackedSentPacket() const { |
SequenceNumberSet QuicUnackedPacketMap::GetUnackedPackets() const { |
SequenceNumberSet unacked_packets; |
for (UnackedPacketMap::const_iterator it = unacked_packets_.begin(); |
- it != unacked_packets_.end(); ++it) { |
+ it != unacked_packets_.end(); |
+ ++it) { |
unacked_packets.insert(it->first); |
} |
return unacked_packets; |