OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/system/raw_channel.h" | 5 #include "mojo/system/raw_channel.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <sys/uio.h> | 8 #include <sys/uio.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 | 10 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
202 if (read_result > 0) { | 202 if (read_result > 0) { |
203 *bytes_read = static_cast<size_t>(read_result); | 203 *bytes_read = static_cast<size_t>(read_result); |
204 return IO_SUCCEEDED; | 204 return IO_SUCCEEDED; |
205 } | 205 } |
206 | 206 |
207 // |read_result == 0| means "end of file". | 207 // |read_result == 0| means "end of file". |
208 if (read_result == 0 || (errno != EAGAIN && errno != EWOULDBLOCK)) { | 208 if (read_result == 0 || (errno != EAGAIN && errno != EWOULDBLOCK)) { |
209 PLOG_IF(WARNING, read_result != 0) << "recvmsg"; | 209 DVLOG_IF(1, read_result != 0) << "recvmsg"; |
210 | 210 |
211 // Make sure that |OnFileCanReadWithoutBlocking()| won't be called again. | 211 // Make sure that |OnFileCanReadWithoutBlocking()| won't be called again. |
212 read_watcher_.reset(); | 212 read_watcher_.reset(); |
213 | 213 |
214 return IO_FAILED; | 214 return IO_FAILED; |
215 } | 215 } |
216 | 216 |
217 return ScheduleRead(); | 217 return ScheduleRead(); |
218 } | 218 } |
219 | 219 |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 | 463 |
464 // Static factory method declared in raw_channel.h. | 464 // Static factory method declared in raw_channel.h. |
465 // static | 465 // static |
466 scoped_ptr<RawChannel> RawChannel::Create( | 466 scoped_ptr<RawChannel> RawChannel::Create( |
467 embedder::ScopedPlatformHandle handle) { | 467 embedder::ScopedPlatformHandle handle) { |
468 return scoped_ptr<RawChannel>(new RawChannelPosix(handle.Pass())); | 468 return scoped_ptr<RawChannel>(new RawChannelPosix(handle.Pass())); |
469 } | 469 } |
470 | 470 |
471 } // namespace system | 471 } // namespace system |
472 } // namespace mojo | 472 } // namespace mojo |
OLD | NEW |