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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 #endif | 61 #endif |
62 } | 62 } |
63 | 63 |
64 int UnixDomainServerSocket::Listen(const IPEndPoint& address, int backlog) { | 64 int UnixDomainServerSocket::Listen(const IPEndPoint& address, int backlog) { |
65 NOTIMPLEMENTED(); | 65 NOTIMPLEMENTED(); |
66 return ERR_NOT_IMPLEMENTED; | 66 return ERR_NOT_IMPLEMENTED; |
67 } | 67 } |
68 | 68 |
69 int UnixDomainServerSocket::ListenWithAddressAndPort( | 69 int UnixDomainServerSocket::ListenWithAddressAndPort( |
70 const std::string& unix_domain_path, | 70 const std::string& unix_domain_path, |
71 uint16 port_unused, | 71 uint16_t port_unused, |
72 int backlog) { | 72 int backlog) { |
73 DCHECK(!listen_socket_); | 73 DCHECK(!listen_socket_); |
74 | 74 |
75 SockaddrStorage address; | 75 SockaddrStorage address; |
76 if (!UnixDomainClientSocket::FillAddress(unix_domain_path, | 76 if (!UnixDomainClientSocket::FillAddress(unix_domain_path, |
77 use_abstract_namespace_, | 77 use_abstract_namespace_, |
78 &address)) { | 78 &address)) { |
79 return ERR_ADDRESS_INVALID; | 79 return ERR_ADDRESS_INVALID; |
80 } | 80 } |
81 | 81 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 !auth_callback_.Run(credentials)) { | 181 !auth_callback_.Run(credentials)) { |
182 accept_socket_.reset(); | 182 accept_socket_.reset(); |
183 return false; | 183 return false; |
184 } | 184 } |
185 | 185 |
186 setter_callback.Run(accept_socket_.Pass()); | 186 setter_callback.Run(accept_socket_.Pass()); |
187 return true; | 187 return true; |
188 } | 188 } |
189 | 189 |
190 } // namespace net | 190 } // namespace net |
OLD | NEW |