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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 #if defined(OS_MACOSX) | 376 #if defined(OS_MACOSX) |
377 | 377 |
378 // After a successful call to LaunchProcess with LaunchOptions::synchronize | 378 // After a successful call to LaunchProcess with LaunchOptions::synchronize |
379 // set, the parent process must call LaunchSynchronize to allow the child | 379 // set, the parent process must call LaunchSynchronize to allow the child |
380 // process to proceed, and to destroy the LaunchSynchronizationHandle. | 380 // process to proceed, and to destroy the LaunchSynchronizationHandle. |
381 BASE_EXPORT void LaunchSynchronize(LaunchSynchronizationHandle handle); | 381 BASE_EXPORT void LaunchSynchronize(LaunchSynchronizationHandle handle); |
382 | 382 |
383 #endif // defined(OS_MACOSX) | 383 #endif // defined(OS_MACOSX) |
384 #endif // defined(OS_POSIX) | 384 #endif // defined(OS_POSIX) |
385 | 385 |
| 386 #if defined(OS_WIN) |
| 387 // Set JOBOBJECT_EXTENDED_LIMIT_INFORMATION to JobObject |job_object|. |
| 388 // As its limit_info.BasicLimitInformation.LimitFlags has |
| 389 // JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE. |
| 390 // When the provide JobObject |job_object| is closed, the binded process will |
| 391 // be terminated. |
| 392 BASE_EXPORT bool SetJobObjectAsKillOnJobClose(HANDLE job_object); |
| 393 #endif // defined(OS_WIN) |
| 394 |
386 // Executes the application specified by |cl| and wait for it to exit. Stores | 395 // Executes the application specified by |cl| and wait for it to exit. Stores |
387 // the output (stdout) in |output|. Redirects stderr to /dev/null. Returns true | 396 // the output (stdout) in |output|. Redirects stderr to /dev/null. Returns true |
388 // on success (application launched and exited cleanly, with exit code | 397 // on success (application launched and exited cleanly, with exit code |
389 // indicating success). | 398 // indicating success). |
390 BASE_EXPORT bool GetAppOutput(const CommandLine& cl, std::string* output); | 399 BASE_EXPORT bool GetAppOutput(const CommandLine& cl, std::string* output); |
391 | 400 |
392 #if defined(OS_POSIX) | 401 #if defined(OS_POSIX) |
393 // A restricted version of |GetAppOutput()| which (a) clears the environment, | 402 // A restricted version of |GetAppOutput()| which (a) clears the environment, |
394 // and (b) stores at most |max_output| bytes; also, it doesn't search the path | 403 // and (b) stores at most |max_output| bytes; also, it doesn't search the path |
395 // for the command. | 404 // for the command. |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 // instance running inside the parent. The parent's Breakpad instance should | 814 // instance running inside the parent. The parent's Breakpad instance should |
806 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 815 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
807 // in the child after forking will restore the standard exception handler. | 816 // in the child after forking will restore the standard exception handler. |
808 // See http://crbug.com/20371/ for more details. | 817 // See http://crbug.com/20371/ for more details. |
809 void RestoreDefaultExceptionHandler(); | 818 void RestoreDefaultExceptionHandler(); |
810 #endif // defined(OS_MACOSX) | 819 #endif // defined(OS_MACOSX) |
811 | 820 |
812 } // namespace base | 821 } // namespace base |
813 | 822 |
814 #endif // BASE_PROCESS_UTIL_H_ | 823 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |