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

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: Style nit 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 b8639142c234fe3a2e818b6eecc86a16a11cd80c..47f7b0b92ce35732f04f50d5c0fb00a715e3a3e2 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -571,6 +571,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),
@@ -620,6 +621,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),
@@ -660,8 +663,8 @@ QuicStreamFactory::QuicStreamFactory(
new PropertiesBasedQuicServerInfoFactory(http_server_properties_));
}
- DCHECK(
- !(close_sessions_on_ip_change_ && migrate_sessions_on_network_change_));
+ DCHECK(!close_sessions_on_ip_change_ || !migrate_sessions_on_network_change_);
+ DCHECK(migrate_sessions_on_network_change_ || !migrate_sessions_early_);
Ryan Hamilton 2016/02/02 04:19:59 Can you add comments for these two blocks? These e
Jana 2016/02/02 06:53:53 Done.
if (migrate_sessions_on_network_change_) {
NetworkChangeNotifier::AddNetworkObserver(this);
} else if (close_sessions_on_ip_change_) {
@@ -1240,7 +1243,7 @@ void QuicStreamFactory::MaybeMigrateOrCloseSessions(
void QuicStreamFactory::MaybeMigrateSessionEarly(
Ryan Hamilton 2016/02/02 04:19:59 Was this landed post-review, or did I miss it in t
Jana 2016/02/02 06:53:53 This got added post-LGTM, and I am pretty sure it
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