OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_NAMED_PLATFORM_CHANNEL_PAIR_H_ | 5 #ifndef MOJO_EDK_EMBEDDER_NAMED_PLATFORM_CHANNEL_PAIR_H_ |
6 #define MOJO_EDK_EMBEDDER_NAMED_PLATFORM_CHANNEL_PAIR_H_ | 6 #define MOJO_EDK_EMBEDDER_NAMED_PLATFORM_CHANNEL_PAIR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 // empty, a default security descriptor will be used. See | 34 // empty, a default security descriptor will be used. See |
35 // kDefaultSecurityDescriptor in named_platform_handle_utils_win.cc. | 35 // kDefaultSecurityDescriptor in named_platform_handle_utils_win.cc. |
36 base::string16 security_descriptor; | 36 base::string16 security_descriptor; |
37 #endif | 37 #endif |
38 }; | 38 }; |
39 | 39 |
40 NamedPlatformChannelPair(const Options& options = {}); | 40 NamedPlatformChannelPair(const Options& options = {}); |
41 ~NamedPlatformChannelPair(); | 41 ~NamedPlatformChannelPair(); |
42 | 42 |
43 // Note: It is NOT acceptable to use this handle as a generic pipe channel. It | 43 // Note: It is NOT acceptable to use this handle as a generic pipe channel. It |
44 // MUST be passed to mojo::edk::ChildProcessLaunched() only. | 44 // MUST be passed to PendingProcessConnection::Connect() only. |
45 ScopedPlatformHandle PassServerHandle(); | 45 ScopedPlatformHandle PassServerHandle(); |
46 | 46 |
47 // To be called in the child process, after the parent process called | 47 // To be called in the child process, after the parent process called |
48 // |PrepareToPassClientHandleToChildProcess()| and launched the child (using | 48 // |PrepareToPassClientHandleToChildProcess()| and launched the child (using |
49 // the provided data), to create a client handle connected to the server | 49 // the provided data), to create a client handle connected to the server |
50 // handle (in the parent process). | 50 // handle (in the parent process). |
51 static ScopedPlatformHandle PassClientHandleFromParentProcess( | 51 static ScopedPlatformHandle PassClientHandleFromParentProcess( |
52 const base::CommandLine& command_line); | 52 const base::CommandLine& command_line); |
53 | 53 |
54 // Prepares to pass the client channel to a new child process, to be launched | 54 // Prepares to pass the client channel to a new child process, to be launched |
55 // using |LaunchProcess()| (from base/launch.h). Modifies |*command_line| and | 55 // using |LaunchProcess()| (from base/launch.h). Modifies |*command_line| and |
56 // |*handle_passing_info| as needed. | 56 // |*handle_passing_info| as needed. |
57 // Note: For Windows, this method only works on Vista and later. | 57 // Note: For Windows, this method only works on Vista and later. |
58 void PrepareToPassClientHandleToChildProcess( | 58 void PrepareToPassClientHandleToChildProcess( |
59 base::CommandLine* command_line) const; | 59 base::CommandLine* command_line) const; |
60 | 60 |
61 const NamedPlatformHandle& handle() const { return pipe_handle_; } | 61 const NamedPlatformHandle& handle() const { return pipe_handle_; } |
62 | 62 |
63 private: | 63 private: |
64 NamedPlatformHandle pipe_handle_; | 64 NamedPlatformHandle pipe_handle_; |
65 ScopedPlatformHandle server_handle_; | 65 ScopedPlatformHandle server_handle_; |
66 | 66 |
67 DISALLOW_COPY_AND_ASSIGN(NamedPlatformChannelPair); | 67 DISALLOW_COPY_AND_ASSIGN(NamedPlatformChannelPair); |
68 }; | 68 }; |
69 | 69 |
70 } // namespace edk | 70 } // namespace edk |
71 } // namespace mojo | 71 } // namespace mojo |
72 | 72 |
73 #endif // MOJO_EDK_EMBEDDER_NAMED_PLATFORM_CHANNEL_PAIR_H_ | 73 #endif // MOJO_EDK_EMBEDDER_NAMED_PLATFORM_CHANNEL_PAIR_H_ |
OLD | NEW |