OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/socket/unix_domain_server_socket_posix.h" | 5 #include "net/socket/unix_domain_server_socket_posix.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <sys/socket.h> | 8 #include <sys/socket.h> |
9 #include <sys/un.h> | 9 #include <sys/un.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #endif | 60 #endif |
61 } | 61 } |
62 | 62 |
63 int UnixDomainServerSocket::Listen(const IPEndPoint& address, int backlog) { | 63 int UnixDomainServerSocket::Listen(const IPEndPoint& address, int backlog) { |
64 NOTIMPLEMENTED(); | 64 NOTIMPLEMENTED(); |
65 return ERR_NOT_IMPLEMENTED; | 65 return ERR_NOT_IMPLEMENTED; |
66 } | 66 } |
67 | 67 |
68 int UnixDomainServerSocket::ListenWithAddressAndPort( | 68 int UnixDomainServerSocket::ListenWithAddressAndPort( |
69 const std::string& unix_domain_path, | 69 const std::string& unix_domain_path, |
70 int port_unused, | 70 uint16 port_unused, |
71 int backlog) { | 71 int backlog) { |
72 DCHECK(!listen_socket_); | 72 DCHECK(!listen_socket_); |
73 | 73 |
74 SockaddrStorage address; | 74 SockaddrStorage address; |
75 if (!UnixDomainClientSocket::FillAddress(unix_domain_path, | 75 if (!UnixDomainClientSocket::FillAddress(unix_domain_path, |
76 use_abstract_namespace_, | 76 use_abstract_namespace_, |
77 &address)) { | 77 &address)) { |
78 return ERR_ADDRESS_INVALID; | 78 return ERR_ADDRESS_INVALID; |
79 } | 79 } |
80 | 80 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 !auth_callback_.Run(credentials)) { | 177 !auth_callback_.Run(credentials)) { |
178 accept_socket_.reset(); | 178 accept_socket_.reset(); |
179 return false; | 179 return false; |
180 } | 180 } |
181 | 181 |
182 setter_callback.Run(accept_socket_.Pass()); | 182 setter_callback.Run(accept_socket_.Pass()); |
183 return true; | 183 return true; |
184 } | 184 } |
185 | 185 |
186 } // namespace net | 186 } // namespace net |
OLD | NEW |