Index: ipc/ipc_channel_proxy.cc |
=================================================================== |
--- ipc/ipc_channel_proxy.cc (revision 270662) |
+++ ipc/ipc_channel_proxy.cc (working copy) |
@@ -64,6 +64,10 @@ |
#endif |
if (message_filter_router_->TryFilters(message)) { |
+ if (message.dispatch_error()) { |
+ listener_task_runner_->PostTask( |
+ FROM_HERE, base::Bind(&Context::OnDispatchBadMessage, this, message)); |
+ } |
#ifdef IPC_MESSAGE_LOG_ENABLED |
if (logger->Enabled()) |
logger->OnPostDispatchMessage(message, channel_id_); |
@@ -267,6 +271,8 @@ |
#endif |
listener_->OnMessageReceived(message); |
+ if (message.dispatch_error()) |
+ listener_->OnBadMessageReceived(message); |
#ifdef IPC_MESSAGE_LOG_ENABLED |
if (logger->Enabled()) |
@@ -290,6 +296,12 @@ |
listener_->OnChannelError(); |
} |
+// Called on the listener's thread |
+void ChannelProxy::Context::OnDispatchBadMessage(const Message& message) { |
+ if (listener_) |
+ listener_->OnBadMessageReceived(message); |
+} |
+ |
//----------------------------------------------------------------------------- |
ChannelProxy::ChannelProxy(const IPC::ChannelHandle& channel_handle, |