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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/browser/child_process_launcher_helper_posix.h"
6
7 #include "base/command_line.h"
8 #include "base/metrics/field_trial.h"
9 #include "content/browser/file_descriptor_info_impl.h"
10 #include "content/public/browser/content_browser_client.h"
11 #include "content/public/common/content_client.h"
12 #include "content/public/common/content_descriptors.h"
13 #include "mojo/edk/embedder/platform_handle.h"
14
15 namespace content {
16 namespace internal {
17
18 std::unique_ptr<FileDescriptorInfo> CreateDefaultPosixFilesToMap(
19 const base::CommandLine& command_line,
20 int child_process_id,
21 const mojo::edk::PlatformHandle& mojo_client_handle) {
22 std::unique_ptr<FileDescriptorInfo> files_to_register(
23 FileDescriptorInfoImpl::Create());
24
25 int field_trial_handle = base::FieldTrialList::GetFieldTrialHandle();
26 if (field_trial_handle != base::kInvalidPlatformFile)
27 files_to_register->Share(kFieldTrialDescriptor, field_trial_handle);
28
29 DCHECK(mojo_client_handle.is_valid());
30 files_to_register->Share(kMojoIPCChannel, mojo_client_handle.handle);
31
32 // TODO(jcivelli): remove this "if defined" by making
33 // GetAdditionalMappedFilesForChildProcess a no op on Mac.
34 #if !defined(OS_MACOSX)
35 GetContentClient()->browser()->GetAdditionalMappedFilesForChildProcess(
36 command_line, child_process_id, files_to_register.get());
37 #endif
38
39 return files_to_register;
40 }
41
42 } // namespace internal
43 } // namespace content
OLDNEW
« 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