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 // Returns true if a named server channel is initialized on the given channel |
| 175 // ID. Even if true, the server may have already accepted a connection. |
| 176 static bool IsNamedServerInitialized(const std::string& channel_id); |
| 177 |
174 protected: | 178 protected: |
175 // 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 |
176 // for testing. TestSink overrides the "interesting" functions in Channel so | 180 // for testing. TestSink overrides the "interesting" functions in Channel so |
177 // 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 |
178 // segfault. Do not use outside of test code! | 182 // segfault. Do not use outside of test code! |
179 Channel() : channel_impl_(0) { } | 183 Channel() : channel_impl_(0) { } |
180 | 184 |
181 private: | 185 private: |
182 // PIMPL to which all channel calls are delegated. | 186 // PIMPL to which all channel calls are delegated. |
183 class ChannelImpl; | 187 class ChannelImpl; |
184 ChannelImpl *channel_impl_; | 188 ChannelImpl *channel_impl_; |
185 | 189 |
186 // The Hello message is internal to the Channel class. It is sent | 190 // The Hello message is internal to the Channel class. It is sent |
187 // by the peer when the channel is connected. The message contains | 191 // by the peer when the channel is connected. The message contains |
188 // just the process id (pid). The message has a special routing_id | 192 // just the process id (pid). The message has a special routing_id |
189 // (MSG_ROUTING_NONE) and type (HELLO_MESSAGE_TYPE). | 193 // (MSG_ROUTING_NONE) and type (HELLO_MESSAGE_TYPE). |
190 enum { | 194 enum { |
191 HELLO_MESSAGE_TYPE = kuint16max // Maximum value of message type (uint16), | 195 HELLO_MESSAGE_TYPE = kuint16max // Maximum value of message type (uint16), |
192 // to avoid conflicting with normal | 196 // to avoid conflicting with normal |
193 // message types, which are enumeration | 197 // message types, which are enumeration |
194 // constants starting from 0. | 198 // constants starting from 0. |
195 }; | 199 }; |
196 }; | 200 }; |
197 | 201 |
198 } // namespace IPC | 202 } // namespace IPC |
199 | 203 |
200 #endif // IPC_IPC_CHANNEL_H_ | 204 #endif // IPC_IPC_CHANNEL_H_ |
OLD | NEW |