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_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ | 5 #ifndef MOJO_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ |
6 #define MOJO_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ | 6 #define MOJO_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/process/launch.h" | 10 #include "base/process/launch.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 // | 38 // |
39 // This class provides facilities for passing the client handle to a child | 39 // This class provides facilities for passing the client handle to a child |
40 // process. The parent should call |PrepareToPassClientHandlelToChildProcess()| | 40 // process. The parent should call |PrepareToPassClientHandlelToChildProcess()| |
41 // to get the data needed to do this, spawn the child using that data, and then | 41 // to get the data needed to do this, spawn the child using that data, and then |
42 // call |ChildProcessLaunched()|. Note that on Windows this facility (will) only | 42 // call |ChildProcessLaunched()|. Note that on Windows this facility (will) only |
43 // work on Vista and later (TODO(vtl)). | 43 // work on Vista and later (TODO(vtl)). |
44 // | 44 // |
45 // Note: |PlatformChannelPair()|, |PassClientHandleFromParentProcess()| and | 45 // Note: |PlatformChannelPair()|, |PassClientHandleFromParentProcess()| and |
46 // |PrepareToPassClientHandleToChildProcess()| have platform-specific | 46 // |PrepareToPassClientHandleToChildProcess()| have platform-specific |
47 // implementations. | 47 // implementations. |
| 48 // |
| 49 // Note: On POSIX platforms, to write to the "pipe", use |
| 50 // |PlatformChannel{Write,Writev}()| (from platform_channel_utils_posix.h) |
| 51 // instead of |write()|, |writev()|, etc. Otherwise, you have to worry about |
| 52 // platform differences in suppressing |SIGPIPE|. |
48 class MOJO_SYSTEM_IMPL_EXPORT PlatformChannelPair { | 53 class MOJO_SYSTEM_IMPL_EXPORT PlatformChannelPair { |
49 public: | 54 public: |
50 PlatformChannelPair(); | 55 PlatformChannelPair(); |
51 ~PlatformChannelPair(); | 56 ~PlatformChannelPair(); |
52 | 57 |
53 ScopedPlatformHandle PassServerHandle(); | 58 ScopedPlatformHandle PassServerHandle(); |
54 | 59 |
55 // For in-process use (e.g., in tests or to pass over another channel). | 60 // For in-process use (e.g., in tests or to pass over another channel). |
56 ScopedPlatformHandle PassClientHandle(); | 61 ScopedPlatformHandle PassClientHandle(); |
57 | 62 |
(...skipping 22 matching lines...) Expand all Loading... |
80 ScopedPlatformHandle server_handle_; | 85 ScopedPlatformHandle server_handle_; |
81 ScopedPlatformHandle client_handle_; | 86 ScopedPlatformHandle client_handle_; |
82 | 87 |
83 DISALLOW_COPY_AND_ASSIGN(PlatformChannelPair); | 88 DISALLOW_COPY_AND_ASSIGN(PlatformChannelPair); |
84 }; | 89 }; |
85 | 90 |
86 } // namespace embedder | 91 } // namespace embedder |
87 } // namespace mojo | 92 } // namespace mojo |
88 | 93 |
89 #endif // MOJO_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ | 94 #endif // MOJO_EMBEDDER_PLATFORM_CHANNEL_PAIR_H_ |
OLD | NEW |