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

Unified Diff: ipc/ipc_message_macros.h

Issue 292443004: Remove IPC_BEGIN_MESSAGE_MAP_EX macro since r270839 made all bad IPCs kill their child processes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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_fuzzing_tests.cc ('k') | ipc/ipc_message_unittest.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 271040)
+++ ipc/ipc_message_macros.h (working copy)
@@ -876,40 +876,25 @@
#define IPC_MESSAGE_ID_CLASS(id) ((id) >> 16)
#define IPC_MESSAGE_ID_LINE(id) ((id) & 0xffff)
-// Message crackers and handlers.
-// 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:
+// Message crackers and handlers. Usage:
//
// 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_BEGIN_MESSAGE_MAP(MyClass, msg)
// 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.
-// }
+// IPC_END_MESSAGE_MAP()
// return handled;
// }
-#define IPC_BEGIN_MESSAGE_MAP_EX(class_name, msg, msg_is_ok) \
- { \
- typedef class_name _IpcMessageHandlerClass; \
- void* param__ = NULL; \
- const IPC::Message& ipc_message__ = msg; \
- bool& msg_is_ok__ = msg_is_ok; \
- switch (ipc_message__.type()) {
-
#define IPC_BEGIN_MESSAGE_MAP(class_name, msg) \
{ \
typedef class_name _IpcMessageHandlerClass; \
void* param__ = NULL; \
const IPC::Message& ipc_message__ = msg; \
- bool msg_is_ok__ = true; \
switch (ipc_message__.type()) {
// gcc gives the following error now when using decltype so type typeof there:
@@ -920,20 +905,18 @@
#define IPC_DECLTYPE typeof
#endif
-#define IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(class_name, msg, msg_is_ok, param) \
+#define IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(class_name, msg, param) \
{ \
typedef class_name _IpcMessageHandlerClass; \
IPC_DECLTYPE(param) param__ = param; \
const IPC::Message& ipc_message__ = msg; \
- bool& msg_is_ok__ = msg_is_ok; \
switch (ipc_message__.type()) {
#define IPC_MESSAGE_FORWARD(msg_class, obj, member_func) \
case msg_class::ID: { \
TRACK_RUN_IN_IPC_HANDLER(member_func); \
- msg_is_ok__ = msg_class::Dispatch(&ipc_message__, obj, this, \
- param__, &member_func); \
- if (!msg_is_ok__) \
+ if (!msg_class::Dispatch(&ipc_message__, obj, this, param__, \
+ &member_func)) \
ipc_message__.set_dispatch_error(); \
} \
break;
@@ -944,9 +927,8 @@
#define IPC_MESSAGE_FORWARD_DELAY_REPLY(msg_class, obj, member_func) \
case msg_class::ID: { \
TRACK_RUN_IN_IPC_HANDLER(member_func); \
- msg_is_ok__ = msg_class::DispatchDelayReply(&ipc_message__, obj, \
- param__, &member_func); \
- if (!msg_is_ok__) \
+ if (!msg_class::DispatchDelayReply(&ipc_message__, obj, param__, \
+ &member_func)) \
ipc_message__.set_dispatch_error(); \
} \
break;
@@ -984,13 +966,8 @@
#define IPC_END_MESSAGE_MAP() \
} \
- DCHECK(msg_is_ok__); \
}
-#define IPC_END_MESSAGE_MAP_EX() \
- } \
-}
-
// This corresponds to an enum value from IPCMessageStart.
#define IPC_MESSAGE_CLASS(message) \
IPC_MESSAGE_ID_CLASS(message.type())
« no previous file with comments | « ipc/ipc_fuzzing_tests.cc ('k') | ipc/ipc_message_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698