| Index: ipc/ipc_channel_proxy.cc
|
| diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
|
| index 0202e9e27ef665d13fe5dc30c01737fe5aaa1106..d5a965192f100f0fd6ad014e9f71814fc8b9cfa4 100644
|
| --- a/ipc/ipc_channel_proxy.cc
|
| +++ b/ipc/ipc_channel_proxy.cc
|
| @@ -68,6 +68,18 @@ void ChannelProxy::Context::CreateChannel(const IPC::ChannelHandle& handle,
|
| channel_.reset(new Channel(handle, mode, this));
|
| }
|
|
|
| +void ChannelProxy::Context::SendFailedSyncMessageReply(const Message& message) {
|
| + if (!message.is_sync())
|
| + return;
|
| +
|
| + Message* reply = SyncMessage::GenerateReply(&message);
|
| + reply->set_reply_error();
|
| + ipc_task_runner()->PostTask(
|
| + FROM_HERE,
|
| + base::Bind(&ChannelProxy::Context::OnSendMessage,
|
| + this, base::Passed(scoped_ptr<Message>(reply))));
|
| +}
|
| +
|
| bool ChannelProxy::Context::TryFilters(const Message& message) {
|
| #ifdef IPC_MESSAGE_LOG_ENABLED
|
| Logging* logger = Logging::GetInstance();
|
| @@ -243,14 +255,17 @@ void ChannelProxy::Context::OnDispatchMessage(const Message& message) {
|
| "line", IPC_MESSAGE_ID_LINE(message.type()));
|
| #endif
|
|
|
| - if (!listener_)
|
| + if (!listener_) {
|
| + SendFailedSyncMessageReply(message);
|
| return;
|
| + }
|
|
|
| OnDispatchConnected();
|
|
|
| #ifdef IPC_MESSAGE_LOG_ENABLED
|
| if (message.type() == IPC_LOGGING_ID) {
|
| logger->OnReceivedLoggingMessage(message);
|
| + SendFailedSyncMessageReply(message);
|
| return;
|
| }
|
|
|
| @@ -258,7 +273,8 @@ void ChannelProxy::Context::OnDispatchMessage(const Message& message) {
|
| logger->OnPreDispatchMessage(message);
|
| #endif
|
|
|
| - listener_->OnMessageReceived(message);
|
| + if (!listener_->OnMessageReceived(message))
|
| + SendFailedSyncMessageReply(message);
|
|
|
| #ifdef IPC_MESSAGE_LOG_ENABLED
|
| if (logger->Enabled())
|
|
|