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

Unified Diff: net/tools/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/tools/quic/quic_client_session_test.cc ('k') | net/tools/quic/quic_server_session_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_server_session.cc
diff --git a/net/tools/quic/quic_server_session.cc b/net/tools/quic/quic_server_session.cc
index 45c1379c4ae20650f2321152c50a962e2cf83b1f..9db23659601c3202bcb76c75dc9c5c6ea90f44df 100644
--- a/net/tools/quic/quic_server_session.cc
+++ b/net/tools/quic/quic_server_session.cc
@@ -38,14 +38,29 @@ QuicCryptoServerStream* QuicServerSession::CreateQuicCryptoServerStream(
void QuicServerSession::OnConfigNegotiated() {
QuicSession::OnConfigNegotiated();
- if (!FLAGS_enable_quic_fec ||
- !config()->HasReceivedConnectionOptions() ||
- !net::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/tools/quic/quic_client_session_test.cc ('k') | net/tools/quic/quic_server_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698