Index: ipc/ipc_sync_message_filter.cc |
diff --git a/ipc/ipc_sync_message_filter.cc b/ipc/ipc_sync_message_filter.cc |
index e2ea1bfb1ee51394f9d40c7ed79ea93e062c5d63..6a408ec12cf3b044f2426da46f659d640bec9e6d 100644 |
--- a/ipc/ipc_sync_message_filter.cc |
+++ b/ipc/ipc_sync_message_filter.cc |
@@ -7,33 +7,33 @@ |
#include "base/bind.h" |
#include "base/location.h" |
#include "base/logging.h" |
-#include "base/message_loop/message_loop_proxy.h" |
+#include "base/single_thread_task_runner.h" |
#include "base/synchronization/waitable_event.h" |
+#include "base/thread_task_runner_handle.h" |
#include "ipc/ipc_channel.h" |
#include "ipc/ipc_sync_message.h" |
-using base::MessageLoopProxy; |
- |
namespace IPC { |
SyncMessageFilter::SyncMessageFilter(base::WaitableEvent* shutdown_event) |
: sender_(NULL), |
- listener_loop_(MessageLoopProxy::current()), |
+ listener_task_runner_(base::ThreadTaskRunnerHandle::Get()), |
shutdown_event_(shutdown_event) { |
} |
bool SyncMessageFilter::Send(Message* message) { |
{ |
base::AutoLock auto_lock(lock_); |
- if (!io_loop_.get()) { |
+ if (!io_task_runner_.get()) { |
delete message; |
return false; |
} |
} |
if (!message->is_sync()) { |
- io_loop_->PostTask( |
- FROM_HERE, base::Bind(&SyncMessageFilter::SendOnIOThread, this, message)); |
+ io_task_runner_->PostTask( |
+ FROM_HERE, |
+ base::Bind(&SyncMessageFilter::SendOnIOThread, this, message)); |
return true; |
} |
@@ -47,12 +47,14 @@ bool SyncMessageFilter::Send(Message* message) { |
base::AutoLock auto_lock(lock_); |
// Can't use this class on the main thread or else it can lead to deadlocks. |
// Also by definition, can't use this on IO thread since we're blocking it. |
- DCHECK(MessageLoopProxy::current().get() != listener_loop_.get()); |
- DCHECK(MessageLoopProxy::current().get() != io_loop_.get()); |
+ if (base::ThreadTaskRunnerHandle::IsSet()) { |
+ DCHECK(base::ThreadTaskRunnerHandle::Get() != listener_task_runner_); |
+ DCHECK(base::ThreadTaskRunnerHandle::Get() != io_task_runner_); |
+ } |
pending_sync_messages_.insert(&pending_message); |
} |
- io_loop_->PostTask( |
+ io_task_runner_->PostTask( |
FROM_HERE, base::Bind(&SyncMessageFilter::SendOnIOThread, this, message)); |
base::WaitableEvent* events[2] = { shutdown_event_, &done_event }; |
@@ -70,7 +72,7 @@ bool SyncMessageFilter::Send(Message* message) { |
void SyncMessageFilter::OnFilterAdded(Sender* sender) { |
sender_ = sender; |
base::AutoLock auto_lock(lock_); |
- io_loop_ = MessageLoopProxy::current(); |
+ io_task_runner_ = base::ThreadTaskRunnerHandle::Get(); |
} |
void SyncMessageFilter::OnChannelError() { |