diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-11 16:52:42 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-11 16:52:42 +0000 |
commit | 13d49eaf47a59c68f952b5470d11afdd7bdce396 (patch) | |
tree | dc0a665d456b121f81113f2377f7fcd6e42eb683 /ipc | |
parent | aefa99e2b6abcb3e1b347d10d2b9a0e4110c68f7 (diff) | |
download | chromium_src-13d49eaf47a59c68f952b5470d11afdd7bdce396.zip chromium_src-13d49eaf47a59c68f952b5470d11afdd7bdce396.tar.gz chromium_src-13d49eaf47a59c68f952b5470d11afdd7bdce396.tar.bz2 |
Revert "FBTF: Allow forward declaration of classes passed to sync IPC messages."
This reverts commit r55735.
BUG=none
TEST=none
TBR=mirandac
Review URL: http://codereview.chromium.org/3152007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55738 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/ipc_message_impl_macros.h | 602 | ||||
-rw-r--r-- | ipc/ipc_message_macros.h | 352 | ||||
-rw-r--r-- | ipc/ipc_message_utils.h | 117 | ||||
-rw-r--r-- | ipc/ipc_message_utils_impl.h | 13 | ||||
-rw-r--r-- | ipc/ipc_sync_channel_unittest.cc | 4 |
5 files changed, 370 insertions, 718 deletions
diff --git a/ipc/ipc_message_impl_macros.h b/ipc/ipc_message_impl_macros.h index 1098357..f0adac5 100644 --- a/ipc/ipc_message_impl_macros.h +++ b/ipc/ipc_message_impl_macros.h @@ -7,7 +7,12 @@ // implementations of the constructors and the logging methods. (These only // have to be generated once). It is meant to be included in a XXX_messages.cc // file. - +// +// Unlike ipc_message_macros.h, this file is only included once; it uses one +// pass. But we *still* can't use normal include guards because we still need +// to use the MESSAGES_INTERNAL_FILE dispatch system. Because that #define is +// unset, we use the different name MESSAGES_INTERNAL_IMPL_FILE to tell this +// file what to do. #ifndef IPC_IPC_MESSAGE_IMPL_MACROS_H_ #define IPC_IPC_MESSAGE_IMPL_MACROS_H_ @@ -92,17 +97,6 @@ #define IPC_BEGIN_MESSAGES(label) #define IPC_END_MESSAGES(label) -// Every class must include a destructor and a log method that is keyed to the -// specific types. -#define IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) \ - msg_class::~msg_class() {} \ - \ - void msg_class::Log(const Message* msg, std::wstring* l) { \ - Param p; \ - if (Read(msg, &p)) \ - IPC::LogParam(p, l); \ - } - // This derives from IPC::Message and thus doesn't need us to keep the // implementations in this impl file. #define IPC_MESSAGE_CONTROL0(msg_class) @@ -112,14 +106,26 @@ : IPC::MessageWithTuple< Tuple1<type1> >( \ MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1)) {} \ \ - IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) + msg_class::~msg_class() {} \ + \ + void msg_class::Log(const Message* msg, std::wstring* l) { \ + Param p; \ + if (Read(msg, &p)) \ + IPC::LogParam(p, l); \ + } #define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \ msg_class::msg_class(const type1& arg1, const type2& arg2) \ : IPC::MessageWithTuple< Tuple2<type1, type2> >( \ MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2)) {} \ \ - IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) + msg_class::~msg_class() {} \ + \ + void msg_class::Log(const Message* msg, std::wstring* l) { \ + Param p; \ + if (Read(msg, &p)) \ + IPC::LogParam(p, l); \ + } #define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ msg_class::msg_class(const type1& arg1, const type2& arg2, \ @@ -127,7 +133,13 @@ : IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \ MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2, arg3)) {} \ \ - IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) + msg_class::~msg_class() {} \ + \ + void msg_class::Log(const Message* msg, std::wstring* l) { \ + Param p; \ + if (Read(msg, &p)) \ + IPC::LogParam(p, l); \ + } #define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ msg_class::msg_class(const type1& arg1, const type2& arg2, \ @@ -135,7 +147,13 @@ : IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \ MSG_ROUTING_CONTROL, ID, MakeRefTuple(arg1, arg2, arg3, arg4)) {} \ \ - IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) + msg_class::~msg_class() {} \ + \ + void msg_class::Log(const Message* msg, std::wstring* l) { \ + Param p; \ + if (Read(msg, &p)) \ + IPC::LogParam(p, l); \ + } #define IPC_MESSAGE_CONTROL5(msg_class, type1, type2, type3, type4, type5) \ msg_class::msg_class(const type1& arg1, const type2& arg2, \ @@ -145,7 +163,13 @@ MSG_ROUTING_CONTROL, ID, \ MakeRefTuple(arg1, arg2, arg3, arg4, arg5)) {} \ \ - IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) + msg_class::~msg_class() {} \ + \ + void msg_class::Log(const Message* msg, std::wstring* l) { \ + Param p; \ + if (Read(msg, &p)) \ + IPC::LogParam(p, l); \ + } // This derives from IPC::Message and thus doesn't need us to keep the // implementations in this impl file. @@ -156,14 +180,26 @@ : IPC::MessageWithTuple< Tuple1<type1> >( \ routing_id, ID, MakeRefTuple(arg1)) {} \ \ - IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) + msg_class::~msg_class() {} \ + \ + void msg_class::Log(const Message* msg, std::wstring* l) { \ + Param p; \ + if (Read(msg, &p)) \ + IPC::LogParam(p, l); \ + } #define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ msg_class::msg_class(int32 routing_id, const type1& arg1, const type2& arg2) \ : IPC::MessageWithTuple< Tuple2<type1, type2> >( \ routing_id, ID, MakeRefTuple(arg1, arg2)) {} \ \ - IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) + msg_class::~msg_class() {} \ + \ + void msg_class::Log(const Message* msg, std::wstring* l) { \ + Param p; \ + if (Read(msg, &p)) \ + IPC::LogParam(p, l); \ + } #define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ @@ -172,7 +208,13 @@ : IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \ routing_id, ID, MakeRefTuple(arg1, arg2, arg3)) {} \ \ - IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) + msg_class::~msg_class() {} \ + \ + void msg_class::Log(const Message* msg, std::wstring* l) { \ + Param p; \ + if (Read(msg, &p)) \ + IPC::LogParam(p, l); \ + } #define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ msg_class::msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ @@ -180,7 +222,13 @@ : IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \ routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4)) {} \ \ - IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) + msg_class::~msg_class() {} \ + \ + void msg_class::Log(const Message* msg, std::wstring* l) { \ + Param p; \ + if (Read(msg, &p)) \ + IPC::LogParam(p, l); \ + } #define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \ msg_class::msg_class(int32 routing_id, const type1& arg1, \ @@ -189,475 +237,57 @@ : IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> >( \ routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4, arg5)) {} \ \ - IPC_ASYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -// ----------------------------------------------------------------------------- - -// Every class must include a destructor and a log method that is keyed to the -// specific types. -#define IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) \ - msg_class::~msg_class() {} \ + msg_class::~msg_class() { } \ \ void msg_class::Log(const Message* msg, std::wstring* l) { \ - if (msg->is_sync()) { \ - SendParam p; \ - if (ReadSendParam(msg, &p)) \ - IPC::LogParam(p, l); \ - \ - AddOutputParamsToLog(msg, l); \ - } else { \ - TupleTypes<ReplyParam>::ValueTuple p; \ - if (ReadReplyParam(msg, &p)) \ - IPC::LogParam(p, l); \ - } \ + Param p; \ + if (Read(msg, &p)) \ + IPC::LogParam(p, l); \ } -#define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \ - msg_class::msg_class() \ - : IPC::MessageWithReply<Tuple0, Tuple0 >( \ - MSG_ROUTING_CONTROL, ID, \ - MakeTuple(), MakeTuple()) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \ - msg_class::msg_class(type1_out* arg1) \ - : IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> >( \ - MSG_ROUTING_CONTROL, ID, \ - MakeTuple(), MakeRefTuple(*arg1)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) \ - msg_class::msg_class(type1_out* arg1, type2_out* arg2) \ - : IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> >( \ - MSG_ROUTING_CONTROL, ID, \ - MakeTuple(), MakeRefTuple(*arg1, *arg2)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, \ - type3_out) \ - msg_class::msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3) \ - : IPC::MessageWithReply<Tuple0, Tuple3<type1_out&, type2_out&, \ - type3_out&> >( \ - MSG_ROUTING_CONTROL, ID, \ - MakeTuple(), MakeRefTuple(*arg1, *arg2, *arg3)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - - -#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \ - msg_class::msg_class(const type1_in& arg1) \ - : IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 >( \ - MSG_ROUTING_CONTROL, ID, \ - MakeRefTuple(arg1), MakeTuple()) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \ - msg_class::msg_class(const type1_in& arg1, type1_out* arg2) \ - : IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> >( \ - MSG_ROUTING_CONTROL, ID, \ - MakeRefTuple(arg1), MakeRefTuple(*arg2)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out) \ - msg_class::msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3) \ - : IPC::MessageWithReply<Tuple1<type1_in>, \ - Tuple2<type1_out&, type2_out&> >( \ - MSG_ROUTING_CONTROL, ID, \ - MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, \ - type2_out, type3_out) \ - msg_class::msg_class(const type1_in& arg1, type1_out* arg2, \ - type2_out* arg3, type3_out* arg4) \ - : IPC::MessageWithReply<Tuple1<type1_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> >( \ - MSG_ROUTING_CONTROL, ID, \ - MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3, *arg4)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \ - msg_class::msg_class(const type1_in& arg1, const type2_in& arg2) \ - : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 >( \ - MSG_ROUTING_CONTROL, ID, \ - MakeRefTuple(arg1, arg2), MakeTuple()) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out) \ - msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ - type1_out* arg3) \ - : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ - Tuple1<type1_out&> >( \ - MSG_ROUTING_CONTROL, ID, \ - MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - - -#define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, \ - type1_out, type2_out) \ - msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ - type1_out* arg3, type2_out* arg4) \ - : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ - Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \ - MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - - -#define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, \ - type1_out, type2_out, type3_out) \ - msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ - type1_out* arg3, type2_out* arg4, type3_out* arg5) \ - : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \ - ID, \ - MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4, *arg5)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - - -#define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, \ - type3_in, type1_out) \ - msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ - const type3_in& arg3, type1_out* arg4) \ - : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple1<type1_out&> >(MSG_ROUTING_CONTROL, ID, \ - MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, \ - type3_in, type1_out, type2_out) \ - msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ - const type3_in& arg3, type1_out* arg4, type2_out* arg5) \ - : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \ - MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - - -#define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, \ - type3_in, type1_out, type2_out, \ - type3_out) \ - msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ - const type3_in& arg3, type1_out* arg4, \ - type2_out* arg5, type3_out* arg6) \ - : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \ - ID, \ - MakeRefTuple(arg1, arg2, arg3), \ - MakeRefTuple(*arg4, *arg5, *arg6)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, \ - type3_in, type4_in, type1_out) \ - msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ - const type3_in& arg3, const type4_in& arg4, \ - type1_out* arg6) \ - : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple1<type1_out&> >(MSG_ROUTING_CONTROL, ID, \ - MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg6)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - - -#define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, \ - type3_in, type4_in, type1_out, \ - type2_out) \ - msg_class::msg_class(const type1_in& arg1, const type2_in& arg2, \ - const type3_in& arg3, const type4_in& arg4, \ - type1_out* arg5, type2_out* arg6) \ - : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, \ - type4_in>, \ - Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \ - MakeRefTuple(arg1, arg2, arg3, arg4), \ - MakeRefTuple(*arg5, *arg6)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \ - msg_class::msg_class(int routing_id) \ - : IPC::MessageWithReply<Tuple0, Tuple0>( \ - routing_id, ID, \ - MakeTuple(), MakeTuple()) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \ - msg_class::msg_class(int routing_id, type1_out* arg1) \ - : IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> >( \ - routing_id, ID, \ - MakeTuple(), MakeRefTuple(*arg1)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out) \ - msg_class::msg_class(int routing_id, type1_out* arg1, type2_out* arg2) \ - : IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> >( \ - routing_id, ID, \ - MakeTuple(), MakeRefTuple(*arg1, *arg2)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, \ - type3_out) \ - msg_class::msg_class(int routing_id, type1_out* arg1, type2_out* arg2, \ - type3_out* arg3) \ - : IPC::MessageWithReply<Tuple0, \ - Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ - MakeTuple(), MakeRefTuple(*arg1, *arg2, *arg3)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in) \ - msg_class::msg_class(int routing_id, const type1_in& arg1) \ - : IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 >( \ - routing_id, ID, \ - MakeRefTuple(arg1), MakeTuple()) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - type1_out* arg2) \ - : IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> >( \ - routing_id, ID, \ - MakeRefTuple(arg1), MakeRefTuple(*arg2)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, \ - type2_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - type1_out* arg2, type2_out* arg3) \ - : IPC::MessageWithReply<Tuple1<type1_in>, \ - Tuple2<type1_out&, type2_out&> >( \ - routing_id, ID, \ - MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, \ - type2_out, type3_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - type1_out* arg2, type2_out* arg3, type3_out* arg4) \ - : IPC::MessageWithReply<Tuple1<type1_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ - MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3, *arg4)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, \ - type2_out, type3_out, type4_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - type1_out* arg2, type2_out* arg3, \ - type3_out* arg4, type4_out* arg5) \ - : IPC::MessageWithReply<Tuple1<type1_in>, \ - Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> >( \ - routing_id, ID, MakeRefTuple(arg1), \ - MakeRefTuple(*arg2, *arg3, *arg4, *arg5)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2) \ - : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 >( \ - routing_id, ID, MakeRefTuple(arg1, arg2), MakeTuple()) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, \ - type1_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, type1_out* arg3) \ - : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ - Tuple1<type1_out&> >(routing_id, ID, \ - MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, \ - type1_out, type2_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, type1_out* arg3, \ - type2_out* arg4) \ - : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ - Tuple2<type1_out&, type2_out&> >(routing_id, ID, \ - MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, \ - type1_out, type2_out, type3_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, type1_out* arg3, \ - type2_out* arg4, type3_out* arg5) \ - : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ - MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4, *arg5)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, \ - type3_in) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, const type3_in& arg3) \ - : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, Tuple0>( \ - routing_id, ID, \ - MakeRefTuple(arg1, arg2, arg3), MakeTuple()) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, \ - type3_in, type1_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, const type3_in& arg3, \ - type1_out* arg4) \ - : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple1<type1_out&> >(routing_id, ID, \ - MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, \ - type3_in, type1_out, type2_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, const type3_in& arg3, \ - type1_out* arg4, type2_out* arg5) \ - : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple2<type1_out&, type2_out&> >(routing_id, ID, \ - MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, \ - type3_in, type1_out, type2_out, \ - type3_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, const type3_in& arg3, \ - type1_out* arg4, type2_out* arg5, type3_out* arg6) \ - : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ - MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5, \ - *arg6)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, \ - type3_in, type4_in) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, const type3_in& arg3, \ - const type4_in& arg4) \ - : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, \ - type4_in>, Tuple0 >(routing_id, ID, \ - MakeRefTuple(arg1, arg2, arg3, arg4), MakeTuple()) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, \ - type3_in, type4_in, type1_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, const type3_in& arg3, \ - const type4_in& arg4, type1_out* arg6) \ - : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple1<type1_out&> >(routing_id, ID, \ - MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg6)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - - -#define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, \ - type3_in, type4_in, type1_out, \ - type2_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, const type3_in& arg3, \ - const type4_in& arg4, type1_out* arg5, type2_out* arg6) \ - : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple2<type1_out&, type2_out&> >(routing_id, ID, \ - MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg5, *arg6)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - - -#define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, \ - type3_in, type4_in, type1_out, \ - type2_out, type3_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, const type3_in& arg3, \ - const type4_in& arg4, type1_out* arg5, \ - type2_out* arg6, type3_out* arg7) \ - : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ - MakeRefTuple(arg1, arg2, arg3, arg4), \ - MakeRefTuple(*arg5, *arg6, *arg7)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, \ - type3_in, type4_in, type5_in) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, const type3_in& arg3, \ - const type4_in& arg4, const type5_in& arg5) \ - : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, \ - type4_in, type5_in>, Tuple0 >(routing_id, ID, \ - MakeRefTuple(arg1, arg2, arg3, arg4, arg5), MakeTuple()) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, \ - type3_in, type4_in, type5_in, type1_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, const type3_in& arg3, \ - const type4_in& arg4, const type5_in& arg5, \ - type1_out* arg6) \ - : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, \ - type4_in, type5_in>, Tuple1<type1_out&> >(routing_id, ID, \ - MakeRefTuple(arg1, arg2, arg3, arg4, arg5), \ - MakeRefTuple(*arg6)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, \ - type3_in, type4_in, type5_in, \ - type1_out, type2_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, const type3_in& arg3, \ - const type4_in& arg4, const type4_in& arg5, \ - type1_out* arg6, type2_out* arg7) \ - : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, \ - type4_in, type5_in>, Tuple2<type1_out&, type2_out&> >( \ - routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4, arg5), \ - MakeRefTuple(*arg6, *arg7)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) - -#define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, \ - type3_in, type4_in, type5_in, \ - type1_out, type2_out, type3_out) \ - msg_class::msg_class(int routing_id, const type1_in& arg1, \ - const type2_in& arg2, const type3_in& arg3, \ - const type4_in& arg4, const type4_in& arg5, \ - type1_out* arg6, type2_out* arg7, \ - type3_out* arg8) \ - : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, \ - type4_in, type5_in>, \ - Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ - MakeRefTuple(arg1, arg2, arg3, arg4, arg5), \ - MakeRefTuple(*arg6, *arg7, *arg8)) {} \ - \ - IPC_SYNC_MESSAGE_DTOR_AND_LOG(msg_class) +// TODO(erg): Fill these in as I go along. +#define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) +#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) +#define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) +#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) +#define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) +#define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out) +#define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, type3_in, type1_out) +#define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) +#define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) +#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) +#define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in) +#define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out) +#define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) +#define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in) +#define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, type1_out) +#define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, type3_in) +#define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, type3_in, type1_out) +#define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, type3_in, type4_in) +#define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) +#define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) +#define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) +#define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) +#define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) +#define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) // Trigger the header guard define in ipc_message_macros.h so we don't get // duplicate including when we include MESSAGES_INTERNAL_FILE again at the end diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h index 903d566..3152871f 100644 --- a/ipc/ipc_message_macros.h +++ b/ipc/ipc_message_macros.h @@ -845,20 +845,23 @@ LogFunction g_log_function_mapping[LastMsgIndex]; #define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \ class msg_class : public IPC::MessageWithReply<Tuple0, Tuple0 > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class() \ + : IPC::MessageWithReply<Tuple0, Tuple0 >( \ + MSG_ROUTING_CONTROL, ID, \ + MakeTuple(), MakeTuple()) {} \ }; -#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \ +#define IPC_SYNC_MESSAGE_CONTROL0_1(msg_class, type1_out) \ class msg_class : public IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(type1_out* arg1); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(type1_out* arg1) \ + : IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> >( \ + MSG_ROUTING_CONTROL, \ + ID, \ + MakeTuple(), MakeRefTuple(*arg1)) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL0_2(msg_class, type1_out, type2_out) \ @@ -866,9 +869,11 @@ LogFunction g_log_function_mapping[LastMsgIndex]; public IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(type1_out* arg1, type2_out* arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(type1_out* arg1, type2_out* arg2) \ + : IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> >( \ + MSG_ROUTING_CONTROL, \ + ID, \ + MakeTuple(), MakeRefTuple(*arg1, *arg2)) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL0_3(msg_class, type1_out, type2_out, type3_out) \ @@ -877,29 +882,33 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple3<type1_out&, type2_out&, type3_out&> >{ \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(type1_out* arg1, type2_out* arg2, type3_out* arg3) \ + : IPC::MessageWithReply<Tuple0, \ + Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \ + ID, \ + MakeTuple(), MakeRefTuple(*arg1, *arg2, *arg3)) {} \ }; -#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \ - class msg_class : \ - public IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ +#define IPC_SYNC_MESSAGE_CONTROL1_0(msg_class, type1_in) \ + class msg_class : \ + public IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1_in& arg1) \ + : IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 >( \ + MSG_ROUTING_CONTROL, ID, \ + MakeRefTuple(arg1), MakeTuple()) {} \ }; -#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \ - class msg_class : \ +#define IPC_SYNC_MESSAGE_CONTROL1_1(msg_class, type1_in, type1_out) \ + class msg_class : \ public IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, type1_out* arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1_in& arg1, type1_out* arg2) \ + : IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> >( \ + MSG_ROUTING_CONTROL, ID, \ + MakeRefTuple(arg1), MakeRefTuple(*arg2)) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL1_2(msg_class, type1_in, type1_out, type2_out) \ @@ -907,9 +916,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; public IPC::MessageWithReply<Tuple1<type1_in>, Tuple2<type1_out&, type2_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3) \ + : IPC::MessageWithReply<Tuple1<type1_in>, Tuple2<type1_out&, type2_out&> >( \ + MSG_ROUTING_CONTROL, ID, \ + MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3)) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL1_3(msg_class, type1_in, type1_out, type2_out, type3_out) \ @@ -918,29 +928,33 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple3<type1_out&, type2_out&, type3_out&> >{ \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4) \ + : IPC::MessageWithReply<Tuple1<type1_in>, \ + Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \ + ID, \ + MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3, *arg4)) {} \ }; -#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \ - class msg_class : \ +#define IPC_SYNC_MESSAGE_CONTROL2_0(msg_class, type1_in, type2_in) \ + class msg_class : \ public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1_in& arg1, const type2_in& arg2) \ + : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 >( \ + MSG_ROUTING_CONTROL, ID, \ + MakeRefTuple(arg1, arg2), MakeTuple()) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL2_1(msg_class, type1_in, type2_in, type1_out) \ - class msg_class : \ + class msg_class : \ public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple1<type1_out&> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3) \ + : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple1<type1_out&> >( \ + MSG_ROUTING_CONTROL, ID, \ + MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3)) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL2_2(msg_class, type1_in, type2_in, type1_out, type2_out) \ @@ -949,9 +963,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple2<type1_out&, type2_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4) \ + : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ + Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \ + MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4)) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ @@ -960,9 +975,11 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple3<type1_out&, type2_out&, type3_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5) \ + : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ + Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \ + ID, \ + MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4, *arg5)) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL3_1(msg_class, type1_in, type2_in, type3_in, type1_out) \ @@ -971,9 +988,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple1<type1_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4) \ + : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ + Tuple1<type1_out&> >(MSG_ROUTING_CONTROL, ID, \ + MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4)) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ @@ -982,9 +1000,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple2<type1_out&, type2_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5) \ + : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ + Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \ + MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5)) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ @@ -993,9 +1012,11 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple3<type1_out&, type2_out&, type3_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6) \ + : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ + Tuple3<type1_out&, type2_out&, type3_out&> >(MSG_ROUTING_CONTROL, \ + ID, \ + MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5, *arg6)) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ @@ -1004,9 +1025,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple1<type1_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6) \ + : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ + Tuple1<type1_out&> >(MSG_ROUTING_CONTROL, ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg6)) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ @@ -1015,27 +1037,30 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple2<type1_out&, type2_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6) \ + : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ + Tuple2<type1_out&, type2_out&> >(MSG_ROUTING_CONTROL, ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg5, *arg6)) {} \ }; -#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \ - class msg_class : public IPC::MessageWithReply<Tuple0, Tuple0 > { \ +#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \ + class msg_class : public IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, type1_out* arg1) \ + : IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> >( \ + routing_id, ID, \ + MakeTuple(), MakeRefTuple(*arg1)) {} \ }; -#define IPC_SYNC_MESSAGE_ROUTED0_1(msg_class, type1_out) \ - class msg_class : public IPC::MessageWithReply<Tuple0, Tuple1<type1_out&> > { \ +#define IPC_SYNC_MESSAGE_ROUTED0_0(msg_class) \ + class msg_class : public IPC::MessageWithReply<Tuple0, Tuple0 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, type1_out* arg1); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id) \ + : IPC::MessageWithReply<Tuple0, Tuple0 >( \ + routing_id, ID, \ + MakeTuple(), MakeTuple()) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED0_2(msg_class, type1_out, type2_out) \ @@ -1043,9 +1068,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; public IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, type1_out* arg1, type2_out* arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, type1_out* arg1, type2_out* arg2) \ + : IPC::MessageWithReply<Tuple0, Tuple2<type1_out&, type2_out&> >( \ + routing_id, ID, \ + MakeTuple(), MakeRefTuple(*arg1, *arg2)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED0_3(msg_class, type1_out, type2_out, type3_out) \ @@ -1054,9 +1080,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple3<type1_out&, type2_out&, type3_out&> >{ \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, type1_out* arg1, type2_out* arg2, type3_out* arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, type1_out* arg1, type2_out* arg2, type3_out* arg3) \ + : IPC::MessageWithReply<Tuple0, \ + Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ + MakeTuple(), MakeRefTuple(*arg1, *arg2, *arg3)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED1_0(msg_class, type1_in) \ @@ -1064,9 +1091,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; public IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1) \ + : IPC::MessageWithReply<Tuple1<type1_in>, Tuple0 >( \ + routing_id, ID, \ + MakeRefTuple(arg1), MakeTuple()) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED1_1(msg_class, type1_in, type1_out) \ @@ -1074,9 +1102,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; public IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, type1_out* arg2) \ + : IPC::MessageWithReply<Tuple1<type1_in>, Tuple1<type1_out&> >( \ + routing_id, ID, \ + MakeRefTuple(arg1), MakeRefTuple(*arg2)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED1_2(msg_class, type1_in, type1_out, type2_out) \ @@ -1084,9 +1113,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; public IPC::MessageWithReply<Tuple1<type1_in>, Tuple2<type1_out&, type2_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3) \ + : IPC::MessageWithReply<Tuple1<type1_in>, Tuple2<type1_out&, type2_out&> >( \ + routing_id, ID, \ + MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED1_3(msg_class, type1_in, type1_out, type2_out, type3_out) \ @@ -1095,9 +1125,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple3<type1_out&, type2_out&, type3_out&> >{ \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4) \ + : IPC::MessageWithReply<Tuple1<type1_in>, \ + Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ + MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3, *arg4)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED1_4(msg_class, type1_in, type1_out, type2_out, type3_out, type4_out) \ @@ -1106,9 +1137,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> >{ \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4, type4_out* arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, type1_out* arg2, type2_out* arg3, type3_out* arg4, type4_out* arg5) \ + : IPC::MessageWithReply<Tuple1<type1_in>, \ + Tuple4<type1_out&, type2_out&, type3_out&, type4_out&> >(routing_id, ID, \ + MakeRefTuple(arg1), MakeRefTuple(*arg2, *arg3, *arg4, *arg5)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED2_0(msg_class, type1_in, type2_in) \ @@ -1116,9 +1148,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2) \ + : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple0 >( \ + routing_id, ID, \ + MakeRefTuple(arg1, arg2), MakeTuple()) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED2_1(msg_class, type1_in, type2_in, type1_out) \ @@ -1126,9 +1159,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; public IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple1<type1_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3) \ + : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, Tuple1<type1_out&> >( \ + routing_id, ID, \ + MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED2_2(msg_class, type1_in, type2_in, type1_out, type2_out) \ @@ -1137,9 +1171,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple2<type1_out&, type2_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4) \ + : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ + Tuple2<type1_out&, type2_out&> >(routing_id, ID, \ + MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED2_3(msg_class, type1_in, type2_in, type1_out, type2_out, type3_out) \ @@ -1148,9 +1183,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple3<type1_out&, type2_out&, type3_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, type1_out* arg3, type2_out* arg4, type3_out* arg5) \ + : IPC::MessageWithReply<Tuple2<type1_in, type2_in>, \ + Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ + MakeRefTuple(arg1, arg2), MakeRefTuple(*arg3, *arg4, *arg5)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED3_0(msg_class, type1_in, type2_in, type3_in) \ @@ -1158,10 +1194,11 @@ LogFunction g_log_function_mapping[LastMsgIndex]; public IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, Tuple0 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ - }; + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3) \ + : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, Tuple0>( \ + routing_id, ID, \ + MakeRefTuple(arg1, arg2, arg3), MakeTuple()) {} \ + }; #define IPC_SYNC_MESSAGE_ROUTED3_1(msg_class, type1_in, type2_in, type3_in, type1_out) \ class msg_class : \ @@ -1169,9 +1206,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple1<type1_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4) \ + : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ + Tuple1<type1_out&> >(routing_id, ID, \ + MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED3_2(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out) \ @@ -1180,9 +1218,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple2<type1_out&, type2_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5) \ + : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ + Tuple2<type1_out&, type2_out&> >(routing_id, ID, \ + MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED3_3(msg_class, type1_in, type2_in, type3_in, type1_out, type2_out, type3_out) \ @@ -1191,9 +1230,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple3<type1_out&, type2_out&, type3_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, type1_out* arg4, type2_out* arg5, type3_out* arg6) \ + : IPC::MessageWithReply<Tuple3<type1_in, type2_in, type3_in>, \ + Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ + MakeRefTuple(arg1, arg2, arg3), MakeRefTuple(*arg4, *arg5, *arg6)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED4_0(msg_class, type1_in, type2_in, type3_in, type4_in) \ @@ -1202,9 +1242,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple0 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4) \ + : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ + Tuple0 >(routing_id, ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4), MakeTuple()) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED4_1(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out) \ @@ -1213,9 +1254,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple1<type1_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg6) \ + : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ + Tuple1<type1_out&> >(routing_id, ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg6)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED4_2(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out) \ @@ -1224,9 +1266,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple2<type1_out&, type2_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6) \ + : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ + Tuple2<type1_out&, type2_out&> >(routing_id, ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg5, *arg6)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED4_3(msg_class, type1_in, type2_in, type3_in, type4_in, type1_out, type2_out, type3_out) \ @@ -1235,9 +1278,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple3<type1_out&, type2_out&, type3_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6, type3_out* arg7); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, type1_out* arg5, type2_out* arg6, type3_out* arg7) \ + : IPC::MessageWithReply<Tuple4<type1_in, type2_in, type3_in, type4_in>, \ + Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4), MakeRefTuple(*arg5, *arg6, *arg7)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED5_0(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in) \ @@ -1246,9 +1290,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple0 > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5) \ + : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ + Tuple0 >(routing_id, ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4, arg5), MakeTuple()) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED5_1(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out) \ @@ -1257,9 +1302,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple1<type1_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5, type1_out* arg6); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type5_in& arg5, type1_out* arg6) \ + : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ + Tuple1<type1_out&> >(routing_id, ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4, arg5), MakeRefTuple(*arg6)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED5_2(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out) \ @@ -1268,9 +1314,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple2<type1_out&, type2_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7) \ + : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ + Tuple2<type1_out&, type2_out&> >(routing_id, ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4, arg5), MakeRefTuple(*arg6, *arg7)) {} \ }; #define IPC_SYNC_MESSAGE_ROUTED5_3(msg_class, type1_in, type2_in, type3_in, type4_in, type5_in, type1_out, type2_out, type3_out) \ @@ -1279,9 +1326,10 @@ LogFunction g_log_function_mapping[LastMsgIndex]; Tuple3<type1_out&, type2_out&, type3_out&> > { \ public: \ enum { ID = msg_class##__ID }; \ - msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7, type3_out* arg8); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + msg_class(int routing_id, const type1_in& arg1, const type2_in& arg2, const type3_in& arg3, const type4_in& arg4, const type4_in& arg5, type1_out* arg6, type2_out* arg7, type3_out* arg8) \ + : IPC::MessageWithReply<Tuple5<type1_in, type2_in, type3_in, type4_in, type5_in>, \ + Tuple3<type1_out&, type2_out&, type3_out&> >(routing_id, ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4, arg5), MakeRefTuple(*arg6, *arg7, *arg8)) {} \ }; #endif // #if defined() diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h index 4882688..cdad102 100644 --- a/ipc/ipc_message_utils.h +++ b/ipc/ipc_message_utils.h @@ -1164,54 +1164,8 @@ class MessageWithTuple : public Message { } }; -// defined in ipc_logging.cc -void GenerateLogData(const std::string& channel, const Message& message, - LogData* data); - - -#if defined(IPC_MESSAGE_LOG_ENABLED) -inline void AddOutputParamsToLog(const Message* msg, std::wstring* l) { - const std::wstring& output_params = msg->output_params(); - if (!l->empty() && !output_params.empty()) - l->append(L", "); - - l->append(output_params); -} - -template <class ReplyParamType> -inline void LogReplyParamsToMessage(const ReplyParamType& reply_params, - const Message* msg) { - if (msg->received_time() != 0) { - std::wstring output_params; - LogParam(reply_params, &output_params); - msg->set_output_params(output_params); - } -} - -inline void ConnectMessageAndReply(const Message* msg, Message* reply) { - if (msg->sent_time()) { - // Don't log the sync message after dispatch, as we don't have the - // output parameters at that point. Instead, save its data and log it - // with the outgoing reply message when it's sent. - LogData* data = new LogData; - GenerateLogData("", *msg, data); - msg->set_dont_log(); - reply->set_sync_log_data(data); - } -} -#else -inline void AddOutputParamsToLog(const Message* msg, std::wstring* l) {} - -template <class ReplyParamType> -inline void LogReplyParamsToMessage(const ReplyParamType& reply_params, - const Message* msg) {} - -inline void ConnectMessageAndReply(const Message* msg, Message* reply) {} -#endif - // This class assumes that its template argument is a RefTuple (a Tuple with -// reference elements). This would go into ipc_message_utils_impl.h, but it is -// also used by chrome_frame. +// reference elements). template <class RefTuple> class ParamDeserializer : public MessageReplyDeserializer { public: @@ -1224,6 +1178,10 @@ class ParamDeserializer : public MessageReplyDeserializer { RefTuple out_; }; +// defined in ipc_logging.cc +void GenerateLogData(const std::string& channel, const Message& message, + LogData* data); + // Used for synchronous messages. template <class SendParamType, class ReplyParamType> class MessageWithReply : public SyncMessage { @@ -1233,33 +1191,54 @@ class MessageWithReply : public SyncMessage { typedef ReplyParamType ReplyParam; MessageWithReply(int32 routing_id, uint32 type, - const RefSendParam& send, const ReplyParam& reply); - - // TODO(erg): Migrate these ReadSendParam/ReadReplyParam() methods to - // ipc_message_utils_impl.h once I figure out how to get the linkage correct - // in the release builds. - static bool ReadSendParam(const Message* msg, SendParam* p) { - void* iter = SyncMessage::GetDataIterator(msg); - return ReadParam(msg, &iter, p); + const RefSendParam& send, const ReplyParam& reply) + : SyncMessage(routing_id, type, PRIORITY_NORMAL, + new ParamDeserializer<ReplyParam>(reply)) { + WriteParam(this, send); } - static bool ReadReplyParam(const Message* msg, - typename TupleTypes<ReplyParam>::ValueTuple* p) { - void* iter = SyncMessage::GetDataIterator(msg); - return ReadParam(msg, &iter, p); + static void Log(const Message* msg, std::wstring* l) { + if (msg->is_sync()) { + SendParam p; + void* iter = SyncMessage::GetDataIterator(msg); + if (ReadParam(msg, &iter, &p)) + LogParam(p, l); + +#if defined(IPC_MESSAGE_LOG_ENABLED) + const std::wstring& output_params = msg->output_params(); + if (!l->empty() && !output_params.empty()) + l->append(L", "); + + l->append(output_params); +#endif + } else { + // This is an outgoing reply. Now that we have the output parameters, we + // can finally log the message. + typename TupleTypes<ReplyParam>::ValueTuple p; + void* iter = SyncMessage::GetDataIterator(msg); + if (ReadParam(msg, &iter, &p)) + LogParam(p, l); + } } template<class T, class Method> static bool Dispatch(const Message* msg, T* obj, Method func) { SendParam send_params; + void* iter = GetDataIterator(msg); Message* reply = GenerateReply(msg); bool error; - if (ReadSendParam(msg, &send_params)) { + if (ReadParam(msg, &iter, &send_params)) { typename TupleTypes<ReplyParam>::ValueTuple reply_params; DispatchToMethod(obj, func, send_params, &reply_params); WriteParam(reply, reply_params); error = false; - LogReplyParamsToMessage(reply_params, msg); +#ifdef IPC_MESSAGE_LOG_ENABLED + if (msg->received_time() != 0) { + std::wstring output_params; + LogParam(reply_params, &output_params); + msg->set_output_params(output_params); + } +#endif } else { NOTREACHED() << "Error deserializing message " << msg->type(); reply->set_reply_error(); @@ -1273,11 +1252,23 @@ class MessageWithReply : public SyncMessage { template<class T, class Method> static bool DispatchDelayReply(const Message* msg, T* obj, Method func) { SendParam send_params; + void* iter = GetDataIterator(msg); Message* reply = GenerateReply(msg); bool error; - if (ReadSendParam(msg, &send_params)) { + if (ReadParam(msg, &iter, &send_params)) { Tuple1<Message&> t = MakeRefTuple(*reply); - ConnectMessageAndReply(msg, reply); + +#ifdef IPC_MESSAGE_LOG_ENABLED + if (msg->sent_time()) { + // Don't log the sync message after dispatch, as we don't have the + // output parameters at that point. Instead, save its data and log it + // with the outgoing reply message when it's sent. + LogData* data = new LogData; + GenerateLogData("", *msg, data); + msg->set_dont_log(); + reply->set_sync_log_data(data); + } +#endif DispatchToMethod(obj, func, send_params, &t); error = false; } else { diff --git a/ipc/ipc_message_utils_impl.h b/ipc/ipc_message_utils_impl.h index 53c7986..ba11990 100644 --- a/ipc/ipc_message_utils_impl.h +++ b/ipc/ipc_message_utils_impl.h @@ -25,19 +25,6 @@ MessageWithTuple<ParamType>::MessageWithTuple( // subclass needs to have Log() to call Read(), which instantiates the above // template. -template <class SendParamType, class ReplyParamType> -MessageWithReply<SendParamType, ReplyParamType>::MessageWithReply( - int32 routing_id, uint32 type, - const RefSendParam& send, - const ReplyParam& reply) - : SyncMessage(routing_id, type, PRIORITY_NORMAL, - new ParamDeserializer<ReplyParam>(reply)) { - WriteParam(this, send); -} - -// TODO(erg): Migrate ReadSendParam()/ReadReplyParam() here when we can force -// the visibility/linkage. - } // namespace IPC #endif // IPC_IPC_MESSAGE_UTILS_IMPL_H_ diff --git a/ipc/ipc_sync_channel_unittest.cc b/ipc/ipc_sync_channel_unittest.cc index a3b757a..87e9773 100644 --- a/ipc/ipc_sync_channel_unittest.cc +++ b/ipc/ipc_sync_channel_unittest.cc @@ -26,10 +26,6 @@ #define MESSAGES_INTERNAL_FILE "ipc/ipc_sync_message_unittest.h" #include "ipc/ipc_message_macros.h" -// Definition of IPC Messages used for this test. -#define MESSAGES_INTERNAL_IMPL_FILE "ipc/ipc_sync_message_unittest.h" -#include "ipc/ipc_message_impl_macros.h" - using namespace IPC; using base::WaitableEvent; |