diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-16 21:29:33 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-16 21:29:33 +0000 |
commit | e44d13473dd9d81a8d3e1d26f2024be4e4a7c503 (patch) | |
tree | 4a66307f49ed83f6de7faba305cd6355a649b355 /ipc/ipc_message_macros.h | |
parent | 51f81dae305d1bdfda139b18be3632f8fbf4959f (diff) | |
download | chromium_src-e44d13473dd9d81a8d3e1d26f2024be4e4a7c503.zip chromium_src-e44d13473dd9d81a8d3e1d26f2024be4e4a7c503.tar.gz chromium_src-e44d13473dd9d81a8d3e1d26f2024be4e4a7c503.tar.bz2 |
Remove IPC_BEGIN_MESSAGE_MAP_EX macro since r270839 made all bad IPCs kill their child processes.
R=avi@chromium.org
Review URL: https://codereview.chromium.org/292443004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_message_macros.h')
-rw-r--r-- | ipc/ipc_message_macros.h | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h index 5bc1ad4..38aa740 100644 --- a/ipc/ipc_message_macros.h +++ b/ipc/ipc_message_macros.h @@ -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,11 +966,6 @@ #define IPC_END_MESSAGE_MAP() \ } \ - DCHECK(msg_is_ok__); \ -} - -#define IPC_END_MESSAGE_MAP_EX() \ - } \ } // This corresponds to an enum value from IPCMessageStart. |