OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_ | 5 #ifndef MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_ |
6 #define MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_ | 6 #define MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 | 41 |
42 bool BlockingCopyFromString(const std::string& source, | 42 bool BlockingCopyFromString(const std::string& source, |
43 const ScopedDataPipeProducerHandle& destination); | 43 const ScopedDataPipeProducerHandle& destination); |
44 | 44 |
45 // Synchronously copies data from source to the destination file returning true | 45 // Synchronously copies data from source to the destination file returning true |
46 // on success and false on error. In case of an error, |destination| holds the | 46 // on success and false on error. In case of an error, |destination| holds the |
47 // data that could be read from the source before the error occured. | 47 // data that could be read from the source before the error occured. |
48 bool BlockingCopyToFile(ScopedDataPipeConsumerHandle source, | 48 bool BlockingCopyToFile(ScopedDataPipeConsumerHandle source, |
49 const base::FilePath& destination); | 49 const base::FilePath& destination); |
50 | 50 |
| 51 // Similar to BlockingCopyToFile, but copies source data to a temporary |
| 52 // file which is unlinked immediately so that it is only accessible by |
| 53 // file descriptor (and removed once closed or the creating process dies). |
| 54 bool BlockingCopyToTempFile(ScopedDataPipeConsumerHandle source, |
| 55 FILE** fpp); |
| 56 |
51 } // namespace common | 57 } // namespace common |
52 } // namespace mojo | 58 } // namespace mojo |
53 | 59 |
54 #endif // MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_ | 60 #endif // MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_ |
OLD | NEW |