Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Unified Diff: ipc/ipc_channel_proxy.cc

Issue 283313002: Ensure that any IPC sent from a child process that couldn't be deserialized causes that p… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: switch to histograms Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/ipc_channel_proxy.h ('k') | ipc/ipc_channel_reader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « ipc/ipc_channel_proxy.h ('k') | ipc/ipc_channel_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698