Index: ipc/ipc_sync_message_filter.cc |
diff --git a/ipc/ipc_sync_message_filter.cc b/ipc/ipc_sync_message_filter.cc |
index d86835d11973ec5427cd7a461652fc32dbf06ae9..f6d485dd4b77d96ec81ba4395142ecb7750d0179 100644 |
--- a/ipc/ipc_sync_message_filter.cc |
+++ b/ipc/ipc_sync_message_filter.cc |
@@ -15,17 +15,14 @@ |
namespace IPC { |
-SyncMessageFilter::SyncMessageFilter(base::WaitableEvent* shutdown_event) |
- : sender_(NULL), |
- listener_task_runner_(base::ThreadTaskRunnerHandle::Get()), |
- shutdown_event_(shutdown_event) { |
-} |
- |
bool SyncMessageFilter::Send(Message* message) { |
if (!message->is_sync()) { |
{ |
base::AutoLock auto_lock(lock_); |
- if (!io_task_runner_.get()) { |
+ if (sender_ && is_channel_send_thread_safe_) { |
+ sender_->Send(message); |
+ return true; |
+ } else if (!io_task_runner_.get()) { |
pending_messages_.push_back(message); |
return true; |
} |
@@ -112,6 +109,14 @@ bool SyncMessageFilter::OnMessageReceived(const Message& message) { |
return false; |
} |
+SyncMessageFilter::SyncMessageFilter(base::WaitableEvent* shutdown_event, |
+ bool is_channel_send_thread_safe) |
+ : sender_(NULL), |
+ is_channel_send_thread_safe_(is_channel_send_thread_safe), |
+ listener_task_runner_(base::ThreadTaskRunnerHandle::Get()), |
+ shutdown_event_(shutdown_event) { |
+} |
+ |
SyncMessageFilter::~SyncMessageFilter() { |
} |