OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "media/audio/async_socket_io_handler.h" | 5 #include "media/audio/async_socket_io_handler.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include "base/eintr_wrapper.h" | 8 |
| 9 #include "base/posix/eintr_wrapper.h" |
9 | 10 |
10 namespace media { | 11 namespace media { |
11 | 12 |
12 AsyncSocketIoHandler::AsyncSocketIoHandler() | 13 AsyncSocketIoHandler::AsyncSocketIoHandler() |
13 : socket_(base::SyncSocket::kInvalidHandle), | 14 : socket_(base::SyncSocket::kInvalidHandle), |
14 pending_buffer_(NULL), | 15 pending_buffer_(NULL), |
15 pending_buffer_len_(0), | 16 pending_buffer_len_(0), |
16 is_watching_(false) { | 17 is_watching_(false) { |
17 } | 18 } |
18 | 19 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 88 |
88 void AsyncSocketIoHandler::EnsureWatchingSocket() { | 89 void AsyncSocketIoHandler::EnsureWatchingSocket() { |
89 DCHECK(CalledOnValidThread()); | 90 DCHECK(CalledOnValidThread()); |
90 if (!is_watching_ && socket_ != base::SyncSocket::kInvalidHandle) { | 91 if (!is_watching_ && socket_ != base::SyncSocket::kInvalidHandle) { |
91 is_watching_ = MessageLoopForIO::current()->WatchFileDescriptor( | 92 is_watching_ = MessageLoopForIO::current()->WatchFileDescriptor( |
92 socket_, true, MessageLoopForIO::WATCH_READ, &socket_watcher_, this); | 93 socket_, true, MessageLoopForIO::WATCH_READ, &socket_watcher_, this); |
93 } | 94 } |
94 } | 95 } |
95 | 96 |
96 } // namespace media. | 97 } // namespace media. |
OLD | NEW |