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

Unified Diff: mojo/data_pipe_utils/data_pipe_file_utils.cc

Issue 1382713002: Creating a pexe content handler to translate and run pexes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Tests Added Created 5 years, 2 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/data_pipe_utils/data_pipe_file_utils.cc
diff --git a/mojo/data_pipe_utils/data_pipe_file_utils.cc b/mojo/data_pipe_utils/data_pipe_file_utils.cc
index 08b24a3bf9b1ba9a241171eb4f8ca1019545b3d4..3a4170db4a3e2a8d0b252208cb139be84059ba41 100644
--- a/mojo/data_pipe_utils/data_pipe_file_utils.cc
+++ b/mojo/data_pipe_utils/data_pipe_file_utils.cc
@@ -335,6 +335,22 @@ base::ScopedFILE BlockingCopyToTempFile(ScopedDataPipeConsumerHandle source) {
return fp;
}
+base::FilePath BlockingCopyToNewTempFile(ScopedDataPipeConsumerHandle source) {
+ base::FilePath path;
+ base::ScopedFILE fp(CreateAndOpenTemporaryFile(&path));
+ if (!fp) {
+ LOG(ERROR) << "CreateAndOpenTemporaryFile failed in"
+ << "BlockingCopyToTempFile";
+ return base::FilePath("");
+ }
+ if (!BlockingCopyHelper(source.Pass(),
+ base::Bind(&CopyToFileHelper, fp.get()))) {
+ LOG(ERROR) << "Could not copy source to temporary file";
+ return base::FilePath("");
+ }
+ return path;
+}
+
void CopyToFile(ScopedDataPipeConsumerHandle source,
const base::FilePath& destination,
base::TaskRunner* task_runner,

Powered by Google App Engine
This is Rietveld 408576698