Chromium Code Reviews| Index: base/process_util_win.cc |
| diff --git a/base/process_util_win.cc b/base/process_util_win.cc |
| index 85aeace7f091a6e64697e5331ed3e3e68f8ab508..afba56df58edb2e0053c94bde828c6add02950d1 100644 |
| --- a/base/process_util_win.cc |
| +++ b/base/process_util_win.cc |
| @@ -305,6 +305,16 @@ bool LaunchProcess(const CommandLine& cmdline, |
| return LaunchProcess(cmdline.GetCommandLineString(), options, process_handle); |
| } |
| +bool SetJobObjectAsKillOnJobClose(HANDLE job_object) { |
| + JOBOBJECT_EXTENDED_LIMIT_INFORMATION limit_info = {0}; |
| + limit_info.BasicLimitInformation.LimitFlags = |
| + JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE; |
| + if (0 == SetInformationJobObject(job_object, |
|
M-A Ruel
2011/11/23 03:01:40
style nit: (optional)
return 0 != SetInformationJ
Takashi Toyoshima
2011/11/23 04:36:55
Done.
|
| + JobObjectExtendedLimitInformation, &limit_info, sizeof(limit_info))) |
| + return false; |
| + return true; |
| +} |
| + |
| // Attempts to kill the process identified by the given process |
| // entry structure, giving it the specified exit code. |
| // Returns true if this is successful, false otherwise. |