In QuicSentPacketManager, rename enable_pto_ to pto_enabled_.
gfe-relnote: n/a (variable renaming)
PiperOrigin-RevId: 264889046
Change-Id: Ieb6b91511dc1d7bc5b68cf923f920205f010cd81
diff --git a/quic/core/quic_connection.cc b/quic/core/quic_connection.cc
index c5020fe..20db396 100644
--- a/quic/core/quic_connection.cc
+++ b/quic/core/quic_connection.cc
@@ -420,7 +420,7 @@
if (config.HasClientSentConnectionOption(k5RTO, perspective_)) {
close_connection_after_five_rtos_ = true;
}
- if (sent_packet_manager_.enable_pto()) {
+ if (sent_packet_manager_.pto_enabled()) {
if (config.HasClientSentConnectionOption(k7PTO, perspective_)) {
max_consecutive_ptos_ = 6;
QUIC_RELOADABLE_FLAG_COUNT_N(quic_enable_pto, 3, 4);
@@ -2499,7 +2499,7 @@
ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
return;
}
- if (sent_packet_manager_.enable_pto() && max_consecutive_ptos_ > 0 &&
+ if (sent_packet_manager_.pto_enabled() && max_consecutive_ptos_ > 0 &&
sent_packet_manager_.GetConsecutivePtoCount() >= max_consecutive_ptos_) {
CloseConnection(QUIC_TOO_MANY_RTOS,
QuicStrCat(max_consecutive_ptos_ + 1,
@@ -2520,7 +2520,7 @@
// In the PTO and TLP cases, the SentPacketManager gives the connection the
// opportunity to send new data before retransmitting.
- if (sent_packet_manager_.enable_pto()) {
+ if (sent_packet_manager_.pto_enabled()) {
sent_packet_manager_.MaybeSendProbePackets();
} else if (sent_packet_manager_.MaybeRetransmitTailLossProbe()) {
// Send the pending retransmission now that it's been queued.
diff --git a/quic/core/quic_sent_packet_manager.cc b/quic/core/quic_sent_packet_manager.cc
index c1da218..025962a 100644
--- a/quic/core/quic_sent_packet_manager.cc
+++ b/quic/core/quic_sent_packet_manager.cc
@@ -115,7 +115,7 @@
QuicTime::Delta::FromMilliseconds(kDefaultDelayedAckTimeMs)),
rtt_updated_(false),
acked_packets_iter_(last_ack_frame_.packets.rbegin()),
- enable_pto_(false),
+ pto_enabled_(false),
max_probe_packets_per_pto_(2),
consecutive_pto_count_(0),
loss_removes_from_inflight_(
@@ -185,11 +185,11 @@
if (GetQuicReloadableFlag(quic_enable_pto) && fix_rto_retransmission_) {
if (config.HasClientSentConnectionOption(k2PTO, perspective)) {
- enable_pto_ = true;
+ pto_enabled_ = true;
QUIC_RELOADABLE_FLAG_COUNT_N(quic_enable_pto, 2, 4);
}
if (config.HasClientSentConnectionOption(k1PTO, perspective)) {
- enable_pto_ = true;
+ pto_enabled_ = true;
max_probe_packets_per_pto_ = 1;
QUIC_RELOADABLE_FLAG_COUNT_N(quic_enable_pto, 1, 4);
}
@@ -486,7 +486,7 @@
<< "transmission_type: "
<< QuicUtils::TransmissionTypeToString(transmission_type);
// Handshake packets should never be sent as probing retransmissions.
- DCHECK(enable_pto_ || !transmission_info->has_crypto_handshake ||
+ DCHECK(pto_enabled_ || !transmission_info->has_crypto_handshake ||
transmission_type != PROBING_RETRANSMISSION);
if (!loss_removes_from_inflight_ &&
!RetransmissionLeavesBytesInFlight(transmission_type)) {
@@ -798,7 +798,7 @@
}
bool QuicSentPacketManager::MaybeRetransmitTailLossProbe() {
- DCHECK(!enable_pto_);
+ DCHECK(!pto_enabled_);
if (pending_timer_transmission_count_ == 0) {
return false;
}
@@ -827,7 +827,7 @@
}
void QuicSentPacketManager::RetransmitRtoPackets() {
- DCHECK(!enable_pto_);
+ DCHECK(!pto_enabled_);
QUIC_BUG_IF(pending_timer_transmission_count_ > 0)
<< "Retransmissions already queued:" << pending_timer_transmission_count_;
// Mark two packets for retransmission.
@@ -927,7 +927,7 @@
if (loss_algorithm_->GetLossTimeout() != QuicTime::Zero()) {
return LOSS_MODE;
}
- if (enable_pto_) {
+ if (pto_enabled_) {
return PTO_MODE;
}
if (consecutive_tlp_count_ < max_tail_loss_probes_) {
@@ -1024,7 +1024,7 @@
case LOSS_MODE:
return loss_algorithm_->GetLossTimeout();
case TLP_MODE: {
- DCHECK(!enable_pto_);
+ DCHECK(!pto_enabled_);
// TODO(ianswett): When CWND is available, it would be preferable to
// set the timer based on the earliest retransmittable packet.
// Base the updated timer on the send time of the last packet.
@@ -1034,7 +1034,7 @@
return std::max(clock_->ApproximateNow(), tlp_time);
}
case RTO_MODE: {
- DCHECK(!enable_pto_);
+ DCHECK(!pto_enabled_);
// The RTO is based on the first outstanding packet.
const QuicTime sent_time = unacked_packets_.GetLastPacketSentTime();
QuicTime rto_time = sent_time + GetRetransmissionDelay();
@@ -1141,7 +1141,7 @@
}
const QuicTime::Delta QuicSentPacketManager::GetProbeTimeoutDelay() const {
- DCHECK(enable_pto_);
+ DCHECK(pto_enabled_);
if (rtt_stats_.smoothed_rtt().IsZero()) {
if (rtt_stats_.initial_rtt().IsZero()) {
return QuicTime::Delta::FromSeconds(1);
diff --git a/quic/core/quic_sent_packet_manager.h b/quic/core/quic_sent_packet_manager.h
index ee285e8..c024283 100644
--- a/quic/core/quic_sent_packet_manager.h
+++ b/quic/core/quic_sent_packet_manager.h
@@ -411,7 +411,7 @@
bool fix_rto_retransmission() const { return fix_rto_retransmission_; }
- bool enable_pto() const { return enable_pto_; }
+ bool pto_enabled() const { return pto_enabled_; }
private:
friend class test::QuicConnectionPeer;
@@ -639,8 +639,9 @@
// OnAckRangeStart, and gradually moves in OnAckRange..
PacketNumberQueue::const_reverse_iterator acked_packets_iter_;
- // If true, enable PTO mode which unifies TLP and RTO modes.
- bool enable_pto_;
+ // Indicates whether PTO mode has been enabled. PTO mode unifies TLP and RTO
+ // modes.
+ bool pto_enabled_;
// Maximum number of probes to send when PTO fires.
size_t max_probe_packets_per_pto_;
diff --git a/quic/core/quic_sent_packet_manager_test.cc b/quic/core/quic_sent_packet_manager_test.cc
index 8c2da38..fced1eb 100644
--- a/quic/core/quic_sent_packet_manager_test.cc
+++ b/quic/core/quic_sent_packet_manager_test.cc
@@ -368,7 +368,7 @@
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
EXPECT_CALL(*network_change_visitor_, OnCongestionChange());
manager_.SetFromConfig(config);
- EXPECT_TRUE(manager_.enable_pto());
+ EXPECT_TRUE(manager_.pto_enabled());
}
QuicSentPacketManager manager_;