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

Unified Diff: ipc/ipc_message_macros.h

Issue 5978003: Make IPC::Channel::Listener:OnMessageReceived have a return value indicating ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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_fuzzing_tests.cc ('k') | ipc/ipc_send_fds_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_message_macros.h
===================================================================
--- ipc/ipc_message_macros.h (revision 70108)
+++ ipc/ipc_message_macros.h (working copy)
@@ -1163,23 +1163,22 @@
// 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; \
« no previous file with comments | « ipc/ipc_fuzzing_tests.cc ('k') | ipc/ipc_send_fds_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698