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..f480dc6861d33c57a6a8edb149d827c5e0708967 100644 |
| --- a/net/socket/unix_domain_server_socket_posix.h |
| +++ b/net/socket/unix_domain_server_socket_posix.h |
| @@ -25,20 +25,20 @@ class SocketLibevent; |
| // Linux and Android. |
| class NET_EXPORT UnixDomainServerSocket : public ServerSocket { |
| public: |
| + struct Credentials; |
| + |
| // 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. |
| + // Gets credentials of peer to check permissions. |
| static bool GetPeerIds(SocketDescriptor socket_fd, |
|
byungchul
2014/08/04 22:18:02
GetCredentials
SeRya
2014/08/05 10:32:27
Renamed to GetPeerCredentials
|
| - uid_t* user_id, |
| - gid_t* group_id); |
| + Credentials* credentials); |
| // ServerSocket implementation. |
| virtual int Listen(const IPEndPoint& address, int backlog) OVERRIDE; |
| @@ -64,6 +64,14 @@ class NET_EXPORT UnixDomainServerSocket : public ServerSocket { |
| DISALLOW_COPY_AND_ASSIGN(UnixDomainServerSocket); |
| }; |
| +struct UnixDomainServerSocket::Credentials { |
|
mmenke
2014/08/04 20:22:57
In net/, at least, public inner classes and struct
byungchul
2014/08/04 22:18:02
need NET_EXPORT
SeRya
2014/08/05 10:32:27
Moved inside.
SeRya
2014/08/05 10:32:27
Done.
|
| +#if defined(OS_LINUX) || defined(OS_ANDROID) |
| + pid_t process_id; |
|
mmenke
2014/08/04 20:22:57
Think this is worth a comment (Code is pretty self
SeRya
2014/08/05 10:32:27
Done.
|
| +#endif |
| + uid_t user_id; |
| + gid_t group_id; |
| +}; |
| + |
| } // namespace net |
| #endif // NET_SOCKET_UNIX_DOMAIN_SOCKET_POSIX_H_ |