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

Unified Diff: net/quic/quic_sent_packet_manager.cc

Issue 266243004: Clang format slam. 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
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 6e103d393f06103a85c51af14990b2651d305aa3..895e4ffa89721425f9941edb04ee5409cdd6c95c 100644
--- a/net/quic/quic_sent_packet_manager.cc
+++ b/net/quic/quic_sent_packet_manager.cc
@@ -44,7 +44,7 @@ bool HasCryptoHandshake(
return false;
}
return transmission_info.retransmittable_frames->HasCryptoHandshake() ==
- IS_HANDSHAKE;
+ IS_HANDSHAKE;
}
} // namespace
@@ -140,8 +140,8 @@ void QuicSentPacketManager::OnIncomingAck(
void QuicSentPacketManager::DiscardUnackedPacket(
QuicPacketSequenceNumber sequence_number) {
- MarkPacketHandled(sequence_number, QuicTime::Delta::Zero(),
- NOT_RECEIVED_BY_PEER);
+ MarkPacketHandled(
+ sequence_number, QuicTime::Delta::Zero(), NOT_RECEIVED_BY_PEER);
}
void QuicSentPacketManager::HandleAckForSentPackets(
@@ -162,8 +162,8 @@ void QuicSentPacketManager::HandleAckForSentPackets(
// Remove any packets not being tracked by the send algorithm, allowing
// the high water mark to be raised if necessary.
if (QuicUnackedPacketMap::IsSentAndNotPending(it->second)) {
- it = MarkPacketHandled(sequence_number, delta_largest_observed,
- NOT_RECEIVED_BY_PEER);
+ it = MarkPacketHandled(
+ sequence_number, delta_largest_observed, NOT_RECEIVED_BY_PEER);
} else {
++it;
}
@@ -171,17 +171,18 @@ void QuicSentPacketManager::HandleAckForSentPackets(
}
// Packet was acked, so remove it from our unacked packet list.
- DVLOG(1) << ENDPOINT <<"Got an ack for packet " << sequence_number;
+ DVLOG(1) << ENDPOINT << "Got an ack for packet " << sequence_number;
// If data is associated with the most recent transmission of this
// packet, then inform the caller.
- it = MarkPacketHandled(sequence_number, delta_largest_observed,
- RECEIVED_BY_PEER);
+ it = MarkPacketHandled(
+ sequence_number, delta_largest_observed, RECEIVED_BY_PEER);
}
// Discard any retransmittable frames associated with revived packets.
for (SequenceNumberSet::const_iterator revived_it =
received_info.revived_packets.begin();
- revived_it != received_info.revived_packets.end(); ++revived_it) {
+ revived_it != received_info.revived_packets.end();
+ ++revived_it) {
MarkPacketRevived(*revived_it, delta_largest_observed);
}
@@ -209,8 +210,8 @@ void QuicSentPacketManager::RetransmitUnackedPackets(
// 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(),
- NOT_RECEIVED_BY_PEER);
+ unacked_it = MarkPacketHandled(
+ unacked_it->first, QuicTime::Delta::Zero(), NOT_RECEIVED_BY_PEER);
continue;
}
// If it had no other transmissions, we handle it above. If it has
@@ -266,7 +267,7 @@ bool QuicSentPacketManager::HasPendingRetransmissions() const {
}
QuicSentPacketManager::PendingRetransmission
- QuicSentPacketManager::NextPendingRetransmission() {
+QuicSentPacketManager::NextPendingRetransmission() {
DCHECK(!pending_retransmissions_.empty());
QuicPacketSequenceNumber sequence_number =
pending_retransmissions_.begin()->first;
@@ -276,8 +277,7 @@ QuicSentPacketManager::PendingRetransmission
PendingRetransmissionMap::const_iterator it =
pending_retransmissions_.begin();
do {
- if (HasCryptoHandshake(
- unacked_packets_.GetTransmissionInfo(it->first))) {
+ if (HasCryptoHandshake(unacked_packets_.GetTransmissionInfo(it->first))) {
sequence_number = it->first;
transmission_type = it->second;
break;
@@ -311,8 +311,8 @@ void QuicSentPacketManager::MarkPacketRevived(
// The AckNotifierManager needs to be notified for revived packets,
// since it indicates the packet arrived from the appliction's perspective.
if (transmission_info.retransmittable_frames) {
- ack_notifier_manager_.OnPacketAcked(
- sequence_number, delta_largest_observed);
+ ack_notifier_manager_.OnPacketAcked(sequence_number,
+ delta_largest_observed);
}
if (!transmission_info.pending) {
@@ -324,7 +324,8 @@ void QuicSentPacketManager::MarkPacketRevived(
QuicUnackedPacketMap::const_iterator QuicSentPacketManager::MarkPacketHandled(
QuicPacketSequenceNumber sequence_number,
- QuicTime::Delta delta_largest_observed, ReceivedByPeer received_by_peer) {
+ QuicTime::Delta delta_largest_observed,
+ ReceivedByPeer received_by_peer) {
if (!unacked_packets_.IsUnacked(sequence_number)) {
LOG(DFATAL) << "Packet is not unacked: " << sequence_number;
return unacked_packets_.end();
@@ -400,8 +401,8 @@ bool QuicSentPacketManager::HasUnackedPackets() const {
return unacked_packets_.HasUnackedPackets();
}
-QuicPacketSequenceNumber
-QuicSentPacketManager::GetLeastUnackedSentPacket() const {
+QuicPacketSequenceNumber QuicSentPacketManager::GetLeastUnackedSentPacket()
+ const {
return unacked_packets_.GetLeastUnackedSentPacket();
}
@@ -420,8 +421,8 @@ bool QuicSentPacketManager::OnPacketSent(
}
// Only track packets as pending that the send algorithm wants us to track.
- if (!send_algorithm_->OnPacketSent(sent_time, sequence_number, bytes,
- has_retransmittable_data)) {
+ if (!send_algorithm_->OnPacketSent(
+ sent_time, sequence_number, bytes, has_retransmittable_data)) {
unacked_packets_.SetSent(sequence_number, sent_time, bytes, false);
// Do not reset the retransmission timer, since the packet isn't tracked.
return false;
@@ -473,7 +474,8 @@ void QuicSentPacketManager::RetransmitCryptoPackets() {
consecutive_crypto_retransmission_count_ + 1);
bool packet_retransmitted = false;
for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it) {
+ it != unacked_packets_.end();
+ ++it) {
QuicPacketSequenceNumber sequence_number = it->first;
const RetransmittableFrames* frames = it->second.retransmittable_frames;
// Only retransmit frames which are pending, and therefore have been sent.
@@ -493,7 +495,8 @@ void QuicSentPacketManager::RetransmitOldestPacket() {
DCHECK_EQ(TLP_MODE, GetRetransmissionMode());
++consecutive_tlp_count_;
for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it) {
+ it != unacked_packets_.end();
+ ++it) {
QuicPacketSequenceNumber sequence_number = it->first;
const RetransmittableFrames* frames = it->second.retransmittable_frames;
// Only retransmit frames which are pending, and therefore have been sent.
@@ -505,7 +508,7 @@ void QuicSentPacketManager::RetransmitOldestPacket() {
return;
}
DLOG(FATAL)
- << "No retransmittable packets, so RetransmitOldestPacket failed.";
+ << "No retransmittable packets, so RetransmitOldestPacket failed.";
}
void QuicSentPacketManager::RetransmitAllPackets() {
@@ -521,7 +524,8 @@ void QuicSentPacketManager::RetransmitAllPackets() {
// Abandon any non-retransmittable packets that are sufficiently old.
bool packets_retransmitted = false;
for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
- it != unacked_packets_.end(); ++it) {
+ it != unacked_packets_.end();
+ ++it) {
unacked_packets_.SetNotPending(it->first);
if (it->second.retransmittable_frames != NULL) {
packets_retransmitted = true;
@@ -536,7 +540,7 @@ void QuicSentPacketManager::RetransmitAllPackets() {
}
QuicSentPacketManager::RetransmissionTimeoutMode
- QuicSentPacketManager::GetRetransmissionMode() const {
+QuicSentPacketManager::GetRetransmissionMode() const {
DCHECK(unacked_packets_.HasPendingPackets());
if (unacked_packets_.HasPendingCryptoPackets()) {
return HANDSHAKE_MODE;
@@ -567,8 +571,8 @@ void QuicSentPacketManager::OnPacketAbandoned(
void QuicSentPacketManager::OnIncomingQuicCongestionFeedbackFrame(
const QuicCongestionFeedbackFrame& frame,
const QuicTime& feedback_receive_time) {
- send_algorithm_->OnIncomingQuicCongestionFeedbackFrame(
- frame, feedback_receive_time);
+ send_algorithm_->OnIncomingQuicCongestionFeedbackFrame(frame,
+ feedback_receive_time);
}
void QuicSentPacketManager::MaybeRetransmitOnAckFrame(
@@ -577,7 +581,8 @@ void QuicSentPacketManager::MaybeRetransmitOnAckFrame(
// Go through all pending packets up to the largest observed and count nacks.
for (QuicUnackedPacketMap::const_iterator it = unacked_packets_.begin();
it != unacked_packets_.end() &&
- it->first <= received_info.largest_observed; ++it) {
+ it->first <= received_info.largest_observed;
+ ++it) {
if (!it->second.pending) {
continue;
}
@@ -602,13 +607,11 @@ void QuicSentPacketManager::MaybeRetransmitOnAckFrame(
}
void QuicSentPacketManager::InvokeLossDetection(QuicTime time) {
- SequenceNumberSet lost_packets =
- loss_algorithm_->DetectLostPackets(unacked_packets_,
- time,
- largest_observed_,
- rtt_stats_);
+ SequenceNumberSet lost_packets = loss_algorithm_->DetectLostPackets(
+ unacked_packets_, time, largest_observed_, rtt_stats_);
for (SequenceNumberSet::const_iterator it = lost_packets.begin();
- it != lost_packets.end(); ++it) {
+ it != lost_packets.end();
+ ++it) {
QuicPacketSequenceNumber sequence_number = *it;
// TODO(ianswett): If it's expected the FEC packet may repair the loss, it
// should be recorded as a loss to the send algorithm, but not retransmitted
@@ -676,7 +679,7 @@ QuicTime::Delta QuicSentPacketManager::TimeUntilSend(
// any benefits, but if the delayed ack becomes a significant source
// of (likely, tail) latency, then consider such a mechanism.
const QuicTime::Delta QuicSentPacketManager::DelayedAckTime() const {
- return QuicTime::Delta::FromMilliseconds(kMinRetransmissionTimeMs/2);
+ return QuicTime::Delta::FromMilliseconds(kMinRetransmissionTimeMs / 2);
}
const QuicTime QuicSentPacketManager::GetRetransmissionTime() const {
@@ -704,8 +707,8 @@ const QuicTime QuicSentPacketManager::GetRetransmissionTime() const {
unacked_packets_.GetFirstPendingPacketSentTime();
QuicTime rto_timeout = sent_time.Add(GetRetransmissionDelay());
// Always wait at least 1.5 * RTT from now.
- QuicTime min_timeout = clock_->ApproximateNow().Add(
- rtt_stats_.SmoothedRtt().Multiply(1.5));
+ QuicTime min_timeout =
+ clock_->ApproximateNow().Add(rtt_stats_.SmoothedRtt().Multiply(1.5));
return QuicTime::Max(min_timeout, rto_timeout);
}
@@ -727,8 +730,8 @@ const QuicTime::Delta QuicSentPacketManager::GetCryptoRetransmissionDelay()
const QuicTime::Delta QuicSentPacketManager::GetTailLossProbeDelay() const {
QuicTime::Delta srtt = rtt_stats_.SmoothedRtt();
if (!unacked_packets_.HasMultiplePendingPackets()) {
- return QuicTime::Delta::Max(
- srtt.Multiply(1.5).Add(DelayedAckTime()), srtt.Multiply(2));
+ return QuicTime::Delta::Max(srtt.Multiply(1.5).Add(DelayedAckTime()),
+ srtt.Multiply(2));
}
return QuicTime::Delta::FromMilliseconds(
max(kMinTailLossProbeTimeoutMs,
@@ -779,9 +782,8 @@ void QuicSentPacketManager::MaybeEnablePacing() {
}
using_pacing_ = true;
- send_algorithm_.reset(
- new PacingSender(send_algorithm_.release(),
- QuicTime::Delta::FromMicroseconds(1)));
+ send_algorithm_.reset(new PacingSender(send_algorithm_.release(),
+ QuicTime::Delta::FromMicroseconds(1)));
}
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698