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

Unified Diff: net/socket/stream_socket.h

Issue 2447083003: Move fail on suspend logic from URLRequestJob to TcpClientSocket.
Patch Set: . Created 3 years, 6 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/ftp/ftp_network_transaction.cc ('k') | net/socket/stream_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/stream_socket.h
diff --git a/net/socket/stream_socket.h b/net/socket/stream_socket.h
index cb979b63414114147f6f897f0f86900f8a817a5d..c7dbc8231b62d13f232eb16d001ed86e9e413c20 100644
--- a/net/socket/stream_socket.h
+++ b/net/socket/stream_socket.h
@@ -134,6 +134,19 @@ class NET_EXPORT_PRIVATE StreamSocket : public Socket {
// |stats|. Default implementation does nothing.
virtual void DumpMemoryStats(SocketMemoryStats* stats) const {}
+ // Sets whether the socket should treat entering suspend mode as an error, and
+ // return ERR_NETWORK_SUSPENDED if it happens. Defaults to false.
+ //
+ // This is useful because entering suspend mode tends to kill all sockets
+ // connected to remote systems. See https://crbug.com/4606).
+ //
+ // This is a hint only, subclasses are free to ignore this flag (And currently
+ // do - it's only respected when set directly on a TcpClientSocket).
+ //
+ // TODO(mmenke): Should this be done on all TCP sockets? On all non-localhost
+ // TCP sockets?
+ virtual void SetFailOnSuspend(bool disconnect_on_suspend);
+
protected:
// The following class is only used to gather statistics about the history of
// a socket. It is only instantiated and used in basic sockets, such as
« no previous file with comments | « net/ftp/ftp_network_transaction.cc ('k') | net/socket/stream_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698