| 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 "base/async_socket_io_handler.h" | 5 #include "base/async_socket_io_handler.h" |
| 6 | 6 |
| 7 namespace media { | 7 namespace base { |
| 8 | 8 |
| 9 AsyncSocketIoHandler::AsyncSocketIoHandler() | 9 AsyncSocketIoHandler::AsyncSocketIoHandler() |
| 10 : socket_(base::SyncSocket::kInvalidHandle), | 10 : socket_(base::SyncSocket::kInvalidHandle), |
| 11 context_(NULL), | 11 context_(NULL), |
| 12 is_pending_(false) {} | 12 is_pending_(false) {} |
| 13 | 13 |
| 14 AsyncSocketIoHandler::~AsyncSocketIoHandler() { | 14 AsyncSocketIoHandler::~AsyncSocketIoHandler() { |
| 15 // We need to be deleted on the correct thread to avoid racing with the | 15 // We need to be deleted on the correct thread to avoid racing with the |
| 16 // message loop thread. | 16 // message loop thread. |
| 17 DCHECK(CalledOnValidThread()); | 17 DCHECK(CalledOnValidThread()); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 | 67 |
| 68 base::MessageLoopForIO::current()->RegisterIOHandler(socket, this); | 68 base::MessageLoopForIO::current()->RegisterIOHandler(socket, this); |
| 69 | 69 |
| 70 context_ = new base::MessageLoopForIO::IOContext(); | 70 context_ = new base::MessageLoopForIO::IOContext(); |
| 71 context_->handler = this; | 71 context_->handler = this; |
| 72 memset(&context_->overlapped, 0, sizeof(context_->overlapped)); | 72 memset(&context_->overlapped, 0, sizeof(context_->overlapped)); |
| 73 | 73 |
| 74 return true; | 74 return true; |
| 75 } | 75 } |
| 76 | 76 |
| 77 } // namespace media. | 77 } // namespace base. |
| OLD | NEW |