Index: mojo/common/data_pipe_utils.h |
diff --git a/mojo/common/data_pipe_utils.h b/mojo/common/data_pipe_utils.h |
index dc2f66a005955cf8f1a0c58d6b4352004dc93193..2917225ada47e02fb09f7aeed9393cb49c5dae2e 100644 |
--- a/mojo/common/data_pipe_utils.h |
+++ b/mojo/common/data_pipe_utils.h |
@@ -5,6 +5,8 @@ |
#ifndef MOJO_SHELL_DATA_PIPE_UTILS_H_ |
#define MOJO_SHELL_DATA_PIPE_UTILS_H_ |
+#include <string> |
+ |
#include "base/callback_forward.h" |
#include "mojo/common/mojo_common_export.h" |
#include "mojo/public/cpp/system/core.h" |
@@ -26,6 +28,14 @@ void MOJO_COMMON_EXPORT CopyToFile( |
base::TaskRunner* task_runner, |
const base::Callback<void(bool /*success*/)>& callback); |
+// Copies the data from |source| into |contents| and returns true on success and |
+// false on error. In case of I/O error, |contents| holds the data that could |
+// be read from source before the error occurred. |
+// If |contents| is NULL, the data is read and discarded. |
darin (slow to review)
2014/08/27 21:30:10
You should document the return value.
darin (slow to review)
2014/08/27 21:51:04
Sorry, my eyes were failing me... what confused me
|
+bool MOJO_COMMON_EXPORT BlockingCopyToString( |
+ ScopedDataPipeConsumerHandle source, |
+ std::string* contents); |
+ |
} // namespace common |
} // namespace mojo |