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 <stdio.h> | 8 #include <stdio.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // pointer on success and NULL on error. The temporary file is unlinked | 48 // pointer on success and NULL on error. The temporary file is unlinked |
49 // immediately so that it is only accessible by file pointer (and removed once | 49 // immediately so that it is only accessible by file pointer (and removed once |
50 // closed or the creating process dies). | 50 // closed or the creating process dies). |
51 base::ScopedFILE BlockingCopyToTempFile(ScopedDataPipeConsumerHandle source); | 51 base::ScopedFILE BlockingCopyToTempFile(ScopedDataPipeConsumerHandle source); |
52 | 52 |
53 // Similar to BlockingCopyToTempFile, but use a pre-defined file pointer | 53 // Similar to BlockingCopyToTempFile, but use a pre-defined file pointer |
54 // (rather than a newly created temp file) and do not unlink the file. | 54 // (rather than a newly created temp file) and do not unlink the file. |
55 // Returns true on success, false on failure. | 55 // Returns true on success, false on failure. |
56 bool BlockingCopyToFile(ScopedDataPipeConsumerHandle source, FILE* fp); | 56 bool BlockingCopyToFile(ScopedDataPipeConsumerHandle source, FILE* fp); |
57 | 57 |
| 58 // Copies the string |contents| to a temporary data pipe and returns the |
| 59 // consumer handle. |
| 60 ScopedDataPipeConsumerHandle WriteStringToConsumerHandle( |
| 61 const std::string& source); |
| 62 |
58 } // namespace common | 63 } // namespace common |
59 } // namespace mojo | 64 } // namespace mojo |
60 | 65 |
61 #endif // MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_ | 66 #endif // MOJO_DATA_PIPE_UTILS_DATA_PIPE_UTILS_H_ |
OLD | NEW |