| 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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 // Enables 'terminate on heap corruption' flag. Helps protect against heap | 668 // Enables 'terminate on heap corruption' flag. Helps protect against heap |
| 669 // overflow. Has no effect if the OS doesn't provide the necessary facility. | 669 // overflow. Has no effect if the OS doesn't provide the necessary facility. |
| 670 BASE_API void EnableTerminationOnHeapCorruption(); | 670 BASE_API void EnableTerminationOnHeapCorruption(); |
| 671 | 671 |
| 672 #if !defined(OS_WIN) | 672 #if !defined(OS_WIN) |
| 673 // Turns on process termination if memory runs out. This is handled on Windows | 673 // Turns on process termination if memory runs out. This is handled on Windows |
| 674 // inside RegisterInvalidParamHandler(). | 674 // inside RegisterInvalidParamHandler(). |
| 675 BASE_API void EnableTerminationOnOutOfMemory(); | 675 BASE_API void EnableTerminationOnOutOfMemory(); |
| 676 #if defined(OS_MACOSX) | 676 #if defined(OS_MACOSX) |
| 677 // Exposed for testing. | 677 // Exposed for testing. |
| 678 malloc_zone_t* GetPurgeableZone(); | 678 BASE_API malloc_zone_t* GetPurgeableZone(); |
| 679 #endif | 679 #endif |
| 680 #endif | 680 #endif |
| 681 | 681 |
| 682 // Enables stack dump to console output on exception and signals. | 682 // Enables stack dump to console output on exception and signals. |
| 683 // When enabled, the process will quit immediately. This is meant to be used in | 683 // When enabled, the process will quit immediately. This is meant to be used in |
| 684 // unit_tests only! | 684 // unit_tests only! |
| 685 BASE_API bool EnableInProcessStackDumping(); | 685 BASE_API bool EnableInProcessStackDumping(); |
| 686 | 686 |
| 687 // If supported on the platform, and the user has sufficent rights, increase | 687 // If supported on the platform, and the user has sufficent rights, increase |
| 688 // the current process's scheduling priority to a high priority. | 688 // the current process's scheduling priority to a high priority. |
| 689 BASE_API void RaiseProcessToHighPriority(); | 689 BASE_API void RaiseProcessToHighPriority(); |
| 690 | 690 |
| 691 #if defined(OS_MACOSX) | 691 #if defined(OS_MACOSX) |
| 692 // Restore the default exception handler, setting it to Apple Crash Reporter | 692 // Restore the default exception handler, setting it to Apple Crash Reporter |
| 693 // (ReportCrash). When forking and execing a new process, the child will | 693 // (ReportCrash). When forking and execing a new process, the child will |
| 694 // inherit the parent's exception ports, which may be set to the Breakpad | 694 // inherit the parent's exception ports, which may be set to the Breakpad |
| 695 // instance running inside the parent. The parent's Breakpad instance should | 695 // instance running inside the parent. The parent's Breakpad instance should |
| 696 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 696 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
| 697 // in the child after forking will restore the standard exception handler. | 697 // in the child after forking will restore the standard exception handler. |
| 698 // See http://crbug.com/20371/ for more details. | 698 // See http://crbug.com/20371/ for more details. |
| 699 void RestoreDefaultExceptionHandler(); | 699 void RestoreDefaultExceptionHandler(); |
| 700 #endif // defined(OS_MACOSX) | 700 #endif // defined(OS_MACOSX) |
| 701 | 701 |
| 702 } // namespace base | 702 } // namespace base |
| 703 | 703 |
| 704 #endif // BASE_PROCESS_UTIL_H_ | 704 #endif // BASE_PROCESS_UTIL_H_ |
| OLD | NEW |