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 IPC_IPC_CHANNEL_POSIX_H_ | 5 #ifndef IPC_IPC_CHANNEL_POSIX_H_ |
6 #define IPC_IPC_CHANNEL_POSIX_H_ | 6 #define IPC_IPC_CHANNEL_POSIX_H_ |
7 | 7 |
8 #include "ipc/ipc_channel.h" | 8 #include "ipc/ipc_channel.h" |
9 | 9 |
10 #include <sys/socket.h> // for CMSG macros | 10 #include <sys/socket.h> // for CMSG macros |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // for more connections. | 78 // for more connections. |
79 void ResetToAcceptingConnectionState(); | 79 void ResetToAcceptingConnectionState(); |
80 | 80 |
81 // Returns true if the peer process' effective user id can be determined, in | 81 // Returns true if the peer process' effective user id can be determined, in |
82 // which case the supplied peer_euid is updated with it. | 82 // which case the supplied peer_euid is updated with it. |
83 bool GetPeerEuid(uid_t* peer_euid) const; | 83 bool GetPeerEuid(uid_t* peer_euid) const; |
84 | 84 |
85 void CloseClientFileDescriptor(); | 85 void CloseClientFileDescriptor(); |
86 | 86 |
87 static bool IsNamedServerInitialized(const std::string& channel_id); | 87 static bool IsNamedServerInitialized(const std::string& channel_id); |
88 #if defined(OS_LINUX) | |
89 static void SetGlobalPid(int pid); | |
90 #endif // OS_LINUX | |
91 | 88 |
92 private: | 89 private: |
93 bool CreatePipe(const IPC::ChannelHandle& channel_handle); | 90 bool CreatePipe(const IPC::ChannelHandle& channel_handle); |
94 | 91 |
95 bool ProcessOutgoingMessages(); | 92 bool ProcessOutgoingMessages(); |
96 | 93 |
97 bool AcceptConnection(); | 94 bool AcceptConnection(); |
98 void ClosePipeOnError(); | 95 void ClosePipeOnError(); |
99 int GetHelloMessageProcId() const; | 96 int GetHelloMessageProcId() const; |
100 void QueueHelloMessage(); | 97 void QueueHelloMessage(); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 #if defined(OS_MACOSX) | 202 #if defined(OS_MACOSX) |
206 // On OSX, sent FDs must not be closed until we get an ack. | 203 // On OSX, sent FDs must not be closed until we get an ack. |
207 // Keep track of sent FDs here to make sure the remote is not | 204 // Keep track of sent FDs here to make sure the remote is not |
208 // trying to bamboozle us. | 205 // trying to bamboozle us. |
209 std::set<int> fds_to_close_; | 206 std::set<int> fds_to_close_; |
210 #endif | 207 #endif |
211 | 208 |
212 // True if we are responsible for unlinking the unix domain socket file. | 209 // True if we are responsible for unlinking the unix domain socket file. |
213 bool must_unlink_; | 210 bool must_unlink_; |
214 | 211 |
215 #if defined(OS_LINUX) | |
216 // If non-zero, overrides the process ID sent in the hello message. | |
217 static int global_pid_; | |
218 #endif // OS_LINUX | |
219 | |
220 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelPosix); | 212 DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelPosix); |
221 }; | 213 }; |
222 | 214 |
223 } // namespace IPC | 215 } // namespace IPC |
224 | 216 |
225 #endif // IPC_IPC_CHANNEL_POSIX_H_ | 217 #endif // IPC_IPC_CHANNEL_POSIX_H_ |
OLD | NEW |