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

Side by Side Diff: content/browser/child_process_launcher_posix.cc

Issue 2594203004: Unifying ChildProcessLauncher across platforms. (Closed)
Patch Set: Addressed boliu@'s comments. 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 2016 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_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
17 std::unique_ptr<FileDescriptorInfo> CreateDefaultPosixFilesToMap(
18 const base::CommandLine& command_line,
19 int child_process_id,
20 const mojo::edk::PlatformHandle& mojo_client_handle) {
21 std::unique_ptr<FileDescriptorInfo> files_to_register(
22 FileDescriptorInfoImpl::Create());
23
24 int field_trial_handle = base::FieldTrialList::GetFieldTrialHandle();
25 if (field_trial_handle != base::kInvalidPlatformFile)
26 files_to_register->Share(kFieldTrialDescriptor, field_trial_handle);
27
28 DCHECK(mojo_client_handle.is_valid());
29 files_to_register->Share(kMojoIPCChannel, mojo_client_handle.handle);
30
31 // TODO(jcivelli): remove this "if defined" by making
32 // GetAdditionalMappedFilesForChildProcess a no op on Mac.
33 #if !defined(OS_MACOSX)
34 GetContentClient()->browser()->GetAdditionalMappedFilesForChildProcess(
35 command_line, child_process_id, files_to_register.get());
36 #endif
37
38 return files_to_register;
39 }
40
41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698