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

Unified Diff: net/quic/chromium/quic_stream_factory.h

Issue 2319343004: Makes migration on write error asynchronous to avoid reentrancy issues (Closed)
Patch Set: synced and rebased Created 4 years, 3 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
« no previous file with comments | « net/quic/chromium/quic_chromium_packet_writer.cc ('k') | net/quic/chromium/quic_stream_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9bf67338f8c8e4b9c778c957a41ea38a116e59d4 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,
- NetworkChangeNotifier::NetworkHandle network,
- bool close_session_on_error,
- const BoundNetLog& bound_net_log,
- scoped_refptr<StringIOBuffer> packet);
+ // kInvalidNetworkHandle, default network is used.
+ MigrationResult MigrateSessionToNewNetwork(
+ QuicChromiumClientSession* session,
+ NetworkChangeNotifier::NetworkHandle network,
+ bool close_session_on_error,
+ const BoundNetLog& bound_net_log);
// Migrates |session| over to using |peer_address|. Causes a PING frame
// to be sent to the new peer address.
@@ -383,6 +386,10 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
bool delay_tcp_race() const { return delay_tcp_race_; }
+ bool migrate_sessions_on_network_change() const {
+ return migrate_sessions_on_network_change_;
+ }
+
private:
class Job;
class CertVerifierJob;
@@ -480,15 +487,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.
+ MigrationResult 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_;
« no previous file with comments | « net/quic/chromium/quic_chromium_packet_writer.cc ('k') | net/quic/chromium/quic_stream_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698