diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-04 20:10:12 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-04 20:10:12 +0000 |
commit | f91cb991c81afccc52824d369973098398c5ce31 (patch) | |
tree | c698170734dd31dc4bdafd87b71b15b351b9fbc8 /chrome/common | |
parent | 844b9cc2b48467247968edefc145488901f9a3fd (diff) | |
download | chromium_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')
-rw-r--r-- | chrome/common/common.scons | 3 | ||||
-rw-r--r-- | chrome/common/common.vcproj | 8 | ||||
-rw-r--r-- | chrome/common/ipc_fuzzing_tests.cc | 7 | ||||
-rw-r--r-- | chrome/common/ipc_logging.cc | 30 | ||||
-rw-r--r-- | chrome/common/ipc_logging.h | 17 | ||||
-rw-r--r-- | chrome/common/ipc_message_macros.h | 38 | ||||
-rw-r--r-- | chrome/common/ipc_message_utils.h | 32 | ||||
-rw-r--r-- | chrome/common/ipc_sync_channel_unittest.cc | 7 | ||||
-rw-r--r-- | chrome/common/ipc_sync_channel_unittest.h | 19 | ||||
-rw-r--r-- | chrome/common/ipc_sync_message_unittest.cc | 8 | ||||
-rw-r--r-- | chrome/common/ipc_sync_message_unittest.h | 11 | ||||
-rw-r--r-- | chrome/common/plugin_messages.cc | 23 | ||||
-rw-r--r-- | chrome/common/plugin_messages.h | 24 | ||||
-rw-r--r-- | chrome/common/plugin_messages_internal.h | 10 | ||||
-rw-r--r-- | chrome/common/render_messages.cc | 22 | ||||
-rw-r--r-- | chrome/common/render_messages.h | 28 | ||||
-rw-r--r-- | chrome/common/render_messages_internal.h | 6 |
17 files changed, 118 insertions, 175 deletions
diff --git a/chrome/common/common.scons b/chrome/common/common.scons index 5ee52f0..9066f8e 100644 --- a/chrome/common/common.scons +++ b/chrome/common/common.scons @@ -94,10 +94,8 @@ input_files = ChromeFileList([ 'ipc_sync_channel.h', 'ipc_sync_message.cc', 'ipc_sync_message.h', - 'plugin_messages.cc', 'plugin_messages.h', 'plugin_messages_internal.h', - 'render_messages.cc', 'render_messages.h', 'render_messages_internal.h', ]), @@ -230,7 +228,6 @@ if not env.Bit('windows'): 'gfx/path.cc', 'ipc_logging.cc', 'os_exchange_data.cc', - 'plugin_messages.cc', 'process_watcher.cc', ) diff --git a/chrome/common/common.vcproj b/chrome/common/common.vcproj index c0f6af6..c3986d2b 100644 --- a/chrome/common/common.vcproj +++ b/chrome/common/common.vcproj @@ -285,10 +285,6 @@ > </File> <File - RelativePath=".\plugin_messages.cc" - > - </File> - <File RelativePath=".\plugin_messages.h" > </File> @@ -297,10 +293,6 @@ > </File> <File - RelativePath=".\render_messages.cc" - > - </File> - <File RelativePath=".\render_messages.h" > </File> diff --git a/chrome/common/ipc_fuzzing_tests.cc b/chrome/common/ipc_fuzzing_tests.cc index cbd2bd3..0638bb4 100644 --- a/chrome/common/ipc_fuzzing_tests.cc +++ b/chrome/common/ipc_fuzzing_tests.cc @@ -96,10 +96,9 @@ TEST(IPCMessageIntegrity, ReadVectorTooLarge2) { EXPECT_FALSE(ReadParam(&m, &iter, &vec)); } -// Typically the ipc_message_macros files is included twice but here we only -// include it once in 'enum mode' because we want more control of the class -// definitions. -#define IPC_MESSAGE_MACROS_ENUMS +// We don't actually use the messages defined in this file, but we do this +// to get to the IPC macros. +#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h" #include "chrome/common/ipc_message_macros.h" enum IPCMessageIds { diff --git a/chrome/common/ipc_logging.cc b/chrome/common/ipc_logging.cc index ec2fe82..2946093 100644 --- a/chrome/common/ipc_logging.cc +++ b/chrome/common/ipc_logging.cc @@ -41,6 +41,8 @@ Logging::Logging() consumer_(NULL), queue_invoke_later_pending_(false), main_thread_(MessageLoop::current()) { + memset(log_function_mapping_, sizeof(log_function_mapping_), 0); + // Create an event for this browser instance that's set when logging is // enabled, so child processes can know when logging is enabled. int browser_pid; @@ -88,8 +90,18 @@ void Logging::OnObjectSignaled(HANDLE object) { RegisterWaitForEvent(!enabled_); } +void Logging::RegisterMessageLogger(int msg_start, LogFunction* func) { + int msg_class = msg_start >> 12; + if (msg_class > arraysize(log_function_mapping_)) { + NOTREACHED(); + return; + } + + log_function_mapping_[msg_class] = func; +} + std::wstring Logging::GetEventName(bool enabled) { - return Logging::current()->GetEventName(GetCurrentProcessId(), enabled); + return current()->GetEventName(GetCurrentProcessId(), enabled); } std::wstring Logging::GetEventName(int browser_pid, bool enabled) { @@ -188,24 +200,12 @@ void Logging::OnPostDispatchMessage(const Message& message, } } -// static -LogFunction* g_log_function_mapping[16]; -void RegisterMessageLogger(int msg_start, LogFunction* func) { - int msg_class = msg_start >> 12; - if (msg_class > arraysize(g_log_function_mapping)) { - NOTREACHED(); - return; - } - - g_log_function_mapping[msg_class] = func; -} - void Logging::GetMessageText(uint16 type, std::wstring* name, const Message* message, std::wstring* params) { int message_class = type >> 12; - if (g_log_function_mapping[message_class] != NULL) { - g_log_function_mapping[message_class](type, name, message, params); + if (current()->log_function_mapping_[message_class] != NULL) { + current()->log_function_mapping_[message_class](type, name, message, params); } else { DLOG(INFO) << "No logger function associated with message class " << message_class; diff --git a/chrome/common/ipc_logging.h b/chrome/common/ipc_logging.h index 567ba84..bf49595 100644 --- a/chrome/common/ipc_logging.h +++ b/chrome/common/ipc_logging.h @@ -12,6 +12,7 @@ #include "base/lock.h" #include "base/object_watcher.h" #include "base/singleton.h" +#include "chrome/common/ipc_message_utils.h" class MessageLoop; @@ -27,7 +28,7 @@ class Logging : public base::ObjectWatcher::Delegate { // Implemented by consumers of log messages. class Consumer { public: - virtual void Log(const IPC::LogData& data) = 0; + virtual void Log(const LogData& data) = 0; }; void SetConsumer(Consumer* consumer); @@ -41,7 +42,7 @@ class Logging : public base::ObjectWatcher::Delegate { // Called by child processes to give the logger object the channel to send // logging data to the browser process. - void SetIPCSender(IPC::Message::Sender* sender); + void SetIPCSender(Message::Sender* sender); // Called in the browser process when logging data from a child process is // received. @@ -66,8 +67,14 @@ class Logging : public base::ObjectWatcher::Delegate { // ObjectWatcher::Delegate implementation void OnObjectSignaled(HANDLE object); + typedef void (LogFunction)(uint16 type, + std::wstring* name, + const Message* msg, + std::wstring* params); + void RegisterMessageLogger(int msg_start, LogFunction* func); + private: - friend struct DefaultSingletonTraits<IPC::Logging>; + friend struct DefaultSingletonTraits<Logging>; Logging(); std::wstring GetEventName(int browser_pid, bool enabled); @@ -85,10 +92,12 @@ class Logging : public base::ObjectWatcher::Delegate { std::vector<LogData> queued_logs_; bool queue_invoke_later_pending_; - IPC::Message::Sender* sender_; + Message::Sender* sender_; MessageLoop* main_thread_; Consumer* consumer_; + + LogFunction* log_function_mapping_[LastMsgIndex]; }; } // namespace IPC diff --git a/chrome/common/ipc_message_macros.h b/chrome/common/ipc_message_macros.h index e724e2e..e723ffe 100644 --- a/chrome/common/ipc_message_macros.h +++ b/chrome/common/ipc_message_macros.h @@ -41,6 +41,33 @@ #include "chrome/common/ipc_message_utils.h" + +#ifndef MESSAGES_INTERNAL_FILE +#error This file should only be included by X_messages.h, which needs to define MESSAGES_INTERNAL_FILE first. +#endif + +#ifndef IPC_MESSAGE_MACROS_INCLUDE_BLOCK +#define IPC_MESSAGE_MACROS_INCLUDE_BLOCK + +// Multi-pass include of X_messages_internal.h. Preprocessor magic allows +// us to use 1 header to define the enums and classes for our render messages. +#define IPC_MESSAGE_MACROS_ENUMS +#include MESSAGES_INTERNAL_FILE + +#define IPC_MESSAGE_MACROS_CLASSES +#include MESSAGES_INTERNAL_FILE + +#ifdef IPC_MESSAGE_MACROS_LOG_ENABLED +#define IPC_MESSAGE_MACROS_LOG +#include MESSAGES_INTERNAL_FILE +#endif + +#undef MESSAGES_INTERNAL_FILE +#undef IPC_MESSAGE_MACROS_INCLUDE_BLOCK + +#endif + + // Undefine the macros from the previous pass (if any). #undef IPC_BEGIN_MESSAGES #undef IPC_END_MESSAGES @@ -102,10 +129,11 @@ // 16 channel types (currently using 8) and 4K messages per type. Should // really make type be 32 bits, but then we break automation with older Chrome // builds.. -#define IPC_BEGIN_MESSAGES(label, start) \ + +#define IPC_BEGIN_MESSAGES(label) \ enum label##MsgType { \ - label##Start = start << 12, \ - label##PreStart = (start << 12) - 1, // Do this so that automation messages keep the same id as before + label##Start = label##MsgStart << 12, \ + label##PreStart = (label##MsgStart << 12) - 1, // Do this so that automation messages keep the same id as before #define IPC_END_MESSAGES(label) \ label##End \ @@ -341,7 +369,7 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \ #elif defined(IPC_MESSAGE_MACROS_LOG) #undef IPC_MESSAGE_MACROS_LOG -#define IPC_BEGIN_MESSAGES(label, start) \ +#define IPC_BEGIN_MESSAGES(label) \ void label##MsgLog(uint16 type, std::wstring* name, const IPC::Message* msg, std::wstring* params) { \ switch (type) { @@ -510,7 +538,7 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \ #elif defined(IPC_MESSAGE_MACROS_CLASSES) #undef IPC_MESSAGE_MACROS_CLASSES -#define IPC_BEGIN_MESSAGES(label, start) +#define IPC_BEGIN_MESSAGES(label) #define IPC_END_MESSAGES(label) #define IPC_MESSAGE_CONTROL0(msg_class) \ 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. diff --git a/chrome/common/ipc_sync_channel_unittest.cc b/chrome/common/ipc_sync_channel_unittest.cc index 53d3f2a..2ccbd96 100644 --- a/chrome/common/ipc_sync_channel_unittest.cc +++ b/chrome/common/ipc_sync_channel_unittest.cc @@ -20,12 +20,9 @@ #include "chrome/common/stl_util-inl.h" #include "testing/gtest/include/gtest/gtest.h" -#define IPC_MESSAGE_MACROS_ENUMS -#include "chrome/common/ipc_sync_channel_unittest.h" -// define the classes -#define IPC_MESSAGE_MACROS_CLASSES -#include "chrome/common/ipc_sync_channel_unittest.h" +#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h" +#include "chrome/common/ipc_message_macros.h" using namespace IPC; using base::WaitableEvent; diff --git a/chrome/common/ipc_sync_channel_unittest.h b/chrome/common/ipc_sync_channel_unittest.h deleted file mode 100644 index c4d2354..0000000 --- a/chrome/common/ipc_sync_channel_unittest.h +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/common/ipc_message_macros.h" - -// Messages used for IPC::SyncChannel unit test -IPC_BEGIN_MESSAGES(SyncChannelTest, 9) - IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_NoArgs) - - IPC_SYNC_MESSAGE_CONTROL0_1(SyncChannelTestMsg_AnswerToLife, - int /* answer */) - - IPC_SYNC_MESSAGE_CONTROL1_1(SyncChannelTestMsg_Double, - int /* in */, - int /* out */) - -IPC_END_MESSAGES(SyncChannelTest) - diff --git a/chrome/common/ipc_sync_message_unittest.cc b/chrome/common/ipc_sync_message_unittest.cc index ae44acb..6508eaf 100644 --- a/chrome/common/ipc_sync_message_unittest.cc +++ b/chrome/common/ipc_sync_message_unittest.cc @@ -14,13 +14,9 @@ #include "base/logging.h" #include "testing/gtest/include/gtest/gtest.h" -#define IPC_MESSAGE_MACROS_ENUMS -#include "chrome/common/ipc_sync_message_unittest.h" - -// define the classes -#define IPC_MESSAGE_MACROS_CLASSES -#include "chrome/common/ipc_sync_message_unittest.h" +#define MESSAGES_INTERNAL_FILE "chrome/common/ipc_sync_message_unittest.h" +#include "chrome/common/ipc_message_macros.h" static IPC::Message* g_reply; diff --git a/chrome/common/ipc_sync_message_unittest.h b/chrome/common/ipc_sync_message_unittest.h index 8393533..3b32c10 100644 --- a/chrome/common/ipc_sync_message_unittest.h +++ b/chrome/common/ipc_sync_message_unittest.h @@ -4,7 +4,16 @@ #include "chrome/common/ipc_message_macros.h" -IPC_BEGIN_MESSAGES(TestMsg, 8) +IPC_BEGIN_MESSAGES(Test) + IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_NoArgs) + + IPC_SYNC_MESSAGE_CONTROL0_1(SyncChannelTestMsg_AnswerToLife, + int /* answer */) + + IPC_SYNC_MESSAGE_CONTROL1_1(SyncChannelTestMsg_Double, + int /* in */, + int /* out */) + // out1 is false IPC_SYNC_MESSAGE_CONTROL0_1(Msg_C_0_1, bool) diff --git a/chrome/common/plugin_messages.cc b/chrome/common/plugin_messages.cc deleted file mode 100644 index cd5b00a..0000000 --- a/chrome/common/plugin_messages.cc +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/common/ipc_message.h" - -#ifdef IPC_MESSAGE_LOG_ENABLED - -#define IPC_MESSAGE_MACROS_LOG_ENABLED - -#endif // IPC_MESSAGE_LOG_ENABLED - -#include "chrome/common/plugin_messages.h" - -void PluginMessagesInit() { -#ifdef IPC_MESSAGE_LOG_ENABLED - IPC::RegisterMessageLogger(PluginProcessStart, PluginProcessMsgLog); - IPC::RegisterMessageLogger(PluginProcessHostStart, PluginProcessHostMsgLog); - IPC::RegisterMessageLogger(PluginStart, PluginMsgLog); - IPC::RegisterMessageLogger(PluginHostStart, PluginHostMsgLog); - IPC::RegisterMessageLogger(NPObjectStart, NPObjectMsgLog); -#endif -} diff --git a/chrome/common/plugin_messages.h b/chrome/common/plugin_messages.h index 025acc2..8a6a63a 100644 --- a/chrome/common/plugin_messages.h +++ b/chrome/common/plugin_messages.h @@ -15,14 +15,11 @@ #include "base/gfx/rect.h" #include "base/basictypes.h" -#include "chrome/common/ipc_message.h" #include "chrome/common/ipc_message_utils.h" #include "googleurl/src/gurl.h" #include "third_party/npapi/bindings/npapi.h" #include "webkit/glue/npruntime_util.h" -void PluginMessagesInit(); - // Name prefix of the event handle when a message box is displayed. #define kMessageBoxEventPrefix L"message_box_active" @@ -103,23 +100,6 @@ struct NPVariant_Param { }; -#define IPC_MESSAGE_MACROS_ENUMS -#include "chrome/common/plugin_messages_internal.h" - -#ifdef IPC_MESSAGE_MACROS_LOG_ENABLED -# undef IPC_MESSAGE_MACROS_LOG -# define IPC_MESSAGE_MACROS_CLASSES - -# include "chrome/common/plugin_messages_internal.h" -# define IPC_MESSAGE_MACROS_LOG -# undef IPC_MESSAGE_MACROS_CLASSES - -# include "chrome/common/plugin_messages_internal.h" -#else -# define IPC_MESSAGE_MACROS_CLASSES -# include "chrome/common/plugin_messages_internal.h" -#endif - namespace IPC { // Traits for PluginMsg_Init_Params structure to pack/unpack. @@ -475,5 +455,9 @@ struct ParamTraits<NPVariant_Param> { } // namespace IPC + +#define MESSAGES_INTERNAL_FILE "chrome/common/plugin_messages_internal.h" +#include "chrome/common/ipc_message_macros.h" + #endif // CHROME_COMMON_PLUGIN_MESSAGES_H__ diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h index 85093d5..d8561d0 100644 --- a/chrome/common/plugin_messages_internal.h +++ b/chrome/common/plugin_messages_internal.h @@ -9,7 +9,7 @@ //----------------------------------------------------------------------------- // PluginProcess messages // These are messages sent from the browser to the plugin process. -IPC_BEGIN_MESSAGES(PluginProcess, 3) +IPC_BEGIN_MESSAGES(PluginProcess) // Tells the plugin process to create a new channel for communication with a // renderer. The channel name is returned in a // PluginProcessHostMsg_ChannelCreated message. @@ -35,7 +35,7 @@ IPC_END_MESSAGES(PluginProcess) //----------------------------------------------------------------------------- // PluginProcessHost messages // These are messages sent from the plugin process to the browser process. -IPC_BEGIN_MESSAGES(PluginProcessHost, 4) +IPC_BEGIN_MESSAGES(PluginProcessHost) // Response to a PluginProcessMsg_CreateChannel message. IPC_MESSAGE_CONTROL2(PluginProcessHostMsg_ChannelCreated, int /* process_id */, @@ -92,7 +92,7 @@ IPC_END_MESSAGES(PluginProcessHost) //----------------------------------------------------------------------------- // Plugin messages // These are messages sent from the renderer process to the plugin process. -IPC_BEGIN_MESSAGES(Plugin, 5) +IPC_BEGIN_MESSAGES(Plugin) // Tells the plugin process to create a new plugin instance with the given // id. A corresponding WebPluginDelegateStub is created which hosts the // WebPluginDelegateImpl. @@ -202,7 +202,7 @@ IPC_END_MESSAGES(Plugin) // PluginHost messages // These are messages sent from the plugin process to the renderer process. // They all map to the corresponding WebPlugin methods. -IPC_BEGIN_MESSAGES(PluginHost, 6) +IPC_BEGIN_MESSAGES(PluginHost) // Sends the plugin window information to the renderer. // The window parameter is a handle to the window if the plugin is a windowed // plugin. It is NULL for windowless plugins. @@ -274,7 +274,7 @@ IPC_END_MESSAGES(PluginHost) // NPObject messages // These are messages used to marshall NPObjects. They are sent both from the // plugin to the renderer and from the renderer to the plugin. -IPC_BEGIN_MESSAGES(NPObject, 7) +IPC_BEGIN_MESSAGES(NPObject) IPC_SYNC_MESSAGE_ROUTED0_0(NPObjectMsg_Release) IPC_SYNC_MESSAGE_ROUTED1_1(NPObjectMsg_HasMethod, diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc deleted file mode 100644 index 55f21552..0000000 --- a/chrome/common/render_messages.cc +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/common/ipc_message.h" - -#ifdef IPC_MESSAGE_LOG_ENABLED - -// Preprocessor magic: render_messages.h defines the enums and debug string -// functions if this define is set. -#define IPC_MESSAGE_MACROS_LOG_ENABLED - -#endif // IPC_MESSAGE_LOG_ENABLED - -#include "chrome/common/render_messages.h" - -void RenderMessagesInit() { -#ifdef IPC_MESSAGE_LOG_ENABLED - IPC::RegisterMessageLogger(ViewStart, ViewMsgLog); - IPC::RegisterMessageLogger(ViewHostStart, ViewHostMsgLog); -#endif -} diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 95c7e6d..c1f056a 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -15,7 +15,6 @@ #include "base/shared_memory.h" #include "chrome/common/bitmap_wire_data.h" #include "chrome/common/filter_policy.h" -#include "chrome/common/ipc_message.h" #include "chrome/common/ipc_message_utils.h" #include "chrome/common/modal_dialog_event.h" #include "chrome/common/page_transition_types.h" @@ -31,6 +30,7 @@ #include "webkit/glue/resource_loader_bridge.h" #include "webkit/glue/screen_info.h" #include "webkit/glue/webdropdata.h" +#include "webkit/glue/webinputevent.h" #include "webkit/glue/webplugin.h" #include "webkit/glue/webpreferences.h" #include "webkit/glue/webview_delegate.h" @@ -446,28 +446,6 @@ enum ViewHostMsg_ImeControl { IME_COMPLETE_COMPOSITION, }; -// Multi-pass include of render_messages_internal. Preprocessor magic allows -// us to use 1 header to define the enums and classes for our render messages. -#define IPC_MESSAGE_MACROS_ENUMS -#include "chrome/common/render_messages_internal.h" - -#ifdef IPC_MESSAGE_MACROS_LOG_ENABLED -// When we are supposed to create debug strings, we run it through twice, once -// with debug strings on, and once with only CLASSES on to generate both types -// of messages. -# undef IPC_MESSAGE_MACROS_LOG -# define IPC_MESSAGE_MACROS_CLASSES -# include "chrome/common/render_messages_internal.h" - -# undef IPC_MESSAGE_MACROS_CLASSES -# define IPC_MESSAGE_MACROS_LOG -# include "chrome/common/render_messages_internal.h" -#else -// No debug strings requested, just define the classes -# define IPC_MESSAGE_MACROS_CLASSES -# include "chrome/common/render_messages_internal.h" -#endif - namespace IPC { @@ -1761,4 +1739,8 @@ struct ParamTraits<gfx::NativeView> { } // namespace IPC + +#define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" +#include "chrome/common/ipc_message_macros.h" + #endif // CHROME_COMMON_RENDER_MESSAGES_H_ diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h index 149dd53..120f033 100644 --- a/chrome/common/render_messages_internal.h +++ b/chrome/common/render_messages_internal.h @@ -25,8 +25,6 @@ #include "webkit/glue/webinputevent.h" #include "webkit/glue/webplugin.h" -void RenderMessagesInit(); - // TODO(mpcomplete): rename ViewMsg and ViewHostMsg to something that makes // more sense with our current design. @@ -34,7 +32,7 @@ void RenderMessagesInit(); // RenderView messages // These are messages sent from the browser to the renderer process. -IPC_BEGIN_MESSAGES(View, 1) +IPC_BEGIN_MESSAGES(View) // Used typically when recovering from a crash. The new rendering process // sets its global "next page id" counter to the given value. IPC_MESSAGE_CONTROL1(ViewMsg_SetNextPageID, @@ -486,7 +484,7 @@ IPC_END_MESSAGES(View) // WebContents messages // These are messages sent from the renderer to the browser process. -IPC_BEGIN_MESSAGES(ViewHost, 2) +IPC_BEGIN_MESSAGES(ViewHost) // Sent by the renderer when it is creating a new window. The browser creates // a tab for it and responds with a ViewMsg_CreatingNew_ACK. If route_id is // MSG_ROUTING_NONE, the view couldn't be created. modal_dialog_event is set |