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

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

Issue 952413002: The tracing service sometimes creates corrupt data (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | mojo/common/data_pipe_utils.cc » ('j') | services/tracing/trace_data_sink.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 25 matching lines...) Expand all
36 base::TaskRunner* task_runner, 36 base::TaskRunner* task_runner,
37 const base::Callback<void(bool /*success*/)>& callback); 37 const base::Callback<void(bool /*success*/)>& callback);
38 38
39 // 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
40 // 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
41 // be read from source before the error occurred. 41 // be read from source before the error occurred.
42 bool MOJO_COMMON_EXPORT BlockingCopyToString( 42 bool MOJO_COMMON_EXPORT BlockingCopyToString(
43 ScopedDataPipeConsumerHandle source, 43 ScopedDataPipeConsumerHandle source,
44 std::string* contents); 44 std::string* contents);
45 45
46 bool MOJO_COMMON_EXPORT BlockingCopyFromString(
47 const std::string& source,
48 const ScopedDataPipeProducerHandle& destination);
49
46 // Synchronously copies data from source to the destination file returning true 50 // Synchronously copies data from source to the destination file returning true
47 // on success and false on error. In case of an error, |destination| holds the 51 // on success and false on error. In case of an error, |destination| holds the
48 // data that could be read from the source before the error occured. 52 // data that could be read from the source before the error occured.
49 bool MOJO_COMMON_EXPORT BlockingCopyToFile(ScopedDataPipeConsumerHandle source, 53 bool MOJO_COMMON_EXPORT BlockingCopyToFile(ScopedDataPipeConsumerHandle source,
50 const base::FilePath& destination); 54 const base::FilePath& destination);
51 55
52 } // namespace common 56 } // namespace common
53 } // namespace mojo 57 } // namespace mojo
54 58
55 #endif // MOJO_SHELL_DATA_PIPE_UTILS_H_ 59 #endif // MOJO_SHELL_DATA_PIPE_UTILS_H_
OLDNEW
« no previous file with comments | « no previous file | mojo/common/data_pipe_utils.cc » ('j') | services/tracing/trace_data_sink.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698