Chromium Code Reviews| Index: net/socket/unix_domain_server_socket_posix.h |
| diff --git a/net/socket/unix_domain_server_socket_posix.h b/net/socket/unix_domain_server_socket_posix.h |
| index 06fb8d32c47bc4b0e700fa70f51d3f2ab80aa36d..4a9824bed17871612237d020af30b0e539c2690f 100644 |
| --- a/net/socket/unix_domain_server_socket_posix.h |
| +++ b/net/socket/unix_domain_server_socket_posix.h |
| @@ -25,20 +25,27 @@ class SocketLibevent; |
| // Linux and Android. |
| class NET_EXPORT UnixDomainServerSocket : public ServerSocket { |
| public: |
| + // Credentials of a peer process connected to the socket. |
| + struct NET_EXPORT Credentials { |
| +#if defined(OS_LINUX) || defined(OS_ANDROID) |
|
mmenke
2014/08/07 22:44:18
Sorry, was thinking about a comment specifically a
SeRya
2014/08/08 07:42:20
Done.
|
| + pid_t process_id; |
| +#endif |
| + uid_t user_id; |
| + gid_t group_id; |
| + }; |
| + |
| // Callback that returns whether the already connected client, identified by |
| - // its process |user_id| and |group_id|, is allowed to keep the connection |
| - // open. Note that the socket is closed immediately in case the callback |
| - // returns false. |
| - typedef base::Callback<bool (uid_t user_id, gid_t group_id)> AuthCallback; |
| + // its credentials, is allowed to keep the connection open. Note that |
| + // the socket is closed immediately in case the callback returns false. |
| + typedef base::Callback<bool (const Credentials&)> AuthCallback; |
| UnixDomainServerSocket(const AuthCallback& auth_callack, |
| bool use_abstract_namespace); |
| virtual ~UnixDomainServerSocket(); |
| - // Gets UID and GID of peer to check permissions. |
| - static bool GetPeerIds(SocketDescriptor socket_fd, |
| - uid_t* user_id, |
| - gid_t* group_id); |
| + // Gets credentials of peer to check permissions. |
| + static bool GetPeerCredentials(SocketDescriptor socket_fd, |
| + Credentials* credentials); |
| // ServerSocket implementation. |
| virtual int Listen(const IPEndPoint& address, int backlog) OVERRIDE; |