OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "content/browser/child_process_launcher.h" | 5 #include "content/browser/child_process_launcher.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 157 } |
158 #elif defined(OS_POSIX) | 158 #elif defined(OS_POSIX) |
159 std::string process_type = | 159 std::string process_type = |
160 cmd_line->GetSwitchValueASCII(switches::kProcessType); | 160 cmd_line->GetSwitchValueASCII(switches::kProcessType); |
161 std::unique_ptr<FileDescriptorInfo> files_to_register( | 161 std::unique_ptr<FileDescriptorInfo> files_to_register( |
162 FileDescriptorInfoImpl::Create()); | 162 FileDescriptorInfoImpl::Create()); |
163 | 163 |
164 base::ScopedFD mojo_fd(client_handle.release().handle); | 164 base::ScopedFD mojo_fd(client_handle.release().handle); |
165 DCHECK(mojo_fd.is_valid()); | 165 DCHECK(mojo_fd.is_valid()); |
166 | 166 |
| 167 int field_trial_handle = base::FieldTrialList::GetFieldTrialHandle(); |
| 168 if (field_trial_handle != base::kInvalidPlatformFile) |
| 169 files_to_register->Share(kFieldTrialDescriptor, field_trial_handle); |
167 #if defined(OS_ANDROID) | 170 #if defined(OS_ANDROID) |
168 files_to_register->Share(kMojoIPCChannel, mojo_fd.get()); | 171 files_to_register->Share(kMojoIPCChannel, mojo_fd.get()); |
169 #else | 172 #else |
170 files_to_register->Transfer(kMojoIPCChannel, std::move(mojo_fd)); | 173 files_to_register->Transfer(kMojoIPCChannel, std::move(mojo_fd)); |
171 #endif | 174 #endif |
172 #endif | 175 #endif |
173 | 176 |
174 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 177 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
175 std::map<int, base::MemoryMappedFile::Region> regions; | 178 std::map<int, base::MemoryMappedFile::Region> regions; |
176 GetContentClient()->browser()->GetAdditionalMappedFilesForChildProcess( | 179 GetContentClient()->browser()->GetAdditionalMappedFilesForChildProcess( |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 } | 605 } |
603 | 606 |
604 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( | 607 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( |
605 Client* client) { | 608 Client* client) { |
606 Client* ret = client_; | 609 Client* ret = client_; |
607 client_ = client; | 610 client_ = client; |
608 return ret; | 611 return ret; |
609 } | 612 } |
610 | 613 |
611 } // namespace content | 614 } // namespace content |
OLD | NEW |