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

Unified Diff: net/quic/quic_stream_factory.h

Issue 1327923002: Migrates QUIC sessions to a new network when old network is (about to be) disconnected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@home
Patch Set: Naming fixes. Created 5 years 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.h
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h
index 644fbc7672759f5b809969401dce63b47389c064..42498d9e33bd750e4c206d3684b4f3acd2842a42 100644
--- a/net/quic/quic_stream_factory.h
+++ b/net/quic/quic_stream_factory.h
@@ -107,6 +107,7 @@ class NET_EXPORT_PRIVATE QuicStreamRequest {
// QuicChromiumClientSessions.
class NET_EXPORT_PRIVATE QuicStreamFactory
: public NetworkChangeNotifier::IPAddressObserver,
+ public NetworkChangeNotifier::NetworkObserver,
public SSLConfigService::Observer,
public CertDatabase::Observer {
public:
@@ -144,6 +145,7 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
bool store_server_configs_in_properties,
bool close_sessions_on_ip_change,
int idle_connection_timeout_seconds,
+ bool migrate_sessions_on_network_change,
const QuicTagVector& connection_options);
~QuicStreamFactory() override;
@@ -200,17 +202,44 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
// Closes all current sessions.
void CloseAllSessions(int error);
+ // Closes all current sessions with specified QUIC error code.
+ void CloseAllSessionsInner(int error, QuicErrorCode quic_error);
+
scoped_ptr<base::Value> QuicStreamFactoryInfoToValue() const;
// Delete all cached state objects in |crypto_config_|.
void ClearCachedStatesInCryptoConfig();
+ // Helper method that configures a DatagramClientSocket. Socket is
+ // bound to the default network if the |network| param is
+ // NetworkChangeNotifier::kInvalidNetworkHandle.
+ // Returns net_error code.
+ int ConfigureDatagramClientSocket(
+ DatagramClientSocket* socket,
+ IPEndPoint addr,
+ NetworkChangeNotifier::NetworkHandle network);
+
+ // Helper method that initiates migration of active sessions away from
+ // |network| if possible, and if not, closes them. Migration is only
+ // attempted on active sessions; idle sessions are closed.
+ void MigrateOrCloseSessions(NetworkChangeNotifier::NetworkHandle);
+
// NetworkChangeNotifier::IPAddressObserver methods:
// Until the servers support roaming, close all connections when the local
// IP address changes.
void OnIPAddressChanged() override;
+ // NetworkChangeNotifier::NetworkObserver methods:
+ void OnNetworkConnected(
+ NetworkChangeNotifier::NetworkHandle network) override;
+ void OnNetworkDisconnected(
+ NetworkChangeNotifier::NetworkHandle network) override;
+ void OnNetworkSoonToDisconnect(
+ NetworkChangeNotifier::NetworkHandle network) override;
+ void OnNetworkMadeDefault(
+ NetworkChangeNotifier::NetworkHandle network) override;
+
// SSLConfigService::Observer methods:
// We perform the same flushing as described above when SSL settings change.
@@ -450,6 +479,10 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
// Set if all sessions should be closed when any local IP address changes.
const bool close_sessions_on_ip_change_;
+ // Set if migration should be attempted on active sessions when primary
+ // interface changes.
+ const bool migrate_sessions_on_network_change_;
+
// Each profile will (probably) have a unique port_seed_ value. This value
// is used to help seed a pseudo-random number generator (PortSuggester) so
// that we consistently (within this profile) suggest the same ephemeral

Powered by Google App Engine
This is Rietveld 408576698