| 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // Generates a channel ID that's non-predictable and unique. | 290 // Generates a channel ID that's non-predictable and unique. |
| 291 static std::string GenerateUniqueRandomChannelID(); | 291 static std::string GenerateUniqueRandomChannelID(); |
| 292 | 292 |
| 293 // Generates a channel ID that, if passed to the client as a shared secret, | 293 // Generates a channel ID that, if passed to the client as a shared secret, |
| 294 // will validate that the client's authenticity. On platforms that do not | 294 // will validate that the client's authenticity. On platforms that do not |
| 295 // require additional this is simply calls GenerateUniqueRandomChannelID(). | 295 // require additional this is simply calls GenerateUniqueRandomChannelID(). |
| 296 // For portability the prefix should not include the \ character. | 296 // For portability the prefix should not include the \ character. |
| 297 static std::string GenerateVerifiedChannelID(const std::string& prefix); | 297 static std::string GenerateVerifiedChannelID(const std::string& prefix); |
| 298 #endif | 298 #endif |
| 299 | 299 |
| 300 // Deprecated: Create a mojo::MessagePipe directly and release() its handles |
| 301 // instead. |
| 302 // |
| 300 // Generates a pair of channel handles that can be used as the client and | 303 // Generates a pair of channel handles that can be used as the client and |
| 301 // server ends of a ChannelMojo. |name_postfix| is appended to the end of the | 304 // server ends of a ChannelMojo. |name_postfix| is ignored. |
| 302 // handle name to help identify the handles. | |
| 303 // | |
| 304 // Note, when using ChannelMojo, |ChannelHandle::name| serves no functional | |
| 305 // purpose other than to identify the channel in logging. | |
| 306 static void GenerateMojoChannelHandlePair( | 305 static void GenerateMojoChannelHandlePair( |
| 307 const std::string& name_postfix, | 306 const std::string& name_postfix, |
| 308 IPC::ChannelHandle* handle0, | 307 IPC::ChannelHandle* handle0, |
| 309 IPC::ChannelHandle* handle1); | 308 IPC::ChannelHandle* handle1); |
| 310 | 309 |
| 311 #if defined(OS_LINUX) | 310 #if defined(OS_LINUX) |
| 312 // Sandboxed processes live in a PID namespace, so when sending the IPC hello | 311 // Sandboxed processes live in a PID namespace, so when sending the IPC hello |
| 313 // message from client to server we need to send the PID from the global | 312 // message from client to server we need to send the PID from the global |
| 314 // PID namespace. | 313 // PID namespace. |
| 315 static void SetGlobalPid(int pid); | 314 static void SetGlobalPid(int pid); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 | 357 |
| 359 #if defined(OS_POSIX) | 358 #if defined(OS_POSIX) |
| 360 // SocketPair() creates a pair of socket FDs suitable for using with | 359 // SocketPair() creates a pair of socket FDs suitable for using with |
| 361 // IPC::Channel. | 360 // IPC::Channel. |
| 362 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); | 361 IPC_EXPORT bool SocketPair(int* fd1, int* fd2); |
| 363 #endif | 362 #endif |
| 364 | 363 |
| 365 } // namespace IPC | 364 } // namespace IPC |
| 366 | 365 |
| 367 #endif // IPC_IPC_CHANNEL_H_ | 366 #endif // IPC_IPC_CHANNEL_H_ |
| OLD | NEW |