Remove QuicNegotiableValue
This CL reimplements QUIC idle timeout negotiation without QuicNegotiableValue, and removes QuicNegotiableValue. QuicNegotiableValue is considered overly complex and hard to understand and use correctly, and has caused bugs in the past. Idle timeout was the only user of it, so reusing QuicFixedUint32 and bespoke handling was the simplest option. The wire format for idle timeout is unchanged by this CL: it's still encoded as a 32bit integer in seconds for QUIC_CRYPTO and a 62bit integer in milliseconds for QUIC+TLS. Therefore this CL does not change any behavior.
gfe-relnote: refactor idle timeout, no behavior change, not flag protected
Startblock:
after 2020-05-05 09:00 in US/Pacific
PiperOrigin-RevId: 309988666
Change-Id: I67ae7caad8ec73c05e27c8e49d940a2393d4b2df
diff --git a/quic/core/quic_connection_test.cc b/quic/core/quic_connection_test.cc
index 8b6f752..613358a 100644
--- a/quic/core/quic_connection_test.cc
+++ b/quic/core/quic_connection_test.cc
@@ -4251,8 +4251,7 @@
QuicTagVector options;
options.push_back(kTLPR);
config.SetConnectionOptionsToSend(options);
- QuicConfigPeer::ReceiveIdleNetworkTimeout(
- &config, SERVER, QuicTime::Delta::FromSeconds(kMaximumIdleTimeoutSecs));
+ QuicConfigPeer::SetNegotiated(&config, true);
connection_.SetFromConfig(config);
connection_.SetMaxTailLossProbes(1);
@@ -6099,8 +6098,7 @@
QuicTagVector connection_options;
connection_options.push_back(k5RTO);
config.SetConnectionOptionsToSend(connection_options);
- QuicConfigPeer::ReceiveIdleNetworkTimeout(
- &config, SERVER, QuicTime::Delta::FromSeconds(kMaximumIdleTimeoutSecs));
+ QuicConfigPeer::SetNegotiated(&config, true);
connection_.SetFromConfig(config);
// Send stream data.
@@ -9871,8 +9869,7 @@
connection_options.push_back(k1PTO);
connection_options.push_back(k6PTO);
config.SetConnectionOptionsToSend(connection_options);
- QuicConfigPeer::ReceiveIdleNetworkTimeout(
- &config, SERVER, QuicTime::Delta::FromSeconds(kMaximumIdleTimeoutSecs));
+ QuicConfigPeer::SetNegotiated(&config, true);
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
connection_.SetFromConfig(config);
EXPECT_FALSE(connection_.GetRetransmissionAlarm()->IsSet());
@@ -9919,8 +9916,7 @@
connection_options.push_back(k2PTO);
connection_options.push_back(k7PTO);
config.SetConnectionOptionsToSend(connection_options);
- QuicConfigPeer::ReceiveIdleNetworkTimeout(
- &config, SERVER, QuicTime::Delta::FromSeconds(kMaximumIdleTimeoutSecs));
+ QuicConfigPeer::SetNegotiated(&config, true);
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
connection_.SetFromConfig(config);
EXPECT_FALSE(connection_.GetRetransmissionAlarm()->IsSet());
@@ -9965,8 +9961,7 @@
QuicTagVector connection_options;
connection_options.push_back(k2PTO);
connection_options.push_back(k8PTO);
- QuicConfigPeer::ReceiveIdleNetworkTimeout(
- &config, SERVER, QuicTime::Delta::FromSeconds(kMaximumIdleTimeoutSecs));
+ QuicConfigPeer::SetNegotiated(&config, true);
config.SetConnectionOptionsToSend(connection_options);
EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
connection_.SetFromConfig(config);