diff options
author | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-09 16:06:58 +0000 |
---|---|---|
committer | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-09 16:06:58 +0000 |
commit | 071b4b94196fafbf3557771d41db81fa9a7d0ba7 (patch) | |
tree | 6c55110df8cdb9a592e6b79ce3a0bab833dad2bd /ipc/ipc_message_macros.h | |
parent | c9f28a7d16b71b17185b456e3b53e4e638d005d0 (diff) | |
download | chromium_src-071b4b94196fafbf3557771d41db81fa9a7d0ba7.zip chromium_src-071b4b94196fafbf3557771d41db81fa9a7d0ba7.tar.gz chromium_src-071b4b94196fafbf3557771d41db81fa9a7d0ba7.tar.bz2 |
Revert 55259 - FBTF: New IPC definitions, only applied to async ROUTED and CONTROL messages.
The slowest cc files in chrome include render_messages.h and other IPC message
definitions. Including one of these files will bring in half of chrome because
in the IPC system previously required full class definitions due to
implementation details.
The new system allows forward declarations and places the implementations of
functions that need the full class definitions (ctor/dtor()/Log() and
superclass ctor/Read() methods) into a separate xxx_messages.cc file using a
parallel set of macros to ipc_message_macros.h. This has the added benefit
of moving most of the template instantiation junk into a small number of
files.
Pros:
- Will speed up compiling by a lot once everything is forward declared.
- Already, intermediary .o/.a files are smaller.
Cons:
- Adds a 4th pass to the messages system, this time in a different header.
BUG=51411
TEST=none
Review URL: http://codereview.chromium.org/2873090
TBR=erg@google.com
Review URL: http://codereview.chromium.org/3080040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55406 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_message_macros.h')
-rw-r--r-- | ipc/ipc_message_macros.h | 281 |
1 files changed, 85 insertions, 196 deletions
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h index 3152871f..d14f545 100644 --- a/ipc/ipc_message_macros.h +++ b/ipc/ipc_message_macros.h @@ -79,9 +79,6 @@ #endif -#if defined(IPC_MESSAGE_MACROS_ENUMS) -#undef IPC_MESSAGE_MACROS_ENUMS - // Undefine the macros from the previous pass (if any). #undef IPC_BEGIN_MESSAGES @@ -141,6 +138,9 @@ #undef IPC_SYNC_MESSAGE_ROUTED5_2 #undef IPC_SYNC_MESSAGE_ROUTED5_3 +#if defined(IPC_MESSAGE_MACROS_ENUMS) +#undef IPC_MESSAGE_MACROS_ENUMS + // We're using the lowest 16 bits of type for the message id, and the highest // 16 bits for the channel type. // @@ -399,65 +399,6 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \ #elif defined(IPC_MESSAGE_MACROS_LOG) #undef IPC_MESSAGE_MACROS_LOG - -// Undefine the macros from the previous pass (if any). -#undef IPC_BEGIN_MESSAGES -#undef IPC_END_MESSAGES -#undef IPC_MESSAGE_CONTROL0 -#undef IPC_MESSAGE_CONTROL1 -#undef IPC_MESSAGE_CONTROL2 -#undef IPC_MESSAGE_CONTROL3 -#undef IPC_MESSAGE_CONTROL4 -#undef IPC_MESSAGE_CONTROL5 -#undef IPC_MESSAGE_ROUTED0 -#undef IPC_MESSAGE_ROUTED1 -#undef IPC_MESSAGE_ROUTED2 -#undef IPC_MESSAGE_ROUTED3 -#undef IPC_MESSAGE_ROUTED4 -#undef IPC_MESSAGE_ROUTED5 -#undef IPC_SYNC_MESSAGE_CONTROL0_0 -#undef IPC_SYNC_MESSAGE_CONTROL0_1 -#undef IPC_SYNC_MESSAGE_CONTROL0_2 -#undef IPC_SYNC_MESSAGE_CONTROL0_3 -#undef IPC_SYNC_MESSAGE_CONTROL1_0 -#undef IPC_SYNC_MESSAGE_CONTROL1_1 -#undef IPC_SYNC_MESSAGE_CONTROL1_2 -#undef IPC_SYNC_MESSAGE_CONTROL1_3 -#undef IPC_SYNC_MESSAGE_CONTROL2_0 -#undef IPC_SYNC_MESSAGE_CONTROL2_1 -#undef IPC_SYNC_MESSAGE_CONTROL2_2 -#undef IPC_SYNC_MESSAGE_CONTROL2_3 -#undef IPC_SYNC_MESSAGE_CONTROL3_1 -#undef IPC_SYNC_MESSAGE_CONTROL3_2 -#undef IPC_SYNC_MESSAGE_CONTROL3_3 -#undef IPC_SYNC_MESSAGE_CONTROL4_1 -#undef IPC_SYNC_MESSAGE_CONTROL4_2 -#undef IPC_SYNC_MESSAGE_ROUTED0_0 -#undef IPC_SYNC_MESSAGE_ROUTED0_1 -#undef IPC_SYNC_MESSAGE_ROUTED0_2 -#undef IPC_SYNC_MESSAGE_ROUTED0_3 -#undef IPC_SYNC_MESSAGE_ROUTED1_0 -#undef IPC_SYNC_MESSAGE_ROUTED1_1 -#undef IPC_SYNC_MESSAGE_ROUTED1_2 -#undef IPC_SYNC_MESSAGE_ROUTED1_3 -#undef IPC_SYNC_MESSAGE_ROUTED1_4 -#undef IPC_SYNC_MESSAGE_ROUTED2_0 -#undef IPC_SYNC_MESSAGE_ROUTED2_1 -#undef IPC_SYNC_MESSAGE_ROUTED2_2 -#undef IPC_SYNC_MESSAGE_ROUTED2_3 -#undef IPC_SYNC_MESSAGE_ROUTED3_0 -#undef IPC_SYNC_MESSAGE_ROUTED3_1 -#undef IPC_SYNC_MESSAGE_ROUTED3_2 -#undef IPC_SYNC_MESSAGE_ROUTED3_3 -#undef IPC_SYNC_MESSAGE_ROUTED4_0 -#undef IPC_SYNC_MESSAGE_ROUTED4_1 -#undef IPC_SYNC_MESSAGE_ROUTED4_2 -#undef IPC_SYNC_MESSAGE_ROUTED4_3 -#undef IPC_SYNC_MESSAGE_ROUTED5_0 -#undef IPC_SYNC_MESSAGE_ROUTED5_1 -#undef IPC_SYNC_MESSAGE_ROUTED5_2 -#undef IPC_SYNC_MESSAGE_ROUTED5_3 - #ifndef IPC_LOG_TABLE_CREATED #define IPC_LOG_TABLE_CREATED typedef void (*LogFunction)(uint32 type, @@ -660,65 +601,6 @@ LogFunction g_log_function_mapping[LastMsgIndex]; #elif defined(IPC_MESSAGE_MACROS_CLASSES) #undef IPC_MESSAGE_MACROS_CLASSES - -// Undefine the macros from the previous pass (if any). -#undef IPC_BEGIN_MESSAGES -#undef IPC_END_MESSAGES -#undef IPC_MESSAGE_CONTROL0 -#undef IPC_MESSAGE_CONTROL1 -#undef IPC_MESSAGE_CONTROL2 -#undef IPC_MESSAGE_CONTROL3 -#undef IPC_MESSAGE_CONTROL4 -#undef IPC_MESSAGE_CONTROL5 -#undef IPC_MESSAGE_ROUTED0 -#undef IPC_MESSAGE_ROUTED1 -#undef IPC_MESSAGE_ROUTED2 -#undef IPC_MESSAGE_ROUTED3 -#undef IPC_MESSAGE_ROUTED4 -#undef IPC_MESSAGE_ROUTED5 -#undef IPC_SYNC_MESSAGE_CONTROL0_0 -#undef IPC_SYNC_MESSAGE_CONTROL0_1 -#undef IPC_SYNC_MESSAGE_CONTROL0_2 -#undef IPC_SYNC_MESSAGE_CONTROL0_3 -#undef IPC_SYNC_MESSAGE_CONTROL1_0 -#undef IPC_SYNC_MESSAGE_CONTROL1_1 -#undef IPC_SYNC_MESSAGE_CONTROL1_2 -#undef IPC_SYNC_MESSAGE_CONTROL1_3 -#undef IPC_SYNC_MESSAGE_CONTROL2_0 -#undef IPC_SYNC_MESSAGE_CONTROL2_1 -#undef IPC_SYNC_MESSAGE_CONTROL2_2 -#undef IPC_SYNC_MESSAGE_CONTROL2_3 -#undef IPC_SYNC_MESSAGE_CONTROL3_1 -#undef IPC_SYNC_MESSAGE_CONTROL3_2 -#undef IPC_SYNC_MESSAGE_CONTROL3_3 -#undef IPC_SYNC_MESSAGE_CONTROL4_1 -#undef IPC_SYNC_MESSAGE_CONTROL4_2 -#undef IPC_SYNC_MESSAGE_ROUTED0_0 -#undef IPC_SYNC_MESSAGE_ROUTED0_1 -#undef IPC_SYNC_MESSAGE_ROUTED0_2 -#undef IPC_SYNC_MESSAGE_ROUTED0_3 -#undef IPC_SYNC_MESSAGE_ROUTED1_0 -#undef IPC_SYNC_MESSAGE_ROUTED1_1 -#undef IPC_SYNC_MESSAGE_ROUTED1_2 -#undef IPC_SYNC_MESSAGE_ROUTED1_3 -#undef IPC_SYNC_MESSAGE_ROUTED1_4 -#undef IPC_SYNC_MESSAGE_ROUTED2_0 -#undef IPC_SYNC_MESSAGE_ROUTED2_1 -#undef IPC_SYNC_MESSAGE_ROUTED2_2 -#undef IPC_SYNC_MESSAGE_ROUTED2_3 -#undef IPC_SYNC_MESSAGE_ROUTED3_0 -#undef IPC_SYNC_MESSAGE_ROUTED3_1 -#undef IPC_SYNC_MESSAGE_ROUTED3_2 -#undef IPC_SYNC_MESSAGE_ROUTED3_3 -#undef IPC_SYNC_MESSAGE_ROUTED4_0 -#undef IPC_SYNC_MESSAGE_ROUTED4_1 -#undef IPC_SYNC_MESSAGE_ROUTED4_2 -#undef IPC_SYNC_MESSAGE_ROUTED4_3 -#undef IPC_SYNC_MESSAGE_ROUTED5_0 -#undef IPC_SYNC_MESSAGE_ROUTED5_1 -#undef IPC_SYNC_MESSAGE_ROUTED5_2 -#undef IPC_SYNC_MESSAGE_ROUTED5_3 - #define IPC_BEGIN_MESSAGES(label) #define IPC_END_MESSAGES(label) @@ -734,52 +616,61 @@ LogFunction g_log_function_mapping[LastMsgIndex]; #define IPC_MESSAGE_CONTROL1(msg_class, type1) \ class msg_class : public IPC::MessageWithTuple< Tuple1<type1> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1& arg1) \ + : IPC::MessageWithTuple< Tuple1<type1> >(MSG_ROUTING_CONTROL, \ + ID, \ + MakeRefTuple(arg1)) {} \ }; -#define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \ +#define IPC_MESSAGE_CONTROL2(msg_class, type1, type2) \ class msg_class : public IPC::MessageWithTuple< Tuple2<type1, type2> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1, const type2& arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1& arg1, const type2& arg2) \ + : IPC::MessageWithTuple< Tuple2<type1, type2> >( \ + MSG_ROUTING_CONTROL, \ + ID, \ + MakeRefTuple(arg1, arg2)) {} \ }; -#define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ - class msg_class : \ - public IPC::MessageWithTuple< Tuple3<type1, type2, type3> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1, const type2& arg2, const type3& arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ +#define IPC_MESSAGE_CONTROL3(msg_class, type1, type2, type3) \ + class msg_class : \ + public IPC::MessageWithTuple< Tuple3<type1, type2, type3> > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1& arg1, const type2& arg2, const type3& arg3) \ + : IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \ + MSG_ROUTING_CONTROL, \ + ID, \ + MakeRefTuple(arg1, arg2, arg3)) {} \ }; -#define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ - class msg_class : \ +#define IPC_MESSAGE_CONTROL4(msg_class, type1, type2, type3, type4) \ + class msg_class : \ public IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1, const type2& arg2, const type3& arg3, \ - const type4& arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1& arg1, const type2& arg2, const type3& arg3, \ + const type4& arg4) \ + : IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \ + MSG_ROUTING_CONTROL, \ + ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4)) {} \ }; #define IPC_MESSAGE_CONTROL5(msg_class, type1, type2, type3, type4, type5) \ - class msg_class : \ + class msg_class : \ public IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(const type1& arg1, const type2& arg2, \ - const type3& arg3, const type4& arg4, const type5& arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(const type1& arg1, const type2& arg2, \ + const type3& arg3, const type4& arg4, const type5& arg5) \ + : IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> >( \ + MSG_ROUTING_CONTROL, \ + ID, \ + MakeRefTuple(arg1, arg2, arg3, arg4, arg5)) {} \ }; #define IPC_MESSAGE_ROUTED0(msg_class) \ @@ -791,56 +682,54 @@ LogFunction g_log_function_mapping[LastMsgIndex]; }; #define IPC_MESSAGE_ROUTED1(msg_class, type1) \ - class msg_class : public IPC::MessageWithTuple< Tuple1<type1> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + class msg_class : public IPC::MessageWithTuple< Tuple1<type1> > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(int32 routing_id, const type1& arg1) \ + : IPC::MessageWithTuple< Tuple1<type1> >(routing_id, ID, \ + MakeRefTuple(arg1)) {} \ }; -#define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ - class msg_class \ - : public IPC::MessageWithTuple< Tuple2<type1, type2> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ +#define IPC_MESSAGE_ROUTED2(msg_class, type1, type2) \ + class msg_class : public IPC::MessageWithTuple< Tuple2<type1, type2> > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(int32 routing_id, const type1& arg1, const type2& arg2) \ + : IPC::MessageWithTuple< Tuple2<type1, type2> >( \ + routing_id, ID, MakeRefTuple(arg1, arg2)) {} \ }; -#define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ - class msg_class \ - : public IPC::MessageWithTuple< Tuple3<type1, type2, type3> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ - const type3& arg3); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ +#define IPC_MESSAGE_ROUTED3(msg_class, type1, type2, type3) \ + class msg_class : \ + public IPC::MessageWithTuple< Tuple3<type1, type2, type3> > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ + const type3& arg3) \ + : IPC::MessageWithTuple< Tuple3<type1, type2, type3> >( \ + routing_id, ID, MakeRefTuple(arg1, arg2, arg3)) {} \ }; -#define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ - class msg_class \ - : public IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ - const type3& arg3, const type4& arg4); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ +#define IPC_MESSAGE_ROUTED4(msg_class, type1, type2, type3, type4) \ + class msg_class : \ + public IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ + const type3& arg3, const type4& arg4) \ + : IPC::MessageWithTuple< Tuple4<type1, type2, type3, type4> >( \ + routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4)) {} \ }; #define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \ - class msg_class \ - : public IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, \ - type5> > { \ - public: \ - enum { ID = msg_class##__ID }; \ - msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ - const type3& arg3, const type4& arg4, const type5& arg5); \ - ~msg_class(); \ - static void Log(const Message* msg, std::wstring* l); \ + class msg_class : \ + public IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> > { \ + public: \ + enum { ID = msg_class##__ID }; \ + msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \ + const type3& arg3, const type4& arg4, const type5& arg5) \ + : IPC::MessageWithTuple< Tuple5<type1, type2, type3, type4, type5> >( \ + routing_id, ID, MakeRefTuple(arg1, arg2, arg3, arg4, arg5)) {} \ }; #define IPC_SYNC_MESSAGE_CONTROL0_0(msg_class) \ |