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

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: 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 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.
« 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