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

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: Rebased against merged cl. Created 4 years, 10 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 703e9ea6cf0c4c1b6ddb4062db7949499f267a2a..1eb4b443d48458d5304ec30a85a1579e0e31abf4 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -591,6 +591,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),
@@ -640,6 +641,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),
@@ -680,8 +683,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_) {
@@ -1261,7 +1268,7 @@ void QuicStreamFactory::MaybeMigrateOrCloseSessions(
void QuicStreamFactory::MaybeMigrateSessionEarly(
QuicChromiumClientSession* session) {
- if (session->GetNumActiveStreams() == 0) {
+ if (!migrate_sessions_early_ || (session->GetNumActiveStreams() == 0)) {
Ryan Hamilton 2016/02/05 01:32:55 nit: no need for the extra ()s, I don't think. Ac
Jana 2016/02/05 03:03:31 Yeah, I put those for clarity, but maybe it's more
Ryan Hamilton 2016/02/05 17:57:37 I guess I'm confused about the motivations for ear
Jana 2016/02/05 22:24:36 Per our offline conversation, we'll migrate all se
return;
}
NetworkChangeNotifier::NetworkHandle current_network =
Ryan Hamilton 2016/02/05 01:32:55 You might consider "using NetworkChangeNotifier::N
Jana 2016/02/05 03:03:31 Yeah, I wanted that too :-) NetworkHandle is a t
Ryan Hamilton 2016/02/05 17:57:37 Really? f'n C++. What's the error?
Jana 2016/02/05 22:24:36 "using declaration cannot refer to class member".

Powered by Google App Engine
This is Rietveld 408576698