| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MOJO_EDK_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ | |
| 6 #define MOJO_EDK_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ | |
| 7 | |
| 8 #include "mojo/edk/platform/scoped_platform_handle.h" | |
| 9 | |
| 10 namespace mojo { | |
| 11 namespace embedder { | |
| 12 | |
| 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 | |
| 15 // socket). The resulting handles can then be used in the same process (e.g., in | |
| 16 // tests) or between processes. | |
| 17 // | |
| 18 // Note: On POSIX platforms, to write to the "pipe", use | |
| 19 // |PlatformChannel{Write,Writev}()| (from platform_channel_utils.h) instead of | |
| 20 // |write()|, |writev()|, etc. Otherwise, you have to worry about platform | |
| 21 // differences in suppressing |SIGPIPE|. | |
| 22 class PlatformChannelPair { | |
| 23 public: | |
| 24 PlatformChannelPair(); | |
| 25 ~PlatformChannelPair(); | |
| 26 | |
| 27 platform::ScopedPlatformHandle handle0; | |
| 28 platform::ScopedPlatformHandle handle1; | |
| 29 }; | |
| 30 | |
| 31 } // namespace embedder | |
| 32 } // namespace mojo | |
| 33 | |
| 34 #endif // MOJO_EDK_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ | |
| OLD | NEW |