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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 1613513003: Early connection migration in QUIC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Typo fixed. Created 4 years, 11 months 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
Index: net/quic/quic_stream_factory.cc
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 76605a53e81ff5137fc97d9fb54699712f06335d..4e13167b35d39cab20151f7322092d2ef8a79790 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -585,6 +585,7 @@ QuicStreamFactory::QuicStreamFactory(
bool disable_quic_on_timeout_with_open_streams,
int idle_connection_timeout_seconds,
bool migrate_sessions_on_network_change,
+ bool migrate_sessions_early,
const QuicTagVector& connection_options)
: require_confirmation_(true),
host_resolver_(host_resolver),
@@ -634,6 +635,8 @@ QuicStreamFactory::QuicStreamFactory(
migrate_sessions_on_network_change_(
migrate_sessions_on_network_change &&
NetworkChangeNotifier::AreNetworkHandlesSupported()),
+ migrate_sessions_early_(migrate_sessions_early &&
+ migrate_sessions_on_network_change_),
port_seed_(random_generator_->RandUint64()),
check_persisted_supports_quic_(true),
has_initialized_data_(false),
@@ -674,8 +677,12 @@ QuicStreamFactory::QuicStreamFactory(
new PropertiesBasedQuicServerInfoFactory(http_server_properties_));
}
- DCHECK(
- !(close_sessions_on_ip_change_ && migrate_sessions_on_network_change_));
+ // migrate_sessions_early_ should only be set to true if
+ // migrate_sessions_on_network_change_ is set to true.
+ DCHECK(migrate_sessions_on_network_change_ || !migrate_sessions_early_);
+ // close_sessions_on_ip_change_ and migrate_sessions_on_network_change_ should
+ // never be simultaneously set to true.
+ DCHECK(!close_sessions_on_ip_change_ || !migrate_sessions_on_network_change_);
if (migrate_sessions_on_network_change_) {
NetworkChangeNotifier::AddNetworkObserver(this);
} else if (close_sessions_on_ip_change_) {
@@ -1254,7 +1261,7 @@ void QuicStreamFactory::MaybeMigrateOrCloseSessions(
void QuicStreamFactory::MaybeMigrateSessionEarly(
QuicChromiumClientSession* session) {
- if (session->GetNumActiveStreams() == 0) {
+ if (!migrate_sessions_early_ || (session->GetNumActiveStreams() == 0)) {
return;
}
NetworkChangeNotifier::NetworkHandle current_network =

Powered by Google App Engine
This is Rietveld 408576698