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 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 BASE_EXPORT extern size_t g_oom_size; | 139 BASE_EXPORT extern size_t g_oom_size; |
140 #endif | 140 #endif |
141 | 141 |
142 // Returns the id of the current process. | 142 // Returns the id of the current process. |
143 BASE_EXPORT ProcessId GetCurrentProcId(); | 143 BASE_EXPORT ProcessId GetCurrentProcId(); |
144 | 144 |
145 // Returns the ProcessHandle of the current process. | 145 // Returns the ProcessHandle of the current process. |
146 BASE_EXPORT ProcessHandle GetCurrentProcessHandle(); | 146 BASE_EXPORT ProcessHandle GetCurrentProcessHandle(); |
147 | 147 |
148 #if defined(OS_WIN) | 148 #if defined(OS_WIN) |
149 // Returns the module handle to which an address belongs. | 149 // Returns the module handle to which an address belongs. The reference counter |
| 150 // of the module is not incremented. |
150 BASE_EXPORT HMODULE GetModuleFromAddress(void* address); | 151 BASE_EXPORT HMODULE GetModuleFromAddress(void* address); |
151 #endif | 152 #endif |
152 | 153 |
153 // Converts a PID to a process handle. This handle must be closed by | 154 // Converts a PID to a process handle. This handle must be closed by |
154 // CloseProcessHandle when you are done with it. Returns true on success. | 155 // CloseProcessHandle when you are done with it. Returns true on success. |
155 BASE_EXPORT bool OpenProcessHandle(ProcessId pid, ProcessHandle* handle); | 156 BASE_EXPORT bool OpenProcessHandle(ProcessId pid, ProcessHandle* handle); |
156 | 157 |
157 // Converts a PID to a process handle. On Windows the handle is opened | 158 // Converts a PID to a process handle. On Windows the handle is opened |
158 // with more access rights and must only be used by trusted code. | 159 // with more access rights and must only be used by trusted code. |
159 // You have to close returned handle using CloseProcessHandle. Returns true | 160 // You have to close returned handle using CloseProcessHandle. Returns true |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
838 // instance running inside the parent. The parent's Breakpad instance should | 839 // instance running inside the parent. The parent's Breakpad instance should |
839 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 840 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
840 // in the child after forking will restore the standard exception handler. | 841 // in the child after forking will restore the standard exception handler. |
841 // See http://crbug.com/20371/ for more details. | 842 // See http://crbug.com/20371/ for more details. |
842 void RestoreDefaultExceptionHandler(); | 843 void RestoreDefaultExceptionHandler(); |
843 #endif // defined(OS_MACOSX) | 844 #endif // defined(OS_MACOSX) |
844 | 845 |
845 } // namespace base | 846 } // namespace base |
846 | 847 |
847 #endif // BASE_PROCESS_UTIL_H_ | 848 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |