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 #ifndef NET_SOCKET_UNIX_DOMAIN_SERVER_SOCKET_POSIX_H_ | 5 #ifndef NET_SOCKET_UNIX_DOMAIN_SERVER_SOCKET_POSIX_H_ |
6 #define NET_SOCKET_UNIX_DOMAIN_SERVER_SOCKET_POSIX_H_ | 6 #define NET_SOCKET_UNIX_DOMAIN_SERVER_SOCKET_POSIX_H_ |
7 | 7 |
| 8 #include <stdint.h> |
8 #include <sys/types.h> | 9 #include <sys/types.h> |
9 | 10 |
10 #include <string> | 11 #include <string> |
11 | 12 |
12 #include "base/basictypes.h" | |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "net/base/net_export.h" | 16 #include "net/base/net_export.h" |
17 #include "net/socket/server_socket.h" | 17 #include "net/socket/server_socket.h" |
18 #include "net/socket/socket_descriptor.h" | 18 #include "net/socket/socket_descriptor.h" |
19 | 19 |
20 namespace net { | 20 namespace net { |
21 | 21 |
22 class SocketPosix; | 22 class SocketPosix; |
(...skipping 23 matching lines...) Expand all Loading... |
46 bool use_abstract_namespace); | 46 bool use_abstract_namespace); |
47 ~UnixDomainServerSocket() override; | 47 ~UnixDomainServerSocket() override; |
48 | 48 |
49 // Gets credentials of peer to check permissions. | 49 // Gets credentials of peer to check permissions. |
50 static bool GetPeerCredentials(SocketDescriptor socket_fd, | 50 static bool GetPeerCredentials(SocketDescriptor socket_fd, |
51 Credentials* credentials); | 51 Credentials* credentials); |
52 | 52 |
53 // ServerSocket implementation. | 53 // ServerSocket implementation. |
54 int Listen(const IPEndPoint& address, int backlog) override; | 54 int Listen(const IPEndPoint& address, int backlog) override; |
55 int ListenWithAddressAndPort(const std::string& unix_domain_path, | 55 int ListenWithAddressAndPort(const std::string& unix_domain_path, |
56 uint16 port_unused, | 56 uint16_t port_unused, |
57 int backlog) override; | 57 int backlog) override; |
58 int GetLocalAddress(IPEndPoint* address) const override; | 58 int GetLocalAddress(IPEndPoint* address) const override; |
59 int Accept(scoped_ptr<StreamSocket>* socket, | 59 int Accept(scoped_ptr<StreamSocket>* socket, |
60 const CompletionCallback& callback) override; | 60 const CompletionCallback& callback) override; |
61 | 61 |
62 // Accepts an incoming connection on |listen_socket_|, but passes back | 62 // Accepts an incoming connection on |listen_socket_|, but passes back |
63 // a raw SocketDescriptor instead of a StreamSocket. | 63 // a raw SocketDescriptor instead of a StreamSocket. |
64 int AcceptSocketDescriptor(SocketDescriptor* socket_descriptor, | 64 int AcceptSocketDescriptor(SocketDescriptor* socket_descriptor, |
65 const CompletionCallback& callback); | 65 const CompletionCallback& callback); |
66 | 66 |
(...skipping 15 matching lines...) Expand all Loading... |
82 const bool use_abstract_namespace_; | 82 const bool use_abstract_namespace_; |
83 | 83 |
84 scoped_ptr<SocketPosix> accept_socket_; | 84 scoped_ptr<SocketPosix> accept_socket_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(UnixDomainServerSocket); | 86 DISALLOW_COPY_AND_ASSIGN(UnixDomainServerSocket); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace net | 89 } // namespace net |
90 | 90 |
91 #endif // NET_SOCKET_UNIX_DOMAIN_SOCKET_POSIX_H_ | 91 #endif // NET_SOCKET_UNIX_DOMAIN_SOCKET_POSIX_H_ |
OLD | NEW |