summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_message_macros.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-24 06:19:28 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-24 06:19:28 +0000
commita95986a837fc86e079b5c6dac357636478b50092 (patch)
tree66a32009250791e64741216cdd6c21ecf1ff7f86 /ipc/ipc_message_macros.h
parent125a7ba65ad10ace9edcf36d6943ce9ae2bdc1d6 (diff)
downloadchromium_src-a95986a837fc86e079b5c6dac357636478b50092.zip
chromium_src-a95986a837fc86e079b5c6dac357636478b50092.tar.gz
chromium_src-a95986a837fc86e079b5c6dac357636478b50092.tar.bz2
Make IPC::Channel::Listener:OnMessageReceived have a return value indicating whether a message was processed or not.
TBR=brettw Review URL: http://codereview.chromium.org/5978003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70139 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_message_macros.h')
-rw-r--r--ipc/ipc_message_macros.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h
index 504be00..af2901a 100644
--- a/ipc/ipc_message_macros.h
+++ b/ipc/ipc_message_macros.h
@@ -1163,23 +1163,22 @@ LogFunctionMap g_log_function_mapping;
// Prefer to use the IPC_BEGIN_MESSAGE_MAP_EX to the older macros since they
// allow you to detect when a message could not be de-serialized. Usage:
//
-// void MyClass::OnMessageReceived(const IPC::Message& msg) {
+// bool MyClass::OnMessageReceived(const IPC::Message& msg) {
+// bool handled = true;
// bool msg_is_good = false;
// IPC_BEGIN_MESSAGE_MAP_EX(MyClass, msg, msg_is_good)
// IPC_MESSAGE_HANDLER(MsgClassOne, OnMsgClassOne)
// ...more handlers here ...
// IPC_MESSAGE_HANDLER(MsgClassTen, OnMsgClassTen)
+// IPC_MESSAGE_UNHANDLED(handled = false)
// IPC_END_MESSAGE_MAP_EX()
// if (!msg_is_good) {
// // Signal error here or terminate offending process.
// }
+// return handled;
// }
-#define IPC_DEFINE_MESSAGE_MAP(class_name) \
-void class_name::OnMessageReceived(const IPC::Message& msg) \
- IPC_BEGIN_MESSAGE_MAP(class_name, msg)
-
#define IPC_BEGIN_MESSAGE_MAP_EX(class_name, msg, msg_is_ok) \
{ \
typedef class_name _IpcMessageHandlerClass; \