summaryrefslogtreecommitdiffstats
path: root/chrome/common/ipc_message_utils.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-04 20:10:12 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-04 20:10:12 +0000
commitf91cb991c81afccc52824d369973098398c5ce31 (patch)
treec698170734dd31dc4bdafd87b71b15b351b9fbc8 /chrome/common/ipc_message_utils.h
parent844b9cc2b48467247968edefc145488901f9a3fd (diff)
downloadchromium_src-f91cb991c81afccc52824d369973098398c5ce31.zip
chromium_src-f91cb991c81afccc52824d369973098398c5ce31.tar.gz
chromium_src-f91cb991c81afccc52824d369973098398c5ce31.tar.bz2
Commit just the changes to make creating new IPC channel types easier.
TBR=mpcomplete Review URL: http://codereview.chromium.org/21052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9167 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_message_utils.h')
-rw-r--r--chrome/common/ipc_message_utils.h32
1 files changed, 24 insertions, 8 deletions
diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h
index 39bb231..d76e695 100644
--- a/chrome/common/ipc_message_utils.h
+++ b/chrome/common/ipc_message_utils.h
@@ -34,16 +34,32 @@ namespace webkit_glue {
struct WebApplicationInfo;
} // namespace webkit_glue
-namespace IPC {
+// Used by IPC_BEGIN_MESSAGES so that each message class starts from a unique
+// base. Messages have unique IDs across channels in order for the IPC logging
+// code to figure out the message class from its ID.
+enum IPCMessageStart {
+ // By using a start value of 0 for automation messages, we keep backward
+ // compatibility with old builds.
+ AutomationMsgStart = 0,
+ ViewMsgStart,
+ ViewHostMsgStart,
+ PluginProcessMsgStart,
+ PluginProcessHostMsgStart,
+ PluginMsgStart,
+ PluginHostMsgStart,
+ NPObjectMsgStart,
+ TestMsgStart,
+ // NOTE: When you add a new message class, also update
+ // IPCStatusView::IPCStatusView to ensure logging works.
+ // NOTE: this enum is used by IPC_MESSAGE_MACRO to generate a unique message
+ // id. Only 4 bits are used for the message type, so if this enum needs more
+ // than 16 entries, that code needs to be updated.
+ LastMsgIndex
+};
-// Used by the message macros to register a logging function based on the
-// message class.
-typedef void (LogFunction)(uint16 type,
- std::wstring* name,
- const IPC::Message* msg,
- std::wstring* params);
-void RegisterMessageLogger(int msg_start, LogFunction* func);
+COMPILE_ASSERT(LastMsgIndex <= 16, need_to_update_IPC_MESSAGE_MACRO);
+namespace IPC {
//-----------------------------------------------------------------------------
// An iterator class for reading the fields contained within a Message.