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

Side by Side Diff: shell/application_manager/data_pipe_peek.cc

Issue 1801793003: Move mojo::{Wait,WaitMany}() to (the newly-added) mojo/public/cpp/system/wait.h. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 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 | « services/tracing/tracing_app.cc ('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 "shell/application_manager/data_pipe_peek.h" 5 #include "shell/application_manager/data_pipe_peek.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "mojo/public/cpp/system/wait.h"
11 12
12 namespace shell { 13 namespace shell {
13 14
14 namespace { 15 namespace {
15 16
16 // Sleep for as long as max_sleep_micros if the deadline hasn't been reached 17 // Sleep for as long as max_sleep_micros if the deadline hasn't been reached
17 // and the number of bytes read is still increasing. Returns true if sleep 18 // and the number of bytes read is still increasing. Returns true if sleep
18 // was actually called. 19 // was actually called.
19 // 20 //
20 // This class is a substitute for being able to wait until N bytes are available 21 // This class is a substitute for being able to wait until N bytes are available
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 150
150 bool BlockingPeekLine(mojo::DataPipeConsumerHandle source, 151 bool BlockingPeekLine(mojo::DataPipeConsumerHandle source,
151 std::string* line, 152 std::string* line,
152 size_t max_line_length, 153 size_t max_line_length,
153 MojoDeadline timeout) { 154 MojoDeadline timeout) {
154 PeekFunc peek_line = base::Bind(PeekLine, max_line_length); 155 PeekFunc peek_line = base::Bind(PeekLine, max_line_length);
155 return BlockingPeekHelper(source, line, timeout, peek_line); 156 return BlockingPeekHelper(source, line, timeout, peek_line);
156 } 157 }
157 158
158 } // namespace shell 159 } // namespace shell
OLDNEW
« no previous file with comments | « services/tracing/tracing_app.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698