Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: mojo/edk/test/multiprocess_test_helper.cc

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Fix Mojo launcher, review comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "mojo/edk/test/multiprocess_test_helper.h" 5 #include "mojo/edk/test/multiprocess_test_helper.h"
6 6
7 #include <functional> 7 #include <functional>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 if (!switch_string.empty()) { 128 if (!switch_string.empty()) {
129 CHECK(!command_line.HasSwitch(switch_string)); 129 CHECK(!command_line.HasSwitch(switch_string));
130 if (!switch_value.empty()) 130 if (!switch_value.empty())
131 command_line.AppendSwitchASCII(switch_string, switch_value); 131 command_line.AppendSwitchASCII(switch_string, switch_value);
132 else 132 else
133 command_line.AppendSwitch(switch_string); 133 command_line.AppendSwitch(switch_string);
134 } 134 }
135 135
136 base::LaunchOptions options; 136 base::LaunchOptions options;
137 #if defined(OS_POSIX) 137 #if defined(OS_POSIX)
138 options.fds_to_remap = &handle_passing_info; 138 options.fds_to_remap = handle_passing_info;
139 #elif defined(OS_WIN) 139 #elif defined(OS_WIN)
140 options.start_hidden = true; 140 options.start_hidden = true;
141 if (base::win::GetVersion() >= base::win::VERSION_VISTA) 141 options.inherit_mode = base::LaunchOptions::Inherit::kAll;
jschuh 2017/07/24 19:41:27 Why is this one not using the inheritance list?
brettw 2017/07/24 23:35:30 Thanks!
142 options.handles_to_inherit = &handle_passing_info;
143 else
144 options.inherit_handles = true;
145 #else 142 #else
146 #error "Not supported yet." 143 #error "Not supported yet."
147 #endif 144 #endif
148 145
149 // NOTE: In the case of named pipes, it's important that the server handle be 146 // NOTE: In the case of named pipes, it's important that the server handle be
150 // created before the child process is launched; otherwise the server binding 147 // created before the child process is launched; otherwise the server binding
151 // the pipe path can race with child's connection to the pipe. 148 // the pipe path can race with child's connection to the pipe.
152 ScopedPlatformHandle server_handle; 149 ScopedPlatformHandle server_handle;
153 if (launch_type == LaunchType::CHILD || launch_type == LaunchType::PEER) { 150 if (launch_type == LaunchType::CHILD || launch_type == LaunchType::PEER) {
154 server_handle = channel.PassServerHandle(); 151 server_handle = channel.PassServerHandle();
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 }, 259 },
263 true /* pass_pipe_ownership_to_main */); 260 true /* pass_pipe_ownership_to_main */);
264 } 261 }
265 262
266 // static 263 // static
267 mojo::ScopedMessagePipeHandle MultiprocessTestHelper::primordial_pipe; 264 mojo::ScopedMessagePipeHandle MultiprocessTestHelper::primordial_pipe;
268 265
269 } // namespace test 266 } // namespace test
270 } // namespace edk 267 } // namespace edk
271 } // namespace mojo 268 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698