OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 MOJO_EDK_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ | 5 #ifndef MOJO_EDK_PLATFORM_PLATFORM_PIPE_H_ |
6 #define MOJO_EDK_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ | 6 #define MOJO_EDK_PLATFORM_PLATFORM_PIPE_H_ |
7 | 7 |
8 #include "mojo/edk/platform/scoped_platform_handle.h" | 8 #include "mojo/edk/platform/scoped_platform_handle.h" |
9 | 9 |
10 namespace mojo { | 10 namespace mojo { |
11 namespace embedder { | 11 namespace platform { |
12 | 12 |
13 // A helper class for creating a pair of |PlatformHandle|s that are connected by | 13 // A helper class for creating a pair of |PlatformHandle|s that are connected by |
14 // a suitable (platform-specific) bidirectional "pipe" (e.g., Unix domain | 14 // a suitable (platform-specific) bidirectional "pipe" (e.g., Unix domain |
15 // socket). The resulting handles can then be used in the same process (e.g., in | 15 // socket). The resulting handles can then be used in the same process (e.g., in |
16 // tests) or between processes. | 16 // tests) or between processes. |
17 // | 17 // |
18 // Note: On POSIX platforms, to write to the "pipe", use | 18 // Note: On POSIX platforms, to write to the "pipe", use |
19 // |PlatformChannel{Write,Writev}()| (from platform_channel_utils.h) instead of | 19 // |PlatformChannel{Write,Writev}()| (from platform_channel_utils.h) instead of |
20 // |write()|, |writev()|, etc. Otherwise, you have to worry about platform | 20 // |write()|, |writev()|, etc. Otherwise, you have to worry about platform |
21 // differences in suppressing |SIGPIPE|. | 21 // differences in suppressing |SIGPIPE|. |
22 class PlatformChannelPair { | 22 class PlatformPipe { |
23 public: | 23 public: |
24 PlatformChannelPair(); | 24 PlatformPipe(); |
25 ~PlatformChannelPair(); | 25 ~PlatformPipe(); |
26 | 26 |
27 platform::ScopedPlatformHandle handle0; | 27 ScopedPlatformHandle handle0; |
28 platform::ScopedPlatformHandle handle1; | 28 ScopedPlatformHandle handle1; |
29 }; | 29 }; |
30 | 30 |
31 } // namespace embedder | 31 } // namespace platform |
32 } // namespace mojo | 32 } // namespace mojo |
33 | 33 |
34 #endif // MOJO_EDK_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ | 34 #endif // MOJO_EDK_PLATFORM_PLATFORM_PIPE_H_ |
OLD | NEW |