Chromium Code Reviews| Index: net/socket/socket_posix.h |
| diff --git a/net/socket/socket_posix.h b/net/socket/socket_posix.h |
| index 65a692e27de69604bef955deaea19ffa39efa01e..788a2d41dc22a8251aab52ee2c59c78465c75492 100644 |
| --- a/net/socket/socket_posix.h |
| +++ b/net/socket/socket_posix.h |
| @@ -31,9 +31,16 @@ class NET_EXPORT_PRIVATE SocketPosix : public base::MessageLoopForIO::Watcher { |
| // Opens a socket and returns net::OK if |address_family| is AF_INET, AF_INET6 |
| // or AF_UNIX. Otherwise, it does DCHECK() and returns a net error. |
| int Open(int address_family); |
| - // Takes ownership of |socket|. |
| + |
| + // Takes ownership of |socket|, which is known to already be connected to the |
| + // given peer address. |
| int AdoptConnectedSocket(SocketDescriptor socket, |
| const SockaddrStorage& peer_address); |
| + // Takes ownership of |socket|, which may or may not be open, bound, or |
| + // listening. The caller must determine the state of the socket based on its |
|
mmenke
2017/04/21 19:20:38
Since it may be open (Or may not), maybe just call
Raul Vera
2017/05/01 05:35:25
But that loses the symmetry with AdoptConnectedSoc
|
| + // provenance and act accordingly. |
| + int AdoptUnconnectedSocket(SocketDescriptor socket); |
| + |
| // Releases ownership of |socket_fd_| to caller. |
| SocketDescriptor ReleaseConnectedSocket(); |