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

Unified Diff: base/process/kill_posix.cc

Issue 957183002: Remove base::WaitForExitCode* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
Index: base/process/kill_posix.cc
diff --git a/base/process/kill_posix.cc b/base/process/kill_posix.cc
index 77705eeb6789b0a53a81ae11c468b2270e3a736e..5873cab57f782fb423b143b320e6d7e402825294 100644
--- a/base/process/kill_posix.cc
+++ b/base/process/kill_posix.cc
@@ -50,7 +50,7 @@ bool WaitpidWithTimeout(ProcessHandle handle,
// This function is used primarily for unit tests, if we want to use it in
// the application itself it would probably be best to examine other routes.
- if (wait.InMilliseconds() == base::kNoTimeout) {
+ if (wait.InMilliseconds() == base::internal::kNoTimeout) {
return HANDLE_EINTR(waitpid(handle, status, 0)) > 0;
}
@@ -92,7 +92,7 @@ bool WaitpidWithTimeout(ProcessHandle handle,
static bool WaitForSingleNonChildProcess(ProcessHandle handle,
TimeDelta wait) {
DCHECK_GT(handle, 0);
- DCHECK(wait.InMilliseconds() == kNoTimeout || wait > TimeDelta());
+ DCHECK(wait.InMilliseconds() == internal::kNoTimeout || wait > TimeDelta());
ScopedFD kq(kqueue());
if (!kq.is_valid()) {
@@ -115,7 +115,7 @@ static bool WaitForSingleNonChildProcess(ProcessHandle handle,
// Keep track of the elapsed time to be able to restart kevent if it's
// interrupted.
- bool wait_forever = wait.InMilliseconds() == kNoTimeout;
+ bool wait_forever = (wait.InMilliseconds() == internal::kNoTimeout);
TimeDelta remaining_delta;
TimeTicks deadline;
if (!wait_forever) {
@@ -302,26 +302,9 @@ TerminationStatus GetKnownDeadTerminationStatus(ProcessHandle handle,
}
#if !defined(OS_NACL_NONSFI)
-bool WaitForExitCode(ProcessHandle handle, int* exit_code) {
- int status;
- if (HANDLE_EINTR(waitpid(handle, &status, 0)) == -1) {
- NOTREACHED();
- return false;
- }
-
- if (WIFEXITED(status)) {
- *exit_code = WEXITSTATUS(status);
- return true;
- }
-
- // If it didn't exit cleanly, it must have been signaled.
- DCHECK(WIFSIGNALED(status));
- return false;
-}
-
-bool WaitForExitCodeWithTimeout(ProcessHandle handle,
- int* exit_code,
- TimeDelta timeout) {
+bool internal::WaitForExitCodeWithTimeout(ProcessHandle handle,
+ int* exit_code,
+ TimeDelta timeout) {
ProcessHandle parent_pid = GetParentProcessId(handle);
ProcessHandle our_pid = GetCurrentProcessHandle();
if (parent_pid != our_pid) {
« base/process/kill.h ('K') | « base/process/kill.h ('k') | base/process/kill_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698