summaryrefslogtreecommitdiffstats
path: root/base/process_util.h
diff options
context:
space:
mode:
authortoyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-23 23:37:19 +0000
committertoyoshim@chromium.org <toyoshim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-23 23:37:19 +0000
commitb330cab36b67a7a3c75b52bdf9fc907858dbfced (patch)
treefc7367f6abe66f56c2f8c0fed8e58688935078a6 /base/process_util.h
parent1d3a1d21edc4e338e19f9132c406a8ee2860de31 (diff)
downloadchromium_src-b330cab36b67a7a3c75b52bdf9fc907858dbfced.zip
chromium_src-b330cab36b67a7a3c75b52bdf9fc907858dbfced.tar.gz
chromium_src-b330cab36b67a7a3c75b52bdf9fc907858dbfced.tar.bz2
Extract similar code into SetJobObjectAsKillOnJobClose()
For now, Chromium have five same code in various place to handle JobObject as KILL_ON_JOB_CLOSE. This change provide a common utility function to be used by them. BUG=n/a TEST=n/a; run existing unit tests because this is just a refactoring change Review URL: http://codereview.chromium.org/8667006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111441 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util.h')
-rw-r--r--base/process_util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/base/process_util.h b/base/process_util.h
index 874e656..3c9dfbe 100644
--- a/base/process_util.h
+++ b/base/process_util.h
@@ -383,6 +383,15 @@ BASE_EXPORT void LaunchSynchronize(LaunchSynchronizationHandle handle);
#endif // defined(OS_MACOSX)
#endif // defined(OS_POSIX)
+#if defined(OS_WIN)
+// Set JOBOBJECT_EXTENDED_LIMIT_INFORMATION to JobObject |job_object|.
+// As its limit_info.BasicLimitInformation.LimitFlags has
+// JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.
+// When the provide JobObject |job_object| is closed, the binded process will
+// be terminated.
+BASE_EXPORT bool SetJobObjectAsKillOnJobClose(HANDLE job_object);
+#endif // defined(OS_WIN)
+
// Executes the application specified by |cl| and wait for it to exit. Stores
// the output (stdout) in |output|. Redirects stderr to /dev/null. Returns true
// on success (application launched and exited cleanly, with exit code