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

Unified Diff: net/socket/tcp_server_socket.cc

Issue 2815993002: Adds a method to TCPServerSocket to adopt a socket. (Closed)
Patch Set: Refined GetSocketDescriptor per review. 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 | « net/socket/tcp_server_socket.h ('k') | net/socket/tcp_socket_posix.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/socket/tcp_server_socket.cc
diff --git a/net/socket/tcp_server_socket.cc b/net/socket/tcp_server_socket.cc
index 22211cd9496626e62c194ebf0ea82391ca5e3cb1..779a24d16cebf5108e864eb7994fd33e5ef3a5c8 100644
--- a/net/socket/tcp_server_socket.cc
+++ b/net/socket/tcp_server_socket.cc
@@ -10,6 +10,7 @@
#include "base/bind_helpers.h"
#include "base/logging.h"
#include "net/base/net_errors.h"
+#include "net/socket/socket_descriptor.h"
#include "net/socket/tcp_client_socket.h"
namespace net {
@@ -17,6 +18,10 @@ namespace net {
TCPServerSocket::TCPServerSocket(NetLog* net_log, const NetLogSource& source)
: socket_(nullptr, net_log, source), pending_accept_(false) {}
+int TCPServerSocket::AdoptSocket(SocketDescriptor socket) {
+ return socket_.AdoptUnconnectedSocket(socket);
+}
+
TCPServerSocket::~TCPServerSocket() {
}
« no previous file with comments | « net/socket/tcp_server_socket.h ('k') | net/socket/tcp_socket_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698