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

Unified Diff: net/socket/stream_socket.h

Issue 2447083003: Move fail on suspend logic from URLRequestJob to TcpClientSocket.
Patch Set: Fix connect error case Created 4 years, 2 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/socket/stream_socket.h
diff --git a/net/socket/stream_socket.h b/net/socket/stream_socket.h
index 4ed735af04fd3ce8da1d312960971482003e88d7..99184ed8a1bf5ed9776d26a9d0e74e2f69c7372a 100644
--- a/net/socket/stream_socket.h
+++ b/net/socket/stream_socket.h
@@ -111,6 +111,19 @@ class NET_EXPORT_PRIVATE StreamSocket : public Socket {
// Disconnect() is called.
virtual int64_t GetTotalReceivedBytes() const = 0;
+ // 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).
Bence 2016/10/27 13:04:29 Unmatched ')'.
+ //
+ // 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
« net/dns/host_resolver_impl.cc ('K') | « net/net.gypi ('k') | net/socket/stream_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698