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

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: Remove mime mapping 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 | « no previous file | mojo/common/data_pipe_utils.cc » ('j') | mojo/common/data_pipe_utils.cc » ('J')
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 10 matching lines...) Expand all
21 21
22 // Asynchronously copies data from source to the destination file. The given 22 // Asynchronously copies data from source to the destination file. The given
23 // |callback| is run upon completion. File writes will be scheduled to the 23 // |callback| is run upon completion. File writes will be scheduled to the
24 // given |task_runner|. 24 // given |task_runner|.
25 void MOJO_COMMON_EXPORT CopyToFile( 25 void MOJO_COMMON_EXPORT CopyToFile(
26 ScopedDataPipeConsumerHandle source, 26 ScopedDataPipeConsumerHandle source,
27 const base::FilePath& destination, 27 const base::FilePath& destination,
28 base::TaskRunner* task_runner, 28 base::TaskRunner* task_runner,
29 const base::Callback<void(bool /*success*/)>& callback); 29 const base::Callback<void(bool /*success*/)>& callback);
30 30
31 void MOJO_COMMON_EXPORT
32 CopyFromFile(const base::FilePath& source,
33 ScopedDataPipeProducerHandle destination,
34 base::TaskRunner* task_runner,
35 const base::Callback<void(bool /*success*/)>& callback);
Aaron Boodman 2014/11/03 19:20:15 This /* syntax */ is something I don't feel that I
qsr 2014/11/04 11:58:34 Acknowledged.
36
31 // Copies the data from |source| into |contents| and returns true on success and 37 // Copies the data from |source| into |contents| and returns true on success and
32 // false on error. In case of I/O error, |contents| holds the data that could 38 // false on error. In case of I/O error, |contents| holds the data that could
33 // be read from source before the error occurred. 39 // be read from source before the error occurred.
34 bool MOJO_COMMON_EXPORT BlockingCopyToString( 40 bool MOJO_COMMON_EXPORT BlockingCopyToString(
35 ScopedDataPipeConsumerHandle source, 41 ScopedDataPipeConsumerHandle source,
36 std::string* contents); 42 std::string* contents);
37 43
38 } // namespace common 44 } // namespace common
39 } // namespace mojo 45 } // namespace mojo
40 46
41 #endif // MOJO_SHELL_DATA_PIPE_UTILS_H_ 47 #endif // MOJO_SHELL_DATA_PIPE_UTILS_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/common/data_pipe_utils.cc » ('j') | mojo/common/data_pipe_utils.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698