Index: ipc/ipc_sync_message_filter.cc |
diff --git a/ipc/ipc_sync_message_filter.cc b/ipc/ipc_sync_message_filter.cc |
index da883f6fd6876d45cb01af08453cc8f76944b970..6504aee7ceb42fd9c557ccf805c31820d820340e 100644 |
--- a/ipc/ipc_sync_message_filter.cc |
+++ b/ipc/ipc_sync_message_filter.cc |
@@ -19,10 +19,7 @@ bool SyncMessageFilter::Send(Message* message) { |
if (!message->is_sync()) { |
{ |
base::AutoLock auto_lock(lock_); |
- if (sender_ && is_channel_send_thread_safe_) { |
- sender_->Send(message); |
- return true; |
- } else if (!io_task_runner_.get()) { |
+ if (!io_task_runner_.get()) { |
pending_messages_.push_back(message); |
return true; |
} |
@@ -117,6 +114,19 @@ bool SyncMessageFilter::OnMessageReceived(const Message& message) { |
return false; |
} |
+bool SyncMessageFilter::SendNow(std::unique_ptr<Message> message) { |
+ if (!message->is_sync()) { |
+ base::AutoLock auto_lock(lock_); |
+ if (sender_ && is_channel_send_thread_safe_) { |
+ sender_->Send(message.release()); |
+ return true; |
+ } |
+ } |
+ |
+ // Fall back on default Send behavior. |
+ return Send(message.release()); |
+} |
+ |
SyncMessageFilter::SyncMessageFilter(base::WaitableEvent* shutdown_event, |
bool is_channel_send_thread_safe) |
: sender_(NULL), |