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_H_ | 5 #ifndef IPC_IPC_CHANNEL_H_ |
6 #define IPC_IPC_CHANNEL_H_ | 6 #define IPC_IPC_CHANNEL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 // | 238 // |
239 // |message| must be allocated using operator new. This object will be | 239 // |message| must be allocated using operator new. This object will be |
240 // deleted once the contents of the Message have been sent. | 240 // deleted once the contents of the Message have been sent. |
241 bool Send(Message* message) override = 0; | 241 bool Send(Message* message) override = 0; |
242 | 242 |
243 #if !defined(OS_NACL_SFI) | 243 #if !defined(OS_NACL_SFI) |
244 // Generates a channel ID that's non-predictable and unique. | 244 // Generates a channel ID that's non-predictable and unique. |
245 static std::string GenerateUniqueRandomChannelID(); | 245 static std::string GenerateUniqueRandomChannelID(); |
246 #endif | 246 #endif |
247 | 247 |
248 // Deprecated: Create a mojo::MessagePipe directly and release() its handles | |
249 // instead. | |
250 // | |
251 // Generates a pair of channel handles that can be used as the client and | |
252 // server ends of a ChannelMojo. |name_postfix| is ignored. | |
253 static void GenerateMojoChannelHandlePair( | |
254 const std::string& name_postfix, | |
255 IPC::ChannelHandle* handle0, | |
256 IPC::ChannelHandle* handle1); | |
257 | |
258 #if defined(OS_LINUX) | 248 #if defined(OS_LINUX) |
259 // Sandboxed processes live in a PID namespace, so when sending the IPC hello | 249 // Sandboxed processes live in a PID namespace, so when sending the IPC hello |
260 // message from client to server we need to send the PID from the global | 250 // message from client to server we need to send the PID from the global |
261 // PID namespace. | 251 // PID namespace. |
262 static void SetGlobalPid(int pid); | 252 static void SetGlobalPid(int pid); |
263 static int GetGlobalPid(); | 253 static int GetGlobalPid(); |
264 #endif | 254 #endif |
265 | 255 |
266 protected: | 256 protected: |
267 // An OutputElement is a wrapper around a Message or raw buffer while it is | 257 // An OutputElement is a wrapper around a Message or raw buffer while it is |
(...skipping 20 matching lines...) Expand all Loading... |
288 // of Connect(). | 278 // of Connect(). |
289 void WillConnect(); | 279 void WillConnect(); |
290 | 280 |
291 private: | 281 private: |
292 bool did_start_connect_ = false; | 282 bool did_start_connect_ = false; |
293 }; | 283 }; |
294 | 284 |
295 } // namespace IPC | 285 } // namespace IPC |
296 | 286 |
297 #endif // IPC_IPC_CHANNEL_H_ | 287 #endif // IPC_IPC_CHANNEL_H_ |
OLD | NEW |