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

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

Issue 657113002: Add basic TCP socket mojo implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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: mojo/services/network/tcp_bound_socket_impl.h
diff --git a/mojo/services/network/tcp_bound_socket_impl.h b/mojo/services/network/tcp_bound_socket_impl.h
index 5fb1bf30ea4d93a4004a8f0cd647d360b9da31a6..39a78f641164be872d30c44d31c855bc106b2f5d 100644
--- a/mojo/services/network/tcp_bound_socket_impl.h
+++ b/mojo/services/network/tcp_bound_socket_impl.h
@@ -17,6 +17,9 @@ class TCPBoundSocketImpl : public InterfaceImpl<TCPBoundSocket> {
TCPBoundSocketImpl();
virtual ~TCPBoundSocketImpl();
+ // Does the actual binding. Returns a net error code. On net::OK, the bound
+ // socket will be ready to use and send back to the client. On failure, this
+ // object should be destroyed and no longer used.
int Bind(NetAddressPtr local_address);
// Returns the local address associated with this socket. This should only
@@ -35,7 +38,15 @@ class TCPBoundSocketImpl : public InterfaceImpl<TCPBoundSocket> {
const Callback<void(NetworkErrorPtr)>& callback) override;
private:
+ void OnConnected(int result);
+
scoped_ptr<net::TCPSocket> socket_;
+
+ // Valid when waiting for a connect callback.
+ ScopedDataPipeConsumerHandle pending_connect_send_stream_;
+ ScopedDataPipeProducerHandle pending_connect_receive_stream_;
+ InterfaceRequest<TCPConnectedSocket> pending_connect_socket_;
+ Callback<void(NetworkErrorPtr)> pending_connect_callback_;
};
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698