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

Side by Side Diff: base/process_util_posix.cc

Issue 3945002: Move debug-related stuff from base to the base/debug directory and use the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « base/process_util_mac.mm ('k') | base/process_util_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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>
11 #include <sys/time.h> 11 #include <sys/time.h>
12 #include <sys/types.h> 12 #include <sys/types.h>
13 #include <sys/wait.h> 13 #include <sys/wait.h>
14 #include <unistd.h> 14 #include <unistd.h>
15 15
16 #include <limits> 16 #include <limits>
17 #include <set> 17 #include <set>
18 18
19 #include "base/command_line.h" 19 #include "base/command_line.h"
20 #include "base/compiler_specific.h" 20 #include "base/compiler_specific.h"
21 #include "base/debug_util.h" 21 #include "base/debug/stack_trace.h"
22 #include "base/dir_reader_posix.h" 22 #include "base/dir_reader_posix.h"
23 #include "base/eintr_wrapper.h" 23 #include "base/eintr_wrapper.h"
24 #include "base/logging.h" 24 #include "base/logging.h"
25 #include "base/platform_thread.h" 25 #include "base/platform_thread.h"
26 #include "base/process_util.h" 26 #include "base/process_util.h"
27 #include "base/scoped_ptr.h" 27 #include "base/scoped_ptr.h"
28 #include "base/stringprintf.h" 28 #include "base/stringprintf.h"
29 #include "base/time.h" 29 #include "base/time.h"
30 #include "base/waitable_event.h" 30 #include "base/waitable_event.h"
31 31
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 97
98 if (success) 98 if (success)
99 *success = (ret_pid != -1); 99 *success = (ret_pid != -1);
100 100
101 return status; 101 return status;
102 } 102 }
103 103
104 void StackDumpSignalHandler(int signal) { 104 void StackDumpSignalHandler(int signal) {
105 LOG(ERROR) << "Received signal " << signal; 105 LOG(ERROR) << "Received signal " << signal;
106 StackTrace().PrintBacktrace(); 106 debug::StackTrace().PrintBacktrace();
107 _exit(1); 107 _exit(1);
108 } 108 }
109 109
110 void ResetChildSignalHandlersToDefaults() { 110 void ResetChildSignalHandlersToDefaults() {
111 // The previous signal handlers are likely to be meaningless in the child's 111 // The previous signal handlers are likely to be meaningless in the child's
112 // context so we reset them to the defaults for now. http://crbug.com/44953 112 // context so we reset them to the defaults for now. http://crbug.com/44953
113 // These signal handlers are setup in browser_main.cc:BrowserMain 113 // These signal handlers are setup in browser_main.cc:BrowserMain
114 signal(SIGTERM, SIG_DFL); 114 signal(SIGTERM, SIG_DFL);
115 signal(SIGHUP, SIG_DFL); 115 signal(SIGHUP, SIG_DFL);
116 signal(SIGINT, SIG_DFL); 116 signal(SIGINT, SIG_DFL);
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 const ProcessFilter* filter) { 847 const ProcessFilter* filter) {
848 bool exited_cleanly = 848 bool exited_cleanly =
849 WaitForProcessesToExit(executable_name, wait_milliseconds, 849 WaitForProcessesToExit(executable_name, wait_milliseconds,
850 filter); 850 filter);
851 if (!exited_cleanly) 851 if (!exited_cleanly)
852 KillProcesses(executable_name, exit_code, filter); 852 KillProcesses(executable_name, exit_code, filter);
853 return exited_cleanly; 853 return exited_cleanly;
854 } 854 }
855 855
856 } // namespace base 856 } // namespace base
OLDNEW
« no previous file with comments | « base/process_util_mac.mm ('k') | base/process_util_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698