diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-23 18:03:29 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-23 18:03:29 +0000 |
commit | 569b1106f62d531c11f857f08961f41efe2b272e (patch) | |
tree | c9a4d93a65b16317604e544854f5ee9a15751896 /base | |
parent | 423bd5b84aee7a02b62e4e4d8a83d7df6c0943d9 (diff) | |
download | chromium_src-569b1106f62d531c11f857f08961f41efe2b272e.zip chromium_src-569b1106f62d531c11f857f08961f41efe2b272e.tar.gz chromium_src-569b1106f62d531c11f857f08961f41efe2b272e.tar.bz2 |
Porting in chrome/
Review URL: http://codereview.chromium.org/18446
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8560 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/process_util.h | 3 | ||||
-rw-r--r-- | base/process_util_posix.cc | 4 | ||||
-rw-r--r-- | base/process_util_win.cc | 6 |
3 files changed, 12 insertions, 1 deletions
diff --git a/base/process_util.h b/base/process_util.h index f00016e..4cadafc 100644 --- a/base/process_util.h +++ b/base/process_util.h @@ -61,6 +61,9 @@ int GetCurrentProcId(); // Returns the ProcessHandle of the current process. ProcessHandle GetCurrentProcessHandle(); +// Closes given process handle. Returns true on success. +bool CloseProcessHandle(ProcessHandle process); + // Returns the unique ID for the specified process. This is functionally the // same as Windows' GetProcessId(), but works on versions of Windows before // Win XP SP1 as well. diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc index 87a4e36..9dbb2e6 100644 --- a/base/process_util_posix.cc +++ b/base/process_util_posix.cc @@ -30,6 +30,10 @@ ProcessHandle GetCurrentProcessHandle() { return GetCurrentProcId(); } +bool CloseProcessHandle(ProcessHandle process) { + return true; +} + int GetProcId(ProcessHandle process) { return process; } diff --git a/base/process_util_win.cc b/base/process_util_win.cc index f1fd72c..e725e56 100644 --- a/base/process_util_win.cc +++ b/base/process_util_win.cc @@ -33,6 +33,10 @@ ProcessHandle GetCurrentProcessHandle() { return ::GetCurrentProcess(); } +bool CloseProcessHandle(ProcessHandle process) { + return ::CloseHandle(process) ? true : false; +} + // Helper for GetProcId() bool GetProcIdViaGetProcessId(ProcessHandle process, DWORD* id) { // Dynamically get a pointer to GetProcessId(). @@ -188,7 +192,7 @@ bool DidProcessCrash(ProcessHandle handle) { // Warning, this is not generic code; it heavily depends on the way // the rest of the code kills a process. - + if (exitcode == PROCESS_END_NORMAL_TERMINATON || exitcode == PROCESS_END_KILLED_BY_USER || exitcode == PROCESS_END_PROCESS_WAS_HUNG || |