OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <dirent.h> | 5 #include <dirent.h> |
6 #include <errno.h> | 6 #include <errno.h> |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <signal.h> | 8 #include <signal.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <sys/resource.h> | 10 #include <sys/resource.h> |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 } | 649 } |
650 | 650 |
651 bool LaunchProcess(const CommandLine& cmdline, | 651 bool LaunchProcess(const CommandLine& cmdline, |
652 const LaunchOptions& options, | 652 const LaunchOptions& options, |
653 ProcessHandle* process_handle) { | 653 ProcessHandle* process_handle) { |
654 return LaunchProcess(cmdline.argv(), options, process_handle); | 654 return LaunchProcess(cmdline.argv(), options, process_handle); |
655 } | 655 } |
656 | 656 |
657 ProcessMetrics::~ProcessMetrics() { } | 657 ProcessMetrics::~ProcessMetrics() { } |
658 | 658 |
659 void EnableTerminationOnHeapCorruption() { | |
660 // On POSIX, there nothing to do AFAIK. | |
661 } | |
662 | |
663 bool EnableInProcessStackDumping() { | 659 bool EnableInProcessStackDumping() { |
664 // When running in an application, our code typically expects SIGPIPE | 660 // When running in an application, our code typically expects SIGPIPE |
665 // to be ignored. Therefore, when testing that same code, it should run | 661 // to be ignored. Therefore, when testing that same code, it should run |
666 // with SIGPIPE ignored as well. | 662 // with SIGPIPE ignored as well. |
667 struct sigaction action; | 663 struct sigaction action; |
668 action.sa_handler = SIG_IGN; | 664 action.sa_handler = SIG_IGN; |
669 action.sa_flags = 0; | 665 action.sa_flags = 0; |
670 sigemptyset(&action.sa_mask); | 666 sigemptyset(&action.sa_mask); |
671 bool success = (sigaction(SIGPIPE, &action, NULL) == 0); | 667 bool success = (sigaction(SIGPIPE, &action, NULL) == 0); |
672 | 668 |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1057 const ProcessFilter* filter) { | 1053 const ProcessFilter* filter) { |
1058 bool exited_cleanly = | 1054 bool exited_cleanly = |
1059 WaitForProcessesToExit(executable_name, wait_milliseconds, | 1055 WaitForProcessesToExit(executable_name, wait_milliseconds, |
1060 filter); | 1056 filter); |
1061 if (!exited_cleanly) | 1057 if (!exited_cleanly) |
1062 KillProcesses(executable_name, exit_code, filter); | 1058 KillProcesses(executable_name, exit_code, filter); |
1063 return exited_cleanly; | 1059 return exited_cleanly; |
1064 } | 1060 } |
1065 | 1061 |
1066 } // namespace base | 1062 } // namespace base |
OLD | NEW |