Index: net/quic/quic_server_session.cc |
diff --git a/net/quic/quic_server_session.cc b/net/quic/quic_server_session.cc |
index 1d48182af2a9061146b8ae15da5a93daa501675a..e0defd680efb35a5b3c736e9e80974434a249665 100644 |
--- a/net/quic/quic_server_session.cc |
+++ b/net/quic/quic_server_session.cc |
@@ -37,14 +37,29 @@ QuicCryptoServerStream* QuicServerSession::CreateQuicCryptoServerStream( |
void QuicServerSession::OnConfigNegotiated() { |
QuicSession::OnConfigNegotiated(); |
- if (!FLAGS_enable_quic_fec || |
- !config()->HasReceivedConnectionOptions() || |
- !ContainsQuicTag(config()->ReceivedConnectionOptions(), kFHDR)) { |
+ |
+ if (!config()->HasReceivedConnectionOptions()) { |
return; |
} |
- // kFHDR config maps to FEC protection always for headers stream. |
- // TODO(jri): Add crypto stream in addition to headers for kHDR. |
- headers_stream_->set_fec_policy(FEC_PROTECT_ALWAYS); |
+ |
+ // If the client has provided a bandwidth estimate from the same serving |
+ // region, then pass it to the sent packet manager in preparation for possible |
+ // bandwidth resumption. |
+ const CachedNetworkParameters* cached_network_params = |
+ crypto_stream_->previous_cached_network_params(); |
+ if (FLAGS_quic_enable_bandwidth_resumption_experiment && |
+ cached_network_params != nullptr && |
+ ContainsQuicTag(config()->ReceivedConnectionOptions(), kBWRE) && |
+ cached_network_params->serving_region() == serving_region_) { |
+ connection()->ResumeConnectionState(*cached_network_params); |
+ } |
+ |
+ if (FLAGS_enable_quic_fec && |
+ ContainsQuicTag(config()->ReceivedConnectionOptions(), kFHDR)) { |
+ // kFHDR config maps to FEC protection always for headers stream. |
+ // TODO(jri): Add crypto stream in addition to headers for kHDR. |
+ headers_stream_->set_fec_policy(FEC_PROTECT_ALWAYS); |
+ } |
} |
void QuicServerSession::OnConnectionClosed(QuicErrorCode error, |