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 // 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 15 matching lines...) Expand all Loading... |
26 #include <dirent.h> | 26 #include <dirent.h> |
27 #include <limits.h> | 27 #include <limits.h> |
28 #include <sys/types.h> | 28 #include <sys/types.h> |
29 #endif | 29 #endif |
30 | 30 |
31 #include <list> | 31 #include <list> |
32 #include <string> | 32 #include <string> |
33 #include <utility> | 33 #include <utility> |
34 #include <vector> | 34 #include <vector> |
35 | 35 |
| 36 #include "base/base_api.h" |
36 #include "base/file_descriptor_shuffle.h" | 37 #include "base/file_descriptor_shuffle.h" |
37 #include "base/file_path.h" | 38 #include "base/file_path.h" |
38 #include "base/process.h" | 39 #include "base/process.h" |
39 | 40 |
40 class CommandLine; | 41 class CommandLine; |
41 | 42 |
42 namespace base { | 43 namespace base { |
43 | 44 |
44 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
45 struct ProcessEntry : public PROCESSENTRY32 { | 46 struct ProcessEntry : public PROCESSENTRY32 { |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 // Enables low fragmentation heap (LFH) for every heaps of this process. This | 633 // Enables low fragmentation heap (LFH) for every heaps of this process. This |
633 // won't have any effect on heaps created after this function call. It will not | 634 // won't have any effect on heaps created after this function call. It will not |
634 // modify data allocated in the heaps before calling this function. So it is | 635 // modify data allocated in the heaps before calling this function. So it is |
635 // better to call this function early in initialization and again before | 636 // better to call this function early in initialization and again before |
636 // entering the main loop. | 637 // entering the main loop. |
637 // Note: Returns true on Windows 2000 without doing anything. | 638 // Note: Returns true on Windows 2000 without doing anything. |
638 bool EnableLowFragmentationHeap(); | 639 bool EnableLowFragmentationHeap(); |
639 | 640 |
640 // Enables 'terminate on heap corruption' flag. Helps protect against heap | 641 // Enables 'terminate on heap corruption' flag. Helps protect against heap |
641 // overflow. Has no effect if the OS doesn't provide the necessary facility. | 642 // overflow. Has no effect if the OS doesn't provide the necessary facility. |
642 void EnableTerminationOnHeapCorruption(); | 643 BASE_API void EnableTerminationOnHeapCorruption(); |
643 | 644 |
644 #if !defined(OS_WIN) | 645 #if !defined(OS_WIN) |
645 // Turns on process termination if memory runs out. This is handled on Windows | 646 // Turns on process termination if memory runs out. This is handled on Windows |
646 // inside RegisterInvalidParamHandler(). | 647 // inside RegisterInvalidParamHandler(). |
647 void EnableTerminationOnOutOfMemory(); | 648 void EnableTerminationOnOutOfMemory(); |
648 #if defined(OS_MACOSX) | 649 #if defined(OS_MACOSX) |
649 // Exposed for testing. | 650 // Exposed for testing. |
650 malloc_zone_t* GetPurgeableZone(); | 651 malloc_zone_t* GetPurgeableZone(); |
651 #endif | 652 #endif |
652 #endif | 653 #endif |
(...skipping 16 matching lines...) Expand all Loading... |
669 // instance running inside the parent. The parent's Breakpad instance should | 670 // instance running inside the parent. The parent's Breakpad instance should |
670 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 671 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
671 // in the child after forking will restore the standard exception handler. | 672 // in the child after forking will restore the standard exception handler. |
672 // See http://crbug.com/20371/ for more details. | 673 // See http://crbug.com/20371/ for more details. |
673 void RestoreDefaultExceptionHandler(); | 674 void RestoreDefaultExceptionHandler(); |
674 #endif // defined(OS_MACOSX) | 675 #endif // defined(OS_MACOSX) |
675 | 676 |
676 } // namespace base | 677 } // namespace base |
677 | 678 |
678 #endif // BASE_PROCESS_UTIL_H_ | 679 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |