OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "base/process/kill.h" | 5 #include "base/process/kill.h" |
6 | 6 |
7 #include <signal.h> | 7 #include <signal.h> |
8 #include <sys/types.h> | 8 #include <sys/types.h> |
9 #include <sys/wait.h> | 9 #include <sys/wait.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 << ", ident=" << event.ident; | 352 << ", ident=" << event.ident; |
353 return false; | 353 return false; |
354 } | 354 } |
355 | 355 |
356 return true; | 356 return true; |
357 } | 357 } |
358 #endif // OS_MACOSX | 358 #endif // OS_MACOSX |
359 | 359 |
360 bool WaitForSingleProcess(ProcessHandle handle, base::TimeDelta wait) { | 360 bool WaitForSingleProcess(ProcessHandle handle, base::TimeDelta wait) { |
361 ProcessHandle parent_pid = GetParentProcessId(handle); | 361 ProcessHandle parent_pid = GetParentProcessId(handle); |
362 ProcessHandle our_pid = Process::Current().handle(); | 362 ProcessHandle our_pid = GetCurrentProcessHandle(); |
363 if (parent_pid != our_pid) { | 363 if (parent_pid != our_pid) { |
364 #if defined(OS_MACOSX) | 364 #if defined(OS_MACOSX) |
365 // On Mac we can wait on non child processes. | 365 // On Mac we can wait on non child processes. |
366 return WaitForSingleNonChildProcess(handle, wait); | 366 return WaitForSingleNonChildProcess(handle, wait); |
367 #else | 367 #else |
368 // Currently on Linux we can't handle non child processes. | 368 // Currently on Linux we can't handle non child processes. |
369 NOTIMPLEMENTED(); | 369 NOTIMPLEMENTED(); |
370 #endif // OS_MACOSX | 370 #endif // OS_MACOSX |
371 } | 371 } |
372 | 372 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 return; | 479 return; |
480 | 480 |
481 BackgroundReaper* reaper = new BackgroundReaper(process, 0); | 481 BackgroundReaper* reaper = new BackgroundReaper(process, 0); |
482 PlatformThread::CreateNonJoinable(0, reaper); | 482 PlatformThread::CreateNonJoinable(0, reaper); |
483 } | 483 } |
484 | 484 |
485 #endif // !defined(OS_MACOSX) | 485 #endif // !defined(OS_MACOSX) |
486 #endif // !defined(__native_client_nonsfi__) | 486 #endif // !defined(__native_client_nonsfi__) |
487 | 487 |
488 } // namespace base | 488 } // namespace base |
OLD | NEW |