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

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

Issue 694253003: win: pull gyp for gn generation (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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 | « DEPS ('k') | no next file » | 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 #include "mojo/common/data_pipe_utils.h" 5 #include "mojo/common/data_pipe_utils.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 MOJO_DEADLINE_INDEFINITE); 93 MOJO_DEADLINE_INDEFINITE);
94 if (result != MOJO_RESULT_OK) { 94 if (result != MOJO_RESULT_OK) {
95 // If the consumer handle was closed, then treat as EOF. 95 // If the consumer handle was closed, then treat as EOF.
96 return result == MOJO_RESULT_FAILED_PRECONDITION; 96 return result == MOJO_RESULT_FAILED_PRECONDITION;
97 } 97 }
98 } else { 98 } else {
99 // If the consumer handle was closed, then treat as EOF. 99 // If the consumer handle was closed, then treat as EOF.
100 return result == MOJO_RESULT_FAILED_PRECONDITION; 100 return result == MOJO_RESULT_FAILED_PRECONDITION;
101 } 101 }
102 } 102 }
103 #if !defined(OS_WIN)
103 NOTREACHED(); 104 NOTREACHED();
104 return false; 105 return false;
106 #endif
105 } 107 }
106 108
107 } // namespace 109 } // namespace
108 110
109 // TODO(hansmuller): Add a max_size parameter. 111 // TODO(hansmuller): Add a max_size parameter.
110 bool BlockingCopyToString(ScopedDataPipeConsumerHandle source, 112 bool BlockingCopyToString(ScopedDataPipeConsumerHandle source,
111 std::string* result) { 113 std::string* result) {
112 CHECK(result); 114 CHECK(result);
113 result->clear(); 115 result->clear();
114 return BlockingCopyHelper( 116 return BlockingCopyHelper(
(...skipping 26 matching lines...) Expand all
141 base::TaskRunner* task_runner, 143 base::TaskRunner* task_runner,
142 const base::Callback<void(bool)>& callback) { 144 const base::Callback<void(bool)>& callback) {
143 base::PostTaskAndReplyWithResult(task_runner, FROM_HERE, 145 base::PostTaskAndReplyWithResult(task_runner, FROM_HERE,
144 base::Bind(&BlockingCopyFromFile, source, 146 base::Bind(&BlockingCopyFromFile, source,
145 base::Passed(&destination), skip), 147 base::Passed(&destination), skip),
146 callback); 148 callback);
147 } 149 }
148 150
149 } // namespace common 151 } // namespace common
150 } // namespace mojo 152 } // namespace mojo
OLDNEW
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698