summaryrefslogtreecommitdiffstats
path: root/base/process_util.h
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-17 09:57:52 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-17 09:57:52 +0000
commitc0b210ee445f489f34a6565f51adb62f10988562 (patch)
tree0f9fd1d1061927fcd4865d0e951858473ceab398 /base/process_util.h
parent3b3cc646c182ca1578e745c110ba47af34468b15 (diff)
downloadchromium_src-c0b210ee445f489f34a6565f51adb62f10988562.zip
chromium_src-c0b210ee445f489f34a6565f51adb62f10988562.tar.gz
chromium_src-c0b210ee445f489f34a6565f51adb62f10988562.tar.bz2
Add GetAppOutput function, a better replacement for popen.
It will replace popen call in chrome_process_util_linux. I don't see much benefit in having a Windows implementation (not many useful programs you can launch and get output), so POSIX-only. Review URL: http://codereview.chromium.org/67226 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13920 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util.h')
-rw-r--r--base/process_util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/base/process_util.h b/base/process_util.h
index 615e5b6..367c772 100644
--- a/base/process_util.h
+++ b/base/process_util.h
@@ -124,6 +124,14 @@ bool LaunchApp(const std::vector<std::string>& argv,
bool LaunchApp(const CommandLine& cl,
bool wait, bool start_hidden, ProcessHandle* process_handle);
+#if defined(OS_POSIX)
+// Execute the application specified by |cl| and wait for it to exit. Store
+// the output (stdout and stderr) in |output|. Returns true on success
+// (application launched and exited cleanly, with exit code indicating success).
+// |output| is modified only when the function finished successfully.
+bool GetAppOutput(const CommandLine& cl, std::string* output);
+#endif // defined(OS_POSIX)
+
// Used to filter processes by process ID.
class ProcessFilter {
public: