Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2038)

Unified Diff: base/process_util_win.cc

Issue 8667006: Extract similar code into SetJobObjectAsKillOnJobClose() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process_util.h ('k') | chrome/common/chrome_content_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_win.cc
diff --git a/base/process_util_win.cc b/base/process_util_win.cc
index 891dc3b6378b330637a406ba10f3236cbe8a03c3..ff9d3fd2533c229a9b4186ca698a52523ad6b391 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -362,6 +362,17 @@ 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;
+ return 0 != SetInformationJobObject(
+ job_object,
+ JobObjectExtendedLimitInformation,
+ &limit_info,
+ sizeof(limit_info));
+}
+
// 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.
« no previous file with comments | « base/process_util.h ('k') | chrome/common/chrome_content_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698