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

Side by Side Diff: services/service_manager/tests/util.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 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 #include "services/service_manager/tests/util.h" 5 #include "services/service_manager/tests/util.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/base_switches.h" 8 #include "base/base_switches.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 Connector::TestApi test_api(connector); 79 Connector::TestApi test_api(connector);
80 test_api.SetStartServiceCallback( 80 test_api.SetStartServiceCallback(
81 base::Bind(&GrabConnectResult, &loop, &result)); 81 base::Bind(&GrabConnectResult, &loop, &result));
82 base::MessageLoop::ScopedNestableTaskAllower allow( 82 base::MessageLoop::ScopedNestableTaskAllower allow(
83 base::MessageLoop::current()); 83 base::MessageLoop::current());
84 loop.Run(); 84 loop.Run();
85 } 85 }
86 86
87 base::LaunchOptions options; 87 base::LaunchOptions options;
88 #if defined(OS_WIN) 88 #if defined(OS_WIN)
89 options.handles_to_inherit = &handle_passing_info; 89 options.handles_to_inherit = handle_passing_info;
90 #elif defined(OS_POSIX) 90 #elif defined(OS_POSIX)
91 options.fds_to_remap = &handle_passing_info; 91 options.fds_to_remap = handle_passing_info;
92 #endif 92 #endif
93 *process = base::LaunchProcess(child_command_line, options); 93 *process = base::LaunchProcess(child_command_line, options);
94 DCHECK(process->IsValid()); 94 DCHECK(process->IsValid());
95 receiver->SetPID(process->Pid()); 95 receiver->SetPID(process->Pid());
96 invitation.Send( 96 invitation.Send(
97 process->Handle(), 97 process->Handle(),
98 mojo::edk::ConnectionParams(mojo::edk::TransportProtocol::kLegacy, 98 mojo::edk::ConnectionParams(mojo::edk::TransportProtocol::kLegacy,
99 platform_channel_pair.PassServerHandle())); 99 platform_channel_pair.PassServerHandle()));
100 return result; 100 return result;
101 } 101 }
102 102
103 } // namespace test 103 } // namespace test
104 } // namespace service_manager 104 } // namespace service_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698