OLD | NEW |
---|---|
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/shell/data_pipe_peek.h" | 5 #include "mojo/shell/data_pipe_peek.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <algorithm> | |
danakj
2015/11/17 19:09:27
whitespace between these (cuz they are diff sets a
dcheng
2015/11/17 20:21:03
Done.
| |
8 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 | 12 |
12 namespace mojo { | 13 namespace mojo { |
13 namespace shell { | 14 namespace shell { |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 // Sleep for as long as max_sleep_micros if the deadline hasn't been reached | 18 // Sleep for as long as max_sleep_micros if the deadline hasn't been reached |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
151 bool BlockingPeekLine(DataPipeConsumerHandle source, | 152 bool BlockingPeekLine(DataPipeConsumerHandle source, |
152 std::string* line, | 153 std::string* line, |
153 size_t max_line_length, | 154 size_t max_line_length, |
154 MojoDeadline timeout) { | 155 MojoDeadline timeout) { |
155 PeekFunc peek_line = base::Bind(PeekLine, max_line_length); | 156 PeekFunc peek_line = base::Bind(PeekLine, max_line_length); |
156 return BlockingPeekHelper(source, line, timeout, peek_line); | 157 return BlockingPeekHelper(source, line, timeout, peek_line); |
157 } | 158 } |
158 | 159 |
159 } // namespace shell | 160 } // namespace shell |
160 } // namespace mojo | 161 } // namespace mojo |
OLD | NEW |