Index: net/quic/chromium/quic_stream_factory.h |
diff --git a/net/quic/chromium/quic_stream_factory.h b/net/quic/chromium/quic_stream_factory.h |
index c955bcae0ed1fe42c81d91b9f8c3cb6278e821c0..12d926f2d4504ce6a3cf29aa2fe97be8df216603 100644 |
--- a/net/quic/chromium/quic_stream_factory.h |
+++ b/net/quic/chromium/quic_stream_factory.h |
@@ -73,6 +73,13 @@ enum MigrationCause { |
WRITE_ERROR // Migration due to socket write error. |
}; |
+// Result of a session migration attempt. |
+enum class MigrationResult { |
+ SUCCESS, // Migration succeeded. |
+ NO_NEW_NETWORK, // Migration failed since no new network was found. |
+ FAILURE // Migration failed for other reasons. |
+}; |
+ |
// Encapsulates a pending request for a QuicHttpStream. |
// If the request is still pending when it is destroyed, it will |
// cancel the request with the factory. |
@@ -303,21 +310,17 @@ class NET_EXPORT_PRIVATE QuicStreamFactory |
// Method that initiates migration of |session| if |session| is |
// active and if there is an alternate network than the one to which |
- // |session| is currently bound. If not null, |packet| is sent on |
- // the new network, else a PING frame is sent. |
- void MaybeMigrateSingleSession(QuicChromiumClientSession* session, |
- MigrationCause migration_cause, |
- scoped_refptr<StringIOBuffer> packet); |
+ // |session| is currently bound. |
+ MigrationResult MaybeMigrateSingleSession(QuicChromiumClientSession* session, |
+ MigrationCause migration_cause); |
// Migrates |session| over to using |network|. If |network| is |
- // kInvalidNetworkHandle, default network is used. If |packet| is |
- // not null, it is sent on the new network, else a PING frame is |
- // sent. |
- void MigrateSessionToNewNetwork(QuicChromiumClientSession* session, |
+ // kInvalidNetworkHandle, default network is used. Returns true if migration |
+ // succeeds. |
+ bool MigrateSessionToNewNetwork(QuicChromiumClientSession* session, |
NetworkChangeNotifier::NetworkHandle network, |
bool close_session_on_error, |
- const BoundNetLog& bound_net_log, |
- scoped_refptr<StringIOBuffer> packet); |
+ const BoundNetLog& bound_net_log); |
// Migrates |session| over to using |peer_address|. Causes a PING frame |
// to be sent to the new peer address. |
@@ -480,15 +483,15 @@ class NET_EXPORT_PRIVATE QuicStreamFactory |
void MaybeDisableQuic(uint16_t port); |
// Internal method that migrates |session| over to using |
- // |peer_address| and |network|. If |network| is kInvalidNetworkHandle, |
- // default network is used. If |packet| is not null, it is sent |
- // on the new network, else a PING frame is sent. |
- void MigrateSession(QuicChromiumClientSession* session, |
- IPEndPoint peer_address, |
- NetworkChangeNotifier::NetworkHandle network, |
- bool close_session_on_error, |
- const BoundNetLog& bound_net_log, |
- scoped_refptr<StringIOBuffer> packet); |
+ // |peer_address| and |network|. If |network| is |
+ // kInvalidNetworkHandle, default network is used. If the migration |
+ // fails and |close_session_on_error| is true, connection is |
+ // closed. Returns true if migration succeeds. |
+ bool MigrateSessionInner(QuicChromiumClientSession* session, |
+ IPEndPoint peer_address, |
+ NetworkChangeNotifier::NetworkHandle network, |
+ bool close_session_on_error, |
+ const BoundNetLog& bound_net_log); |
bool require_confirmation_; |
NetLog* net_log_; |