summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 19:23:43 +0000
committertsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 19:23:43 +0000
commit5808f7d72453c05c7e2722c6f30d1326c8759b4f (patch)
treefc75d0c3f568ee5dfc6f80018df62f29ff6efaed
parentafcea9b86d92d41ef6bd761d827c665f8df1b15d (diff)
downloadchromium_src-5808f7d72453c05c7e2722c6f30d1326c8759b4f.zip
chromium_src-5808f7d72453c05c7e2722c6f30d1326c8759b4f.tar.gz
chromium_src-5808f7d72453c05c7e2722c6f30d1326c8759b4f.tar.bz2
Convert devtools messages, nacl messages to new message format.
Review URL: http://codereview.chromium.org/6686054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78070 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/chrome_common.gypi2
-rw-r--r--chrome/common/devtools_messages.cc29
-rw-r--r--chrome/common/devtools_messages.h97
-rw-r--r--chrome/common/devtools_messages_internal.h90
-rw-r--r--chrome/common/nacl_messages.cc29
-rw-r--r--chrome/common/nacl_messages.h31
-rw-r--r--chrome/common/nacl_messages_internal.h29
7 files changed, 178 insertions, 129 deletions
diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi
index 1ddbac4..b3b67c6 100644
--- a/chrome/chrome_common.gypi
+++ b/chrome/chrome_common.gypi
@@ -52,7 +52,6 @@
'common/content_settings_types.h',
'common/devtools_messages.cc',
'common/devtools_messages.h',
- 'common/devtools_messages_internal.h',
'common/dom_storage_messages.cc',
'common/dom_storage_messages.h',
'common/font_config_ipc_linux.cc',
@@ -85,7 +84,6 @@
'common/nacl_cmd_line.h',
'common/nacl_messages.cc',
'common/nacl_messages.h',
- 'common/nacl_messages_internal.h',
'common/nacl_types.h',
'common/pepper_file_messages.cc',
'common/pepper_file_messages.h',
diff --git a/chrome/common/devtools_messages.cc b/chrome/common/devtools_messages.cc
index 4efa63d..31fc122 100644
--- a/chrome/common/devtools_messages.cc
+++ b/chrome/common/devtools_messages.cc
@@ -2,5 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// Get basic type definitions.
#define IPC_MESSAGE_IMPL
#include "chrome/common/devtools_messages.h"
+#include "chrome/common/common_param_traits.h"
+
+// Generate constructors.
+#include "ipc/struct_constructor_macros.h"
+#include "chrome/common/devtools_messages.h"
+
+// Generate destructors.
+#include "ipc/struct_destructor_macros.h"
+#include "chrome/common/devtools_messages.h"
+
+// Generate param traits write methods.
+#include "ipc/param_traits_write_macros.h"
+namespace IPC {
+#include "chrome/common/devtools_messages.h"
+} // namespace IPC
+
+// Generate param traits read methods.
+#include "ipc/param_traits_read_macros.h"
+namespace IPC {
+#include "chrome/common/devtools_messages.h"
+} // namespace IPC
+
+// Generate param traits log methods.
+#include "ipc/param_traits_log_macros.h"
+namespace IPC {
+#include "chrome/common/devtools_messages.h"
+} // namespace IPC
+
diff --git a/chrome/common/devtools_messages.h b/chrome/common/devtools_messages.h
index ab54b51..79eba01 100644
--- a/chrome/common/devtools_messages.h
+++ b/chrome/common/devtools_messages.h
@@ -2,15 +2,102 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_COMMON_DEVTOOLS_MESSAGES_H_
-#define CHROME_COMMON_DEVTOOLS_MESSAGES_H_
-#pragma once
+// Developer tools consist of the following parts:
+//
+// DevToolsAgent lives in the renderer of an inspected page and provides access
+// to the pages resources, DOM, v8 etc. by means of IPC messages.
+//
+// DevToolsClient is a thin delegate that lives in the tools front-end
+// renderer and converts IPC messages to frontend method calls and allows the
+// frontend to send messages to the DevToolsAgent.
+//
+// All the messages are routed through browser process. There is a
+// DevToolsManager living in the browser process that is responsible for
+// routing logistics. It is also capable of sending direct messages to the
+// agent rather than forwarding messages between agents and clients only.
+//
+// Chain of communication between the components may be described by the
+// following diagram:
+// ----------------------------
+// | (tools frontend |
+// | renderer process) |
+// | | --------------------
+// |tools <--> DevToolsClient+<-- IPC -->+ (browser process) |
+// |frontend | | |
+// ---------------------------- ---------+----------
+// ^
+// |
+// IPC
+// |
+// v
+// --------------------------+--------
+// | inspected page <--> DevToolsAgent |
+// | |
+// | (inspected page renderer process) |
+// -----------------------------------
+//
+// This file describes developer tools message types.
+// Multiply-included message file, no standard include guard.
#include <map>
#include <string>
-typedef std::map<std::string, std::string> DevToolsRuntimeProperties;
+#include "ipc/ipc_message_macros.h"
+
+// Singly-included section not yet converted.
+#ifndef CHROME_COMMON_DEVTOOLS_MESSAGES_H_
+#define CHROME_COMMON_DEVTOOLS_MESSAGES_H_
-#include "chrome/common/devtools_messages_internal.h"
+typedef std::map<std::string, std::string> DevToolsRuntimeProperties;
#endif // CHROME_COMMON_DEVTOOLS_MESSAGES_H_
+
+#define IPC_MESSAGE_START DevToolsMsgStart
+
+// These are messages sent from DevToolsAgent to DevToolsClient through the
+// browser.
+// WebKit-level transport.
+IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DispatchOnInspectorFrontend,
+ std::string /* message */)
+
+// Legacy debugger output message.
+IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DebuggerOutput,
+ std::string /* message */)
+
+// Legacy APU dispatch message.
+IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DispatchToAPU,
+ std::string /* message */)
+
+
+//-----------------------------------------------------------------------------
+// These are messages sent from DevToolsClient to DevToolsAgent through the
+// browser.
+// Tells agent that there is a client host connected to it.
+IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_Attach,
+ DevToolsRuntimeProperties /* properties */)
+
+// Tells agent that there is no longer a client host connected to it.
+IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_Detach)
+
+// Tells agent that the front-end has been loaded
+IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_FrontendLoaded)
+
+// WebKit-level transport.
+IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_DispatchOnInspectorBackend,
+ std::string /* message */)
+
+// Send debugger command to the debugger agent. Debugger commands should
+// be handled on IO thread(while all other devtools messages are handled in
+// the render thread) to allow executing the commands when v8 is on a
+// breakpoint.
+IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_DebuggerCommand,
+ std::string /* command */)
+
+// Inspect element with the given coordinates.
+IPC_MESSAGE_CONTROL2(DevToolsAgentMsg_InspectElement,
+ int /* x */,
+ int /* y */)
+
+// Enables/disables the apu agent.
+IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_SetApuAgentEnabled, bool /* enabled */)
+
diff --git a/chrome/common/devtools_messages_internal.h b/chrome/common/devtools_messages_internal.h
deleted file mode 100644
index 6019d60..0000000
--- a/chrome/common/devtools_messages_internal.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) 2009 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.
-
-// Developer tools consist of the following parts:
-//
-// DevToolsAgent lives in the renderer of an inspected page and provides access
-// to the pages resources, DOM, v8 etc. by means of IPC messages.
-//
-// DevToolsClient is a thin delegate that lives in the tools front-end
-// renderer and converts IPC messages to frontend method calls and allows the
-// frontend to send messages to the DevToolsAgent.
-//
-// All the messages are routed through browser process. There is a
-// DevToolsManager living in the browser process that is responsible for
-// routing logistics. It is also capable of sending direct messages to the
-// agent rather than forwarding messages between agents and clients only.
-//
-// Chain of communication between the components may be described by the
-// following diagram:
-// ----------------------------
-// | (tools frontend |
-// | renderer process) |
-// | | --------------------
-// |tools <--> DevToolsClient+<-- IPC -->+ (browser process) |
-// |frontend | | |
-// ---------------------------- ---------+----------
-// ^
-// |
-// IPC
-// |
-// v
-// --------------------------+--------
-// | inspected page <--> DevToolsAgent |
-// | |
-// | (inspected page renderer process) |
-// -----------------------------------
-//
-// This file describes developer tools message types.
-
-#include "ipc/ipc_message_macros.h"
-
-#define IPC_MESSAGE_START DevToolsMsgStart
-
-// These are messages sent from DevToolsAgent to DevToolsClient through the
-// browser.
-// WebKit-level transport.
-IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DispatchOnInspectorFrontend,
- std::string /* message */)
-
-// Legacy debugger output message.
-IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DebuggerOutput,
- std::string /* message */)
-
-// Legacy APU dispatch message.
-IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DispatchToAPU,
- std::string /* message */)
-
-
-//-----------------------------------------------------------------------------
-// These are messages sent from DevToolsClient to DevToolsAgent through the
-// browser.
-// Tells agent that there is a client host connected to it.
-IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_Attach,
- DevToolsRuntimeProperties /* properties */)
-
-// Tells agent that there is no longer a client host connected to it.
-IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_Detach)
-
-// Tells agent that the front-end has been loaded
-IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_FrontendLoaded)
-
-// WebKit-level transport.
-IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_DispatchOnInspectorBackend,
- std::string /* message */)
-
-// Send debugger command to the debugger agent. Debugger commands should
-// be handled on IO thread(while all other devtools messages are handled in
-// the render thread) to allow executing the commands when v8 is on a
-// breakpoint.
-IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_DebuggerCommand,
- std::string /* command */)
-
-// Inspect element with the given coordinates.
-IPC_MESSAGE_CONTROL2(DevToolsAgentMsg_InspectElement,
- int /* x */,
- int /* y */)
-
-// Enables/disables the apu agent.
-IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_SetApuAgentEnabled, bool /* enabled */)
diff --git a/chrome/common/nacl_messages.cc b/chrome/common/nacl_messages.cc
index 1b2aff9..f1be9ae 100644
--- a/chrome/common/nacl_messages.cc
+++ b/chrome/common/nacl_messages.cc
@@ -2,5 +2,34 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// Get basic type definitions.
#define IPC_MESSAGE_IMPL
#include "chrome/common/nacl_messages.h"
+#include "chrome/common/common_param_traits.h"
+
+// Generate constructors.
+#include "ipc/struct_constructor_macros.h"
+#include "chrome/common/nacl_messages.h"
+
+// Generate destructors.
+#include "ipc/struct_destructor_macros.h"
+#include "chrome/common/nacl_messages.h"
+
+// Generate param traits write methods.
+#include "ipc/param_traits_write_macros.h"
+namespace IPC {
+#include "chrome/common/nacl_messages.h"
+} // namespace IPC
+
+// Generate param traits read methods.
+#include "ipc/param_traits_read_macros.h"
+namespace IPC {
+#include "chrome/common/nacl_messages.h"
+} // namespace IPC
+
+// Generate param traits log methods.
+#include "ipc/param_traits_log_macros.h"
+namespace IPC {
+#include "chrome/common/nacl_messages.h"
+} // namespace IPC
+
diff --git a/chrome/common/nacl_messages.h b/chrome/common/nacl_messages.h
index 6c7c771..bcc99fc 100644
--- a/chrome/common/nacl_messages.h
+++ b/chrome/common/nacl_messages.h
@@ -4,10 +4,35 @@
// Defines messages between the browser and NaCl process.
+// Multiply-included message file, no traditional include guard.
+#include "base/process.h"
+#include "chrome/common/nacl_types.h"
+#include "ipc/ipc_message_macros.h"
+
#ifndef CHROME_COMMON_NACL_MESSAGES_H_
#define CHROME_COMMON_NACL_MESSAGES_H_
-#pragma once
-
-#include "chrome/common/nacl_messages_internal.h"
#endif // CHROME_COMMON_NACL_MESSAGES_H_
+
+#define IPC_MESSAGE_START NaClMsgStart
+
+//-----------------------------------------------------------------------------
+// NaClProcess messages
+// These are messages sent from the browser to the NaCl process.
+// Tells the NaCl process to start.
+IPC_MESSAGE_CONTROL1(NaClProcessMsg_Start,
+ std::vector<nacl::FileDescriptor> /* sockets */)
+
+// Tells the NaCl broker to launch a NaCl loader process.
+IPC_MESSAGE_CONTROL1(NaClProcessMsg_LaunchLoaderThroughBroker,
+ std::wstring /* channel ID for the loader */)
+
+// Notify the browser process that the loader was launched successfully.
+IPC_MESSAGE_CONTROL2(NaClProcessMsg_LoaderLaunched,
+ std::wstring, /* channel ID for the loader */
+ base::ProcessHandle /* loader process handle */)
+
+// Notify the broker that all loader processes have been terminated and it
+// should shutdown.
+IPC_MESSAGE_CONTROL0(NaClProcessMsg_StopBroker)
+
diff --git a/chrome/common/nacl_messages_internal.h b/chrome/common/nacl_messages_internal.h
deleted file mode 100644
index ea96a03..0000000
--- a/chrome/common/nacl_messages_internal.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2009 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 "base/process.h"
-#include "chrome/common/nacl_types.h"
-#include "ipc/ipc_message_macros.h"
-
-#define IPC_MESSAGE_START NaClMsgStart
-
-//-----------------------------------------------------------------------------
-// NaClProcess messages
-// These are messages sent from the browser to the NaCl process.
-// Tells the NaCl process to start.
-IPC_MESSAGE_CONTROL1(NaClProcessMsg_Start,
- std::vector<nacl::FileDescriptor> /* sockets */)
-
-// Tells the NaCl broker to launch a NaCl loader process.
-IPC_MESSAGE_CONTROL1(NaClProcessMsg_LaunchLoaderThroughBroker,
- std::wstring /* channel ID for the loader */)
-
-// Notify the browser process that the loader was launched successfully.
-IPC_MESSAGE_CONTROL2(NaClProcessMsg_LoaderLaunched,
- std::wstring, /* channel ID for the loader */
- base::ProcessHandle /* loader process handle */)
-
-// Notify the broker that all loader processes have been terminated and it
-// should shutdown.
-IPC_MESSAGE_CONTROL0(NaClProcessMsg_StopBroker)