| 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 "ipc/mojo/ipc_message_pipe_reader.h" | 5 #include "ipc/mojo/ipc_message_pipe_reader.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/message_loop/message_loop_proxy.h" | 11 #include "base/single_thread_task_runner.h" |
| 12 #include "base/thread_task_runner_handle.h" |
| 12 #include "ipc/mojo/async_handle_waiter.h" | 13 #include "ipc/mojo/async_handle_waiter.h" |
| 13 #include "ipc/mojo/ipc_channel_mojo.h" | 14 #include "ipc/mojo/ipc_channel_mojo.h" |
| 14 | 15 |
| 15 namespace IPC { | 16 namespace IPC { |
| 16 namespace internal { | 17 namespace internal { |
| 17 | 18 |
| 18 MessagePipeReader::MessagePipeReader(mojo::ScopedMessagePipeHandle handle, | 19 MessagePipeReader::MessagePipeReader(mojo::ScopedMessagePipeHandle handle, |
| 19 MessagePipeReader::Delegate* delegate) | 20 MessagePipeReader::Delegate* delegate) |
| 20 : pipe_(handle.Pass()), | 21 : pipe_(handle.Pass()), |
| 21 delegate_(delegate), | 22 delegate_(delegate), |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 Close(); | 215 Close(); |
| 215 return; | 216 return; |
| 216 } | 217 } |
| 217 | 218 |
| 218 ReadMessagesThenWait(); | 219 ReadMessagesThenWait(); |
| 219 } | 220 } |
| 220 | 221 |
| 221 void MessagePipeReader::DelayedDeleter::operator()( | 222 void MessagePipeReader::DelayedDeleter::operator()( |
| 222 MessagePipeReader* ptr) const { | 223 MessagePipeReader* ptr) const { |
| 223 ptr->Close(); | 224 ptr->Close(); |
| 224 base::MessageLoopProxy::current()->PostTask( | 225 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, |
| 225 FROM_HERE, base::Bind(&DeleteNow, ptr)); | 226 base::Bind(&DeleteNow, ptr)); |
| 226 } | 227 } |
| 227 | 228 |
| 228 } // namespace internal | 229 } // namespace internal |
| 229 } // namespace IPC | 230 } // namespace IPC |
| OLD | NEW |