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

Unified Diff: content/browser/child_process_launcher_helper_linux.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: content/browser/child_process_launcher_helper_linux.cc
diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc
index 0b2387d7a694fc70af74b203c2636ef937245142..537522b720d3bf2b6eef9ab96f1ec3a0f4aed46e 100644
--- a/content/browser/child_process_launcher_helper_linux.cc
+++ b/content/browser/child_process_launcher_helper_linux.cc
@@ -40,22 +40,19 @@ ChildProcessLauncherHelper::GetFilesToMap() {
}
void ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
- const FileDescriptorInfo& files_to_register,
+ const PosixFileDescriptorInfo& files_to_register,
base::LaunchOptions* options) {
// Convert FD mapping to FileHandleMappingVector
- std::unique_ptr<base::FileHandleMappingVector> fds_to_map =
- files_to_register.GetMappingWithIDAdjustment(
- base::GlobalDescriptors::kBaseDescriptor);
+ options->fds_to_remap = files_to_register.GetMappingWithIDAdjustment(
+ base::GlobalDescriptors::kBaseDescriptor);
if (GetProcessType() == switches::kRendererProcess) {
const int sandbox_fd =
RenderSandboxHostLinux::GetInstance()->GetRendererSocket();
- fds_to_map->push_back(std::make_pair(sandbox_fd, GetSandboxFD()));
+ options->fds_to_remap.push_back(std::make_pair(sandbox_fd, GetSandboxFD()));
}
options->environ = delegate_->GetEnvironment();
- // fds_to_remap will de deleted in AfterLaunchOnLauncherThread() below.
- options->fds_to_remap = fds_to_map.release();
}
ChildProcessLauncherHelper::Process
@@ -93,7 +90,6 @@ ChildProcessLauncherHelper::LaunchProcessOnLauncherThread(
void ChildProcessLauncherHelper::AfterLaunchOnLauncherThread(
const ChildProcessLauncherHelper::Process& process,
const base::LaunchOptions& options) {
- delete options.fds_to_remap;
}
base::TerminationStatus ChildProcessLauncherHelper::GetTerminationStatus(
« no previous file with comments | « content/browser/child_process_launcher_helper_android.cc ('k') | content/browser/child_process_launcher_helper_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698