OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SOCKET_POSIX_H_ | 5 #ifndef NET_SOCKET_UNIX_DOMAIN_SOCKET_POSIX_H_ |
6 #define NET_SOCKET_UNIX_DOMAIN_SOCKET_POSIX_H_ | 6 #define NET_SOCKET_UNIX_DOMAIN_SOCKET_POSIX_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // Unix Domain Socket Implementation. Supports abstract namespaces on Linux. | 25 // Unix Domain Socket Implementation. Supports abstract namespaces on Linux. |
26 class NET_EXPORT UnixDomainSocket : public StreamListenSocket { | 26 class NET_EXPORT UnixDomainSocket : public StreamListenSocket { |
27 public: | 27 public: |
28 virtual ~UnixDomainSocket(); | 28 virtual ~UnixDomainSocket(); |
29 | 29 |
30 // Callback that returns whether the already connected client, identified by | 30 // Callback that returns whether the already connected client, identified by |
31 // its process |user_id| and |group_id|, is allowed to keep the connection | 31 // its process |user_id| and |group_id|, is allowed to keep the connection |
32 // open. Note that the socket is closed immediately in case the callback | 32 // open. Note that the socket is closed immediately in case the callback |
33 // returns false. | 33 // returns false. |
34 typedef base::Callback<bool (uid_t user_id, gid_t group_id)> AuthCallback; | 34 typedef base::Callback<bool(uid_t user_id, gid_t group_id)> AuthCallback; |
35 | 35 |
36 // Returns an authentication callback that always grants access for | 36 // Returns an authentication callback that always grants access for |
37 // convenience in case you don't want to use authentication. | 37 // convenience in case you don't want to use authentication. |
38 static AuthCallback NoAuthentication(); | 38 static AuthCallback NoAuthentication(); |
39 | 39 |
40 // Note that the returned UnixDomainSocket instance does not take ownership of | 40 // Note that the returned UnixDomainSocket instance does not take ownership of |
41 // |del|. | 41 // |del|. |
42 static scoped_ptr<UnixDomainSocket> CreateAndListen( | 42 static scoped_ptr<UnixDomainSocket> CreateAndListen( |
43 const std::string& path, | 43 const std::string& path, |
44 StreamListenSocket::Delegate* del, | 44 StreamListenSocket::Delegate* del, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 private: | 117 private: |
118 std::string fallback_path_; | 118 std::string fallback_path_; |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(UnixDomainSocketWithAbstractNamespaceFactory); | 120 DISALLOW_COPY_AND_ASSIGN(UnixDomainSocketWithAbstractNamespaceFactory); |
121 }; | 121 }; |
122 #endif | 122 #endif |
123 | 123 |
124 } // namespace net | 124 } // namespace net |
125 | 125 |
126 #endif // NET_SOCKET_UNIX_DOMAIN_SOCKET_POSIX_H_ | 126 #endif // NET_SOCKET_UNIX_DOMAIN_SOCKET_POSIX_H_ |
OLD | NEW |