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

Unified Diff: net/quic/quic_server_session.cc

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « net/quic/quic_sent_packet_manager_test.cc ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « net/quic/quic_sent_packet_manager_test.cc ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698