| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "base/memory/ptr_util.h" | 5 #include "base/memory/ptr_util.h" |
| 6 #include "base/posix/global_descriptors.h" | 6 #include "base/posix/global_descriptors.h" |
| 7 #include "content/browser/bootstrap_sandbox_manager_mac.h" | 7 #include "content/browser/bootstrap_sandbox_manager_mac.h" |
| 8 #include "content/browser/child_process_launcher.h" | 8 #include "content/browser/child_process_launcher.h" |
| 9 #include "content/browser/child_process_launcher_helper.h" | 9 #include "content/browser/child_process_launcher_helper.h" |
| 10 #include "content/browser/child_process_launcher_helper_posix.h" | 10 #include "content/browser/child_process_launcher_helper_posix.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // options now owns the pre_exec_delegate which will be delete on | 73 // options now owns the pre_exec_delegate which will be delete on |
| 74 // AfterLaunchOnLauncherThread below. | 74 // AfterLaunchOnLauncherThread below. |
| 75 options->pre_exec_delegate = pre_exec_delegate.release(); | 75 options->pre_exec_delegate = pre_exec_delegate.release(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 ChildProcessLauncherHelper::Process | 78 ChildProcessLauncherHelper::Process |
| 79 ChildProcessLauncherHelper::LaunchProcessOnLauncherThread( | 79 ChildProcessLauncherHelper::LaunchProcessOnLauncherThread( |
| 80 const base::LaunchOptions& options, | 80 const base::LaunchOptions& options, |
| 81 std::unique_ptr<FileDescriptorInfo> files_to_register, | 81 std::unique_ptr<FileDescriptorInfo> files_to_register, |
| 82 bool* is_synchronous_launch, | 82 bool* is_synchronous_launch, |
| 83 int* launch_result) { | 83 int* launch_result, |
| 84 std::unique_ptr<mojo::edk::PendingProcessConnection>* pending_connection, |
| 85 mojo::edk::ScopedPlatformHandle* server_handle) { |
| 84 *is_synchronous_launch = true; | 86 *is_synchronous_launch = true; |
| 85 ChildProcessLauncherHelper::Process process; | 87 ChildProcessLauncherHelper::Process process; |
| 86 process.process = base::LaunchProcess(*command_line(), options); | 88 process.process = base::LaunchProcess(*command_line(), options); |
| 87 *launch_result = process.process.IsValid() ? LAUNCH_RESULT_SUCCESS | 89 *launch_result = process.process.IsValid() ? LAUNCH_RESULT_SUCCESS |
| 88 : LAUNCH_RESULT_FAILURE; | 90 : LAUNCH_RESULT_FAILURE; |
| 89 return process; | 91 return process; |
| 90 } | 92 } |
| 91 | 93 |
| 92 void ChildProcessLauncherHelper::AfterLaunchOnLauncherThread( | 94 void ChildProcessLauncherHelper::AfterLaunchOnLauncherThread( |
| 93 const ChildProcessLauncherHelper::Process& process, | 95 const ChildProcessLauncherHelper::Process& process, |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 143 |
| 142 // static | 144 // static |
| 143 void ChildProcessLauncherHelper::SetProcessBackgroundedOnLauncherThread( | 145 void ChildProcessLauncherHelper::SetProcessBackgroundedOnLauncherThread( |
| 144 base::Process process, bool background) { | 146 base::Process process, bool background) { |
| 145 if (process.CanBackgroundProcesses()) | 147 if (process.CanBackgroundProcesses()) |
| 146 process.SetProcessBackgrounded(MachBroker::GetInstance(), background); | 148 process.SetProcessBackgrounded(MachBroker::GetInstance(), background); |
| 147 } | 149 } |
| 148 | 150 |
| 149 } // namespace internal | 151 } // namespace internal |
| 150 } // namespace content | 152 } // namespace content |
| OLD | NEW |