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

Side by Side Diff: mojo/common/data_pipe_utils.h

Issue 694303002: Allow local file to run though content handler. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Follow review Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « mojo/common/BUILD.gn ('k') | mojo/common/data_pipe_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_SHELL_DATA_PIPE_UTILS_H_ 5 #ifndef MOJO_SHELL_DATA_PIPE_UTILS_H_
6 #define MOJO_SHELL_DATA_PIPE_UTILS_H_ 6 #define MOJO_SHELL_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 11 matching lines...) Expand all
22 22
23 // Asynchronously copies data from source to the destination file. The given 23 // Asynchronously copies data from source to the destination file. The given
24 // |callback| is run upon completion. File writes will be scheduled to the 24 // |callback| is run upon completion. File writes will be scheduled to the
25 // given |task_runner|. 25 // given |task_runner|.
26 void MOJO_COMMON_EXPORT CopyToFile( 26 void MOJO_COMMON_EXPORT CopyToFile(
27 ScopedDataPipeConsumerHandle source, 27 ScopedDataPipeConsumerHandle source,
28 const base::FilePath& destination, 28 const base::FilePath& destination,
29 base::TaskRunner* task_runner, 29 base::TaskRunner* task_runner,
30 const base::Callback<void(bool /*success*/)>& callback); 30 const base::Callback<void(bool /*success*/)>& callback);
31 31
32 void MOJO_COMMON_EXPORT
33 CopyFromFile(const base::FilePath& source,
34 ScopedDataPipeProducerHandle destination,
35 uint32_t skip,
36 base::TaskRunner* task_runner,
37 const base::Callback<void(bool /*success*/)>& callback);
38
32 // Copies the data from |source| into |contents| and returns true on success and 39 // Copies the data from |source| into |contents| and returns true on success and
33 // false on error. In case of I/O error, |contents| holds the data that could 40 // false on error. In case of I/O error, |contents| holds the data that could
34 // be read from source before the error occurred. 41 // be read from source before the error occurred.
35 bool MOJO_COMMON_EXPORT BlockingCopyToString( 42 bool MOJO_COMMON_EXPORT BlockingCopyToString(
36 ScopedDataPipeConsumerHandle source, 43 ScopedDataPipeConsumerHandle source,
37 std::string* contents); 44 std::string* contents);
38 45
39 } // namespace common 46 } // namespace common
40 } // namespace mojo 47 } // namespace mojo
41 48
42 #endif // MOJO_SHELL_DATA_PIPE_UTILS_H_ 49 #endif // MOJO_SHELL_DATA_PIPE_UTILS_H_
OLDNEW
« no previous file with comments | « mojo/common/BUILD.gn ('k') | mojo/common/data_pipe_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698