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

Unified Diff: net/socket/tcp_server_socket.h

Issue 2815993002: Adds a method to TCPServerSocket to adopt a socket. (Closed)
Patch Set: Fixed (I hope) Windows compile failure. Created 3 years, 8 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 | « no previous file | net/socket/tcp_server_socket.cc » ('j') | net/socket/tcp_server_socket.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_server_socket.h
diff --git a/net/socket/tcp_server_socket.h b/net/socket/tcp_server_socket.h
index 3b4a9616ede4bdbe921ab63f7f5a627ec70b1231..fe6cbfc382574ae013c5b148e68f6f15d138b14b 100644
--- a/net/socket/tcp_server_socket.h
+++ b/net/socket/tcp_server_socket.h
@@ -24,6 +24,17 @@ class NET_EXPORT TCPServerSocket : public ServerSocket {
TCPServerSocket(NetLog* net_log, const NetLogSource& source);
~TCPServerSocket() override;
+#if defined(OS_POSIX)
+ // Takes ownership of |socket_fd|, which is assumed to be already open, bound
+ // and listening, potentially with a connection already waiting to be
+ // accepted. This is used by headless chrome to allow a parent process to open
+ // a port and listen on it, pass it to Chrome on launch to use as the devtools
+ // remote debugging port, then connect to it immediately and block on the
+ // first read rather than having to poll for the connection. See
+ // crbug.com/624837.
+ int AdopListeningRawSocket(int socket_fd);
Jana 2017/04/17 17:27:57 Use "Adopt" instead of "Adop".
Raul Vera 2017/04/17 23:51:57 Oops. Thanks. Done.
+#endif
mmenke 2017/04/17 17:42:18 Why do we need a POSIX-only method? net/ is suppo
Raul Vera 2017/04/17 23:51:57 Because Windows does not inherit sockets the same
mmenke 2017/04/18 16:15:24 I don't think this is relevant to code in net/, wh
+
// net::ServerSocket implementation.
int Listen(const IPEndPoint& address, int backlog) override;
int GetLocalAddress(IPEndPoint* address) const override;
« no previous file with comments | « no previous file | net/socket/tcp_server_socket.cc » ('j') | net/socket/tcp_server_socket.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698