| 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 // Generates a channel ID that's non-predictable and unique. | 263 // Generates a channel ID that's non-predictable and unique. |
| 264 static std::string GenerateUniqueRandomChannelID(); | 264 static std::string GenerateUniqueRandomChannelID(); |
| 265 | 265 |
| 266 // Generates a channel ID that, if passed to the client as a shared secret, | 266 // Generates a channel ID that, if passed to the client as a shared secret, |
| 267 // will validate that the client's authenticity. On platforms that do not | 267 // will validate that the client's authenticity. On platforms that do not |
| 268 // require additional this is simply calls GenerateUniqueRandomChannelID(). | 268 // require additional this is simply calls GenerateUniqueRandomChannelID(). |
| 269 // For portability the prefix should not include the \ character. | 269 // For portability the prefix should not include the \ character. |
| 270 static std::string GenerateVerifiedChannelID(const std::string& prefix); | 270 static std::string GenerateVerifiedChannelID(const std::string& prefix); |
| 271 #endif | 271 #endif |
| 272 | 272 |
| 273 // Deprecated: Create a mojo::MessagePipe directly and release() its handles | |
| 274 // instead. | |
| 275 // | |
| 276 // Generates a pair of channel handles that can be used as the client and | |
| 277 // server ends of a ChannelMojo. |name_postfix| is ignored. | |
| 278 static void GenerateMojoChannelHandlePair( | |
| 279 const std::string& name_postfix, | |
| 280 IPC::ChannelHandle* handle0, | |
| 281 IPC::ChannelHandle* handle1); | |
| 282 | |
| 283 #if defined(OS_LINUX) | 273 #if defined(OS_LINUX) |
| 284 // Sandboxed processes live in a PID namespace, so when sending the IPC hello | 274 // Sandboxed processes live in a PID namespace, so when sending the IPC hello |
| 285 // message from client to server we need to send the PID from the global | 275 // message from client to server we need to send the PID from the global |
| 286 // PID namespace. | 276 // PID namespace. |
| 287 static void SetGlobalPid(int pid); | 277 static void SetGlobalPid(int pid); |
| 288 static int GetGlobalPid(); | 278 static int GetGlobalPid(); |
| 289 #endif | 279 #endif |
| 290 | 280 |
| 291 protected: | 281 protected: |
| 292 // An OutputElement is a wrapper around a Message or raw buffer while it is | 282 // An OutputElement is a wrapper around a Message or raw buffer while it is |
| (...skipping 23 matching lines...) Expand all Loading... |
| 316 // of Connect(). | 306 // of Connect(). |
| 317 void WillConnect(); | 307 void WillConnect(); |
| 318 | 308 |
| 319 private: | 309 private: |
| 320 bool did_start_connect_ = false; | 310 bool did_start_connect_ = false; |
| 321 }; | 311 }; |
| 322 | 312 |
| 323 } // namespace IPC | 313 } // namespace IPC |
| 324 | 314 |
| 325 #endif // IPC_IPC_CHANNEL_H_ | 315 #endif // IPC_IPC_CHANNEL_H_ |
| OLD | NEW |