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

Unified Diff: mojo/services/network/tcp_connected_socket_impl.h

Issue 1015733002: Close data pipes when TCP network connection goes down. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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: mojo/services/network/tcp_connected_socket_impl.h
diff --git a/mojo/services/network/tcp_connected_socket_impl.h b/mojo/services/network/tcp_connected_socket_impl.h
index 0eb95e26c7f5d7ce1748badef45822975ceb17f7..10c0c523ef54be54172bc94252c4b34bfb7b8306 100644
--- a/mojo/services/network/tcp_connected_socket_impl.h
+++ b/mojo/services/network/tcp_connected_socket_impl.h
@@ -25,17 +25,27 @@ class TCPConnectedSocketImpl : public InterfaceImpl<TCPConnectedSocket> {
~TCPConnectedSocketImpl() override;
private:
+ enum Direction {
+ SEND,
+ RECEIVE,
+ };
+
// "Receiving" in this context means reading from TCPSocket and writing to
// the Mojo receive_stream.
void ReceiveMore();
void OnReceiveStreamReady(MojoResult result);
void DidReceive(bool completed_synchronously, int result);
+ void ShutdownReceive();
// "Writing" is reading from the Mojo send_stream and writing to the
// TCPSocket.
void SendMore();
void OnSendStreamReady(MojoResult result);
void DidSend(bool completed_asynchronously, int result);
+ void ShutdownSend();
+
+ // Notify that socket direction has been closed.
+ void NotifyClose(Direction direction, int net_result, MojoResult mojo_result);
scoped_ptr<net::TCPSocket> socket_;
« AUTHORS ('K') | « AUTHORS ('k') | mojo/services/network/tcp_connected_socket_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698