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

Unified Diff: base/process_util_win.cc

Issue 10808069: Remove old test timeout and process waiting function interfaces. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix nits. Created 8 years, 5 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_posix.cc ('k') | base/test/test_timeouts.h » ('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 55d2959c10813a6297e5b9e73418eb85e6d42389..313b187294980b03d6cd2924b227dafc7bd523bd 100644
--- a/base/process_util_win.cc
+++ b/base/process_util_win.cc
@@ -546,8 +546,8 @@ bool WaitForExitCode(ProcessHandle handle, int* exit_code) {
}
bool WaitForExitCodeWithTimeout(ProcessHandle handle, int* exit_code,
- int64 timeout_milliseconds) {
- if (::WaitForSingleObject(handle, timeout_milliseconds) != WAIT_OBJECT_0)
+ base::TimeDelta timeout) {
+ if (::WaitForSingleObject(handle, timeout.InMilliseconds()) != WAIT_OBJECT_0)
return false;
DWORD temp_code; // Don't clobber out-parameters in case of failure.
if (!::GetExitCodeProcess(handle, &temp_code))
@@ -557,12 +557,6 @@ bool WaitForExitCodeWithTimeout(ProcessHandle handle, int* exit_code,
return true;
}
-bool WaitForExitCodeWithTimeout(ProcessHandle handle, int* exit_code,
- base::TimeDelta timeout) {
- return WaitForExitCodeWithTimeout(
- handle, exit_code, timeout.InMilliseconds());
-}
-
ProcessIterator::ProcessIterator(const ProcessFilter* filter)
: started_iteration_(false),
filter_(filter) {
@@ -596,7 +590,7 @@ bool NamedProcessIterator::IncludeEntry() {
}
bool WaitForProcessesToExit(const FilePath::StringType& executable_name,
- int64 wait_milliseconds,
+ base::TimeDelta wait,
const ProcessFilter* filter) {
const ProcessEntry* entry;
bool result = true;
@@ -604,8 +598,8 @@ bool WaitForProcessesToExit(const FilePath::StringType& executable_name,
NamedProcessIterator iter(executable_name, filter);
while ((entry = iter.NextProcessEntry())) {
- DWORD remaining_wait =
- std::max<int64>(0, wait_milliseconds - (GetTickCount() - start_time));
+ DWORD remaining_wait = std::max<int64>(
+ 0, wait.InMilliseconds() - (GetTickCount() - start_time));
HANDLE process = OpenProcess(SYNCHRONIZE,
FALSE,
entry->th32ProcessID);
@@ -617,17 +611,6 @@ bool WaitForProcessesToExit(const FilePath::StringType& executable_name,
return result;
}
-bool WaitForProcessesToExit(const FilePath::StringType& executable_name,
- base::TimeDelta wait,
- const ProcessFilter* filter) {
- return WaitForProcessesToExit(executable_name, wait.InMilliseconds(), filter);
-}
-
-bool WaitForSingleProcess(ProcessHandle handle, int64 wait_milliseconds) {
- return WaitForSingleProcess(
- handle, base::TimeDelta::FromMilliseconds(wait_milliseconds));
-}
-
bool WaitForSingleProcess(ProcessHandle handle, base::TimeDelta wait) {
int exit_code;
if (!WaitForExitCodeWithTimeout(handle, &exit_code, wait))
@@ -639,9 +622,10 @@ bool CleanupProcesses(const FilePath::StringType& executable_name,
int64 wait_milliseconds,
int exit_code,
const ProcessFilter* filter) {
- bool exited_cleanly = WaitForProcessesToExit(executable_name,
- wait_milliseconds,
- filter);
+ bool exited_cleanly = WaitForProcessesToExit(
+ executable_name,
+ base::TimeDelta::FromMilliseconds(wait_milliseconds),
+ filter);
if (!exited_cleanly)
KillProcesses(executable_name, exit_code, filter);
return exited_cleanly;
« no previous file with comments | « base/process_util_posix.cc ('k') | base/test/test_timeouts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698