summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authoragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-21 20:28:21 +0000
committeragl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-21 20:28:21 +0000
commit1c36b962d877273125d92c4996a136fc1ac7e806 (patch)
treec140284241c1236eab8d7292f4a3e48226b5a857 /base
parentd6a16564e95db8cab49f9761e4864b3fcc013cd9 (diff)
downloadchromium_src-1c36b962d877273125d92c4996a136fc1ac7e806.zip
chromium_src-1c36b962d877273125d92c4996a136fc1ac7e806.tar.gz
chromium_src-1c36b962d877273125d92c4996a136fc1ac7e806.tar.bz2
* Revert "POSIX: Get render_process_host to build."
* Revert "Build fix: release builds seemed to break" Review URL: http://codereview.chromium.org/18460 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/process_util.h3
-rw-r--r--base/process_util_win.cc25
2 files changed, 11 insertions, 17 deletions
diff --git a/base/process_util.h b/base/process_util.h
index f00016e..ae38c5a 100644
--- a/base/process_util.h
+++ b/base/process_util.h
@@ -139,9 +139,6 @@ bool KillProcesses(const std::wstring& executable_name, int exit_code,
// for the process to be actually terminated before returning.
// Returns true if this is successful, false otherwise.
bool KillProcess(int process_id, int exit_code, bool wait);
-#if defined(OS_WIN)
-bool KillProcess(HANDLE process, int exit_code, bool wait);
-#endif
// Get the termination status (exit code) of the process and return true if the
// status indicates the process crashed. It is an error to call this if the
diff --git a/base/process_util_win.cc b/base/process_util_win.cc
index f1fd72c..a69f5d5 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -153,24 +153,21 @@ bool LaunchApp(const CommandLine& cl,
// entry structure, giving it the specified exit code.
// Returns true if this is successful, false otherwise.
bool KillProcess(int process_id, int exit_code, bool wait) {
+ bool result = false;
HANDLE process = OpenProcess(PROCESS_TERMINATE | SYNCHRONIZE,
FALSE, // Don't inherit handle
process_id);
- if (process)
- return KillProcess(process, exit_code, wait);
- return false;
-}
-
-bool KillProcess(HANDLE process, int exit_code, bool wait) {
- bool result = !!TerminateProcess(process, exit_code);
- if (result && wait) {
- // The process may not end immediately due to pending I/O
- if (WAIT_OBJECT_0 != WaitForSingleObject(process, 60 * 1000))
- DLOG(ERROR) << "Error waiting for process exit: " << GetLastError();
- } else {
- DLOG(ERROR) << "Unable to terminate process: " << GetLastError();
+ if (process) {
+ result = !!TerminateProcess(process, exit_code);
+ if (result && wait) {
+ // The process may not end immediately due to pending I/O
+ if (WAIT_OBJECT_0 != WaitForSingleObject(process, 60 * 1000))
+ DLOG(ERROR) << "Error waiting for process exit: " << GetLastError();
+ } else {
+ DLOG(ERROR) << "Unable to terminate process: " << GetLastError();
+ }
+ CloseHandle(process);
}
- CloseHandle(process);
return result;
}