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

Unified Diff: mojo/data_pipe_utils/data_pipe_utils.h

Issue 1303343007: Created a blocking copy to temporary file function. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Switched to ScopedFILE, formatted Created 5 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/data_pipe_utils/data_pipe_utils.h
diff --git a/mojo/data_pipe_utils/data_pipe_utils.h b/mojo/data_pipe_utils/data_pipe_utils.h
index 289fe12a8eda1b566de9f3db2f1b887fb94d1b60..48c59d9a79a4d2c9d867bd80d1159d8a6ba43492 100644
--- a/mojo/data_pipe_utils/data_pipe_utils.h
+++ b/mojo/data_pipe_utils/data_pipe_utils.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/callback_forward.h"
+#include "base/files/scoped_file.h"
#include "base/threading/platform_thread.h"
#include "mojo/public/cpp/system/core.h"
@@ -42,11 +43,11 @@ bool BlockingCopyToString(ScopedDataPipeConsumerHandle source,
bool BlockingCopyFromString(const std::string& source,
const ScopedDataPipeProducerHandle& destination);
-// Synchronously copies data from source to the destination file returning true
-// on success and false on error. In case of an error, |destination| holds the
-// data that could be read from the source before the error occured.
-bool BlockingCopyToFile(ScopedDataPipeConsumerHandle source,
- const base::FilePath& destination);
+// Synchronously copies source data to a temporary file, returning a file
+// pointer on success and NULL on error. The temporary file is unlinked
+// immediately so that it is only accessible by file pointer (and removed once
+// closed or the creating process dies).
+base::ScopedFILE BlockingCopyToTempFile(ScopedDataPipeConsumerHandle source);
} // namespace common
} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698