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

Unified Diff: base/process_util.h

Issue 67226: Add GetAppOutput function, a better replacement for popen. (Closed)
Patch Set: fixes Created 11 years, 8 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 | « no previous file | base/process_util_posix.cc » ('j') | base/process_util_posix.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util.h
diff --git a/base/process_util.h b/base/process_util.h
index 615e5b62f966b626e4fae908d51736d62a1811a7..367c77215211ce68def500a85d89b25695d65404 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:
« no previous file with comments | « no previous file | base/process_util_posix.cc » ('j') | base/process_util_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698