Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(688)

Unified Diff: net/socket/unix_domain_server_socket_posix.h

Issue 382143005: Supports DevTools socket access authentication based on Android permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Packing parameters to a stucture Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698