OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 #endif // defined(OS_MACOSX) | 214 #endif // defined(OS_MACOSX) |
215 | 215 |
216 process = base::LaunchProcess(*cmd_line, options); | 216 process = base::LaunchProcess(*cmd_line, options); |
217 | 217 |
218 #if defined(OS_MACOSX) | 218 #if defined(OS_MACOSX) |
219 if (ShouldEnableBootstrapSandbox() && | 219 if (ShouldEnableBootstrapSandbox() && |
220 bootstrap_sandbox_policy != SANDBOX_TYPE_INVALID) { | 220 bootstrap_sandbox_policy != SANDBOX_TYPE_INVALID) { |
221 GetBootstrapSandbox()->FinishedFork(process.Handle()); | 221 GetBootstrapSandbox()->FinishedFork(process.Handle()); |
222 } | 222 } |
223 | 223 |
224 if (process.IsValid()) | 224 if (process.IsValid()) { |
225 broker->AddPlaceholderForPid(process.Pid(), child_process_id); | 225 broker->AddPlaceholderForPid(process.Pid(), child_process_id, |
| 226 process_type == switches::kGpuProcess); |
| 227 } |
226 | 228 |
227 // After updating the broker, release the lock and let the child's | 229 // After updating the broker, release the lock and let the child's |
228 // messasge be processed on the broker's thread. | 230 // messasge be processed on the broker's thread. |
229 broker->GetLock().Release(); | 231 broker->GetLock().Release(); |
230 #endif // defined(OS_MACOSX) | 232 #endif // defined(OS_MACOSX) |
231 } | 233 } |
232 #endif // else defined(OS_POSIX) | 234 #endif // else defined(OS_POSIX) |
233 #if !defined(OS_ANDROID) | 235 #if !defined(OS_ANDROID) |
234 if (process.IsValid()) { | 236 if (process.IsValid()) { |
235 RecordHistogramsOnLauncherThread(base::TimeTicks::Now() - | 237 RecordHistogramsOnLauncherThread(base::TimeTicks::Now() - |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 } | 495 } |
494 | 496 |
495 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( | 497 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( |
496 Client* client) { | 498 Client* client) { |
497 Client* ret = client_; | 499 Client* ret = client_; |
498 client_ = client; | 500 client_ = client; |
499 return ret; | 501 return ret; |
500 } | 502 } |
501 | 503 |
502 } // namespace content | 504 } // namespace content |
OLD | NEW |