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

Unified Diff: base/process_util_win.cc

Issue 16814: POSIX: Get render_process_host to build. (Closed)
Patch Set: Created 11 years, 11 months 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/browser/browser.scons » ('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 a69f5d5fdc8a51a935cc6bc5abf581688f79d97c..f1fd72caa5a2e478e82bcff86a11aebbd37a46f9 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -153,21 +153,24 @@ 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) {
- 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);
+ 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();
}
+ CloseHandle(process);
return result;
}
« no previous file with comments | « base/process_util.h ('k') | chrome/browser/browser.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698