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

Unified Diff: services/service_manager/runner/host/service_process_launcher.cc

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Merge 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 side-by-side diff with in-line comments
Download patch
Index: services/service_manager/runner/host/service_process_launcher.cc
diff --git a/services/service_manager/runner/host/service_process_launcher.cc b/services/service_manager/runner/host/service_process_launcher.cc
index c247fa52c0de3c520494364c52da07f3ad21e76d..5d7828c6e2fc86b87577fe699dc62b5a44792777 100644
--- a/services/service_manager/runner/host/service_process_launcher.cc
+++ b/services/service_manager/runner/host/service_process_launcher.cc
@@ -130,11 +130,7 @@ void ServiceProcessLauncher::DoLaunch(
base::LaunchOptions options;
#if defined(OS_WIN)
- options.handles_to_inherit = &handle_passing_info_;
-#if defined(OFFICIAL_BUILD)
- CHECK(false) << "Launching mojo process with inherit_handles is insecure!";
-#endif
- options.inherit_handles = true;
+ options.handles_to_inherit = handle_passing_info_;
options.stdin_handle = INVALID_HANDLE_VALUE;
options.stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
options.stderr_handle = GetStdHandle(STD_ERROR_HANDLE);
@@ -151,18 +147,18 @@ void ServiceProcessLauncher::DoLaunch(
// inherited.
if (options.stdout_handle &&
GetFileType(options.stdout_handle) != FILE_TYPE_CHAR) {
- handle_passing_info_.push_back(options.stdout_handle);
+ options.handles_to_inherit.push_back(options.stdout_handle);
}
if (options.stderr_handle &&
GetFileType(options.stderr_handle) != FILE_TYPE_CHAR &&
options.stdout_handle != options.stderr_handle) {
- handle_passing_info_.push_back(options.stderr_handle);
+ options.handles_to_inherit.push_back(options.stderr_handle);
}
#elif defined(OS_POSIX)
handle_passing_info_.push_back(std::make_pair(STDIN_FILENO, STDIN_FILENO));
handle_passing_info_.push_back(std::make_pair(STDOUT_FILENO, STDOUT_FILENO));
handle_passing_info_.push_back(std::make_pair(STDERR_FILENO, STDERR_FILENO));
- options.fds_to_remap = &handle_passing_info_;
+ options.fds_to_remap = handle_passing_info_;
#endif
DVLOG(2) << "Launching child with command line: "
<< child_command_line->GetCommandLineString();
« no previous file with comments | « sandbox/win/src/broker_services.cc ('k') | services/service_manager/tests/service_manager/service_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698