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

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

Issue 467263006: JavaScript Content Handler Version 0.0 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use chromium application runner Created 6 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 unified diff | Download patch | Annotate | Revision Log
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>
9
8 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
9 #include "mojo/common/mojo_common_export.h" 11 #include "mojo/common/mojo_common_export.h"
10 #include "mojo/public/cpp/system/core.h" 12 #include "mojo/public/cpp/system/core.h"
11 13
12 namespace base { 14 namespace base {
13 class FilePath; 15 class FilePath;
14 class TaskRunner; 16 class TaskRunner;
15 } 17 }
16 18
17 namespace mojo { 19 namespace mojo {
18 namespace common { 20 namespace common {
19 21
20 // Asynchronously copies data from source to the destination file. The given 22 // Asynchronously copies data from source to the destination file. The given
21 // |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
22 // given |task_runner|. 24 // given |task_runner|.
23 void MOJO_COMMON_EXPORT CopyToFile( 25 void MOJO_COMMON_EXPORT CopyToFile(
24 ScopedDataPipeConsumerHandle source, 26 ScopedDataPipeConsumerHandle source,
25 const base::FilePath& destination, 27 const base::FilePath& destination,
26 base::TaskRunner* task_runner, 28 base::TaskRunner* task_runner,
27 const base::Callback<void(bool /*success*/)>& callback); 29 const base::Callback<void(bool /*success*/)>& callback);
28 30
31 bool MOJO_COMMON_EXPORT BlockingCopyToString(
darin (slow to review) 2014/08/26 05:23:23 nit: provide a comment block here, explaining retu
hansmuller 2014/08/26 23:39:12 Done.
32 ScopedDataPipeConsumerHandle source,
33 std::string* contents);
34
29 } // namespace common 35 } // namespace common
30 } // namespace mojo 36 } // namespace mojo
31 37
32 #endif // MOJO_SHELL_DATA_PIPE_UTILS_H_ 38 #endif // MOJO_SHELL_DATA_PIPE_UTILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698