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 // This file/namespace contains utility functions for enumerating, ending and | 5 // This file/namespace contains utility functions for enumerating, ending and |
6 // computing statistics of processes. | 6 // computing statistics of processes. |
7 | 7 |
8 #ifndef BASE_PROCESS_UTIL_H_ | 8 #ifndef BASE_PROCESS_UTIL_H_ |
9 #define BASE_PROCESS_UTIL_H_ | 9 #define BASE_PROCESS_UTIL_H_ |
10 #pragma once | 10 #pragma once |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #if defined(RENDERER_CLEAN_EXIT) |
| 14 #include "base/atomicops.h" |
| 15 #endif // defined(RENDERER_CLEAN_EXIT) |
13 | 16 |
14 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
15 #include <windows.h> | 18 #include <windows.h> |
16 #include <tlhelp32.h> | 19 #include <tlhelp32.h> |
17 #elif defined(OS_MACOSX) || defined(OS_BSD) | 20 #elif defined(OS_MACOSX) || defined(OS_BSD) |
18 // kinfo_proc is defined in <sys/sysctl.h>, but this forward declaration | 21 // kinfo_proc is defined in <sys/sysctl.h>, but this forward declaration |
19 // is sufficient for the vector<kinfo_proc> below. | 22 // is sufficient for the vector<kinfo_proc> below. |
20 struct kinfo_proc; | 23 struct kinfo_proc; |
21 // malloc_zone_t is defined in <malloc/malloc.h>, but this forward declaration | 24 // malloc_zone_t is defined in <malloc/malloc.h>, but this forward declaration |
22 // is sufficient for GetPurgeableZone() below. | 25 // is sufficient for GetPurgeableZone() below. |
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 // Restore the default exception handler, setting it to Apple Crash Reporter | 835 // Restore the default exception handler, setting it to Apple Crash Reporter |
833 // (ReportCrash). When forking and execing a new process, the child will | 836 // (ReportCrash). When forking and execing a new process, the child will |
834 // inherit the parent's exception ports, which may be set to the Breakpad | 837 // inherit the parent's exception ports, which may be set to the Breakpad |
835 // instance running inside the parent. The parent's Breakpad instance should | 838 // instance running inside the parent. The parent's Breakpad instance should |
836 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 839 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
837 // in the child after forking will restore the standard exception handler. | 840 // in the child after forking will restore the standard exception handler. |
838 // See http://crbug.com/20371/ for more details. | 841 // See http://crbug.com/20371/ for more details. |
839 void RestoreDefaultExceptionHandler(); | 842 void RestoreDefaultExceptionHandler(); |
840 #endif // defined(OS_MACOSX) | 843 #endif // defined(OS_MACOSX) |
841 | 844 |
| 845 #if defined(RENDERER_CLEAN_EXIT) |
| 846 extern base::subtle::Atomic32 exit_counter; |
| 847 |
| 848 BASE_EXPORT void clean_exit(int return_value); |
| 849 #endif // defined(RENDERER_CLEAN_EXIT) |
| 850 |
842 } // namespace base | 851 } // namespace base |
843 | 852 |
844 #endif // BASE_PROCESS_UTIL_H_ | 853 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |