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

Unified Diff: content/browser/child_process_launcher_helper_posix.cc

Issue 2594203004: Unifying ChildProcessLauncher across platforms. (Closed)
Patch Set: Clean-up. Created 3 years, 11 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_posix.cc
diff --git a/content/browser/child_process_launcher_helper_posix.cc b/content/browser/child_process_launcher_helper_posix.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9c3583ea6333501c26475c5c82177de78999cd5c
--- /dev/null
+++ b/content/browser/child_process_launcher_helper_posix.cc
@@ -0,0 +1,43 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/child_process_launcher_helper_posix.h"
+
+#include "base/command_line.h"
+#include "base/metrics/field_trial.h"
+#include "content/browser/file_descriptor_info_impl.h"
+#include "content/public/browser/content_browser_client.h"
+#include "content/public/common/content_client.h"
+#include "content/public/common/content_descriptors.h"
+#include "mojo/edk/embedder/platform_handle.h"
+
+namespace content {
+namespace internal {
+
+std::unique_ptr<FileDescriptorInfo> CreateDefaultPosixFilesToMap(
+ const base::CommandLine& command_line,
+ int child_process_id,
+ const mojo::edk::PlatformHandle& mojo_client_handle) {
+ std::unique_ptr<FileDescriptorInfo> files_to_register(
+ FileDescriptorInfoImpl::Create());
+
+ int field_trial_handle = base::FieldTrialList::GetFieldTrialHandle();
+ if (field_trial_handle != base::kInvalidPlatformFile)
+ files_to_register->Share(kFieldTrialDescriptor, field_trial_handle);
+
+ DCHECK(mojo_client_handle.is_valid());
+ files_to_register->Share(kMojoIPCChannel, mojo_client_handle.handle);
+
+ // TODO(jcivelli): remove this "if defined" by making
+ // GetAdditionalMappedFilesForChildProcess a no op on Mac.
+#if !defined(OS_MACOSX)
+ GetContentClient()->browser()->GetAdditionalMappedFilesForChildProcess(
+ command_line, child_process_id, files_to_register.get());
+#endif
+
+ return files_to_register;
+}
+
+} // namespace internal
+} // namespace content
« no previous file with comments | « content/browser/child_process_launcher_helper_posix.h ('k') | content/browser/child_process_launcher_helper_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698