OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_H_ | 5 #ifndef IPC_IPC_CHANNEL_H_ |
6 #define IPC_IPC_CHANNEL_H_ | 6 #define IPC_IPC_CHANNEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ipc/ipc_channel_handle.h" | 10 #include "ipc/ipc_channel_handle.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 // Returns true if the peer process' effective user id can be determined, in | 165 // Returns true if the peer process' effective user id can be determined, in |
166 // which case the supplied client_euid is updated with it. | 166 // which case the supplied client_euid is updated with it. |
167 bool GetClientEuid(uid_t* client_euid) const; | 167 bool GetClientEuid(uid_t* client_euid) const; |
168 | 168 |
169 // Closes any currently connected socket, and returns to a listening state | 169 // Closes any currently connected socket, and returns to a listening state |
170 // for more connections. | 170 // for more connections. |
171 void ResetToAcceptingConnectionState(); | 171 void ResetToAcceptingConnectionState(); |
172 #endif // defined(OS_POSIX) && !defined(OS_NACL) | 172 #endif // defined(OS_POSIX) && !defined(OS_NACL) |
173 | 173 |
174 #if defined(OS_LINUX) | |
175 // Configures the channel to defer OnChannelConnected() until we know the | |
176 // global PID of the peer. On Linux, with sandboxed renderers, the browser | |
177 // cannot use the process id sent by the renderer in the hello message, | |
178 // because the renderer is in its own private PID namespace. With these | |
179 // renderers we need to defer our call to OnChannelConnected(peer_pid) until | |
180 // we know the global PID. | |
181 void SetNeedsOverridePeerPid(); | |
182 | |
183 // Overrides the peer PID and calls OnChannelConnected() if necessary. | |
184 void OverridePeerPid(int32 peer_pid); | |
185 #endif // defined(OS_LINUX) | |
186 | |
187 // Returns true if a named server channel is initialized on the given channel | 174 // Returns true if a named server channel is initialized on the given channel |
188 // ID. Even if true, the server may have already accepted a connection. | 175 // ID. Even if true, the server may have already accepted a connection. |
189 static bool IsNamedServerInitialized(const std::string& channel_id); | 176 static bool IsNamedServerInitialized(const std::string& channel_id); |
190 | 177 |
191 protected: | 178 protected: |
192 // Used in Chrome by the TestSink to provide a dummy channel implementation | 179 // Used in Chrome by the TestSink to provide a dummy channel implementation |
193 // for testing. TestSink overrides the "interesting" functions in Channel so | 180 // for testing. TestSink overrides the "interesting" functions in Channel so |
194 // no actual implementation is needed. This will cause un-overridden calls to | 181 // no actual implementation is needed. This will cause un-overridden calls to |
195 // segfault. Do not use outside of test code! | 182 // segfault. Do not use outside of test code! |
196 Channel() : channel_impl_(0) { } | 183 Channel() : channel_impl_(0) { } |
(...skipping 11 matching lines...) Expand all Loading... |
208 HELLO_MESSAGE_TYPE = kuint16max // Maximum value of message type (uint16), | 195 HELLO_MESSAGE_TYPE = kuint16max // Maximum value of message type (uint16), |
209 // to avoid conflicting with normal | 196 // to avoid conflicting with normal |
210 // message types, which are enumeration | 197 // message types, which are enumeration |
211 // constants starting from 0. | 198 // constants starting from 0. |
212 }; | 199 }; |
213 }; | 200 }; |
214 | 201 |
215 } // namespace IPC | 202 } // namespace IPC |
216 | 203 |
217 #endif // IPC_IPC_CHANNEL_H_ | 204 #endif // IPC_IPC_CHANNEL_H_ |
OLD | NEW |