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

Unified Diff: mojo/common/data_pipe_utils.h

Issue 467263006: JavaScript Content Handler Version 0.0 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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
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..dc2197b6e07fd14a7d1f08ec4da610e852367a5c 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,13 @@ 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.
+bool MOJO_COMMON_EXPORT BlockingCopyToString(
+ ScopedDataPipeConsumerHandle source,
+ std::string* contents);
+
} // namespace common
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698