diff options
author | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 03:15:40 +0000 |
---|---|---|
committer | viettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 03:15:40 +0000 |
commit | 5ba734feb58a92cff1a1c7cddcfaa8cd57cfda39 (patch) | |
tree | a3ddd580a901ccff1c7a33a8cdc99f5ed3bd7a17 /base/process_util.h | |
parent | ec5c192817606b55ad99edb256997b70eea41b85 (diff) | |
download | chromium_src-5ba734feb58a92cff1a1c7cddcfaa8cd57cfda39.zip chromium_src-5ba734feb58a92cff1a1c7cddcfaa8cd57cfda39.tar.gz chromium_src-5ba734feb58a92cff1a1c7cddcfaa8cd57cfda39.tar.bz2 |
Revert 52613 - Revert 52608 - Add and alternative GetAppOutput() to process_util that takes a timeout.
[Undoing the revert to see if the failure wasn't a flake.... Revert if the
original failure, below, occurs again.]
["base_unittests" didn't exit cleanly on "Chromium Linux x64" but was killed due
to timeout.]
Contributed by tessamac@chromium.org
TEST=none
BUG=47356
Review URL: http://codereview.chromium.org/2810014
Patch from Tessa MacDuff <tessamac@chromium.org>.
TBR=viettrungluu@chromium.org, tessamac@chromium.org
Review URL: http://codereview.chromium.org/3012004
TBR=viettrungluu@chromium.org, tessamac@chromium.org
Review URL: http://codereview.chromium.org/3036023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53903 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util.h')
-rw-r--r-- | base/process_util.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/base/process_util.h b/base/process_util.h index d7ff940..a230f5d 100644 --- a/base/process_util.h +++ b/base/process_util.h @@ -86,6 +86,9 @@ struct IoCounters { // A minimalistic but hopefully cross-platform set of exit codes. // Do not change the enumeration values or you will break third-party // installers. +// Warning: This enum is duplicated and extended in chrome/common/result_codes.h +// The two must be kept in sync and users of that enum would prefer the +// numbering didn't change. enum { PROCESS_END_NORMAL_TERMINATION = 0, PROCESS_END_KILLED_BY_USER = 1, @@ -240,6 +243,15 @@ bool LaunchApp(const CommandLine& cl, bool GetAppOutput(const CommandLine& cl, std::string* output); #if defined(OS_POSIX) +// Similar to |GetAppOutput()|. Returns true if process launched and +// exited cleanly, with exit code indicating success. Waits no more than +// |timeout_milliseconds| for the launched process to exit. After timeout +// is triggered, the process is killed and true is stored in |timed_out|. +// Will wait for process to die so this may overrun |timeout_milliseconds|. +// TODO(tessamac): implement this for windows. +bool GetAppOutputWithTimeout(const CommandLine& cl, std::string* output, + bool* timed_out, int timeout_milliseconds); + // A restricted version of |GetAppOutput()| which (a) clears the environment, // and (b) stores at most |max_output| bytes; also, it doesn't search the path // for the command. |