summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/debugger/inspectable_tab_proxy.cc17
-rw-r--r--chrome/browser/debugger/inspectable_tab_proxy.h7
-rw-r--r--chrome/browser/extensions/extension_devtools_bridge.cc12
-rw-r--r--chrome/browser/extensions/extension_devtools_bridge.h7
-rw-r--r--chrome/common/devtools_messages.h27
-rw-r--r--chrome/common/devtools_messages_internal.h17
-rw-r--r--chrome/renderer/devtools_agent.cc43
-rw-r--r--chrome/renderer/devtools_agent.h15
-rw-r--r--chrome/renderer/devtools_agent_filter.cc27
-rw-r--r--chrome/renderer/devtools_agent_filter.h14
-rw-r--r--chrome/renderer/devtools_client.cc27
-rw-r--r--chrome/renderer/devtools_client.h15
12 files changed, 145 insertions, 83 deletions
diff --git a/chrome/browser/debugger/inspectable_tab_proxy.cc b/chrome/browser/debugger/inspectable_tab_proxy.cc
index 159be0b..29e5d32 100644
--- a/chrome/browser/debugger/inspectable_tab_proxy.cc
+++ b/chrome/browser/debugger/inspectable_tab_proxy.cc
@@ -34,18 +34,21 @@ void DevToolsClientHostImpl::SendMessageToClient(
IPC_END_MESSAGE_MAP()
}
-void DevToolsClientHostImpl::OnRpcMessage(const DevToolsMessageData& data) {
+void DevToolsClientHostImpl::OnRpcMessage(const std::string& class_name,
+ const std::string& message_name,
+ const std::string& param1,
+ const std::string& param2,
+ const std::string& param3) {
static const std::string kDebuggerAgentDelegate = "DebuggerAgentDelegate";
static const std::string kToolsAgentDelegate = "ToolsAgentDelegate";
static const std::string kDebuggerOutput = "DebuggerOutput";
static const std::string kFrameNavigate = "FrameNavigate";
- if (data.class_name == kDebuggerAgentDelegate &&
- data.method_name == kDebuggerOutput) {
- DebuggerOutput(data.arguments[0]);
- } else if (data.class_name == kToolsAgentDelegate &&
- data.method_name == kFrameNavigate) {
- FrameNavigate(data.arguments[0]);
+ if (class_name == kDebuggerAgentDelegate && message_name == kDebuggerOutput) {
+ DebuggerOutput(param1);
+ } else if (class_name == kToolsAgentDelegate &&
+ message_name == kFrameNavigate) {
+ FrameNavigate(param1);
}
}
diff --git a/chrome/browser/debugger/inspectable_tab_proxy.h b/chrome/browser/debugger/inspectable_tab_proxy.h
index 67b5952..13da2ec 100644
--- a/chrome/browser/debugger/inspectable_tab_proxy.h
+++ b/chrome/browser/debugger/inspectable_tab_proxy.h
@@ -15,7 +15,6 @@ class DebuggerRemoteService;
class DevToolsClientHost;
class DevToolsClientHostImpl;
class NavigationController;
-struct DevToolsMessageData;
// Proxies debugged tabs' NavigationControllers using their UIDs.
// Keeps track of tabs being debugged so that we can detach from
@@ -82,7 +81,11 @@ class DevToolsClientHostImpl : public DevToolsClientHost {
private:
// Message handling routines
- void OnRpcMessage(const DevToolsMessageData& data);
+ void OnRpcMessage(const std::string& class_name,
+ const std::string& message_name,
+ const std::string& param1,
+ const std::string& param2,
+ const std::string& param3);
void DebuggerOutput(const std::string& msg);
void FrameNavigate(const std::string& url);
void TabClosed();
diff --git a/chrome/browser/extensions/extension_devtools_bridge.cc b/chrome/browser/extensions/extension_devtools_bridge.cc
index dcf6375..99f515b 100644
--- a/chrome/browser/extensions/extension_devtools_bridge.cc
+++ b/chrome/browser/extensions/extension_devtools_bridge.cc
@@ -80,12 +80,16 @@ void ExtensionDevToolsBridge::SendMessageToClient(const IPC::Message& msg) {
static const char kApuAgentClassName[] = "ApuAgentDelegate";
static const char kApuPageEventMessageName[] = "DispatchToApu";
-void ExtensionDevToolsBridge::OnRpcMessage(const DevToolsMessageData& data) {
+void ExtensionDevToolsBridge::OnRpcMessage(const std::string& class_name,
+ const std::string& message_name,
+ const std::string& param1,
+ const std::string& param2,
+ const std::string& param3) {
DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI);
- if (data.class_name == kApuAgentClassName
- && data.method_name == kApuPageEventMessageName) {
- std::string json = StringPrintf("[%s]", data.arguments[0].c_str());
+ if (class_name == kApuAgentClassName
+ && message_name == kApuPageEventMessageName) {
+ std::string json = StringPrintf("[%s]", param1.c_str());
profile_->GetExtensionMessageService()->DispatchEventToRenderers(
on_page_event_name_, json);
}
diff --git a/chrome/browser/extensions/extension_devtools_bridge.h b/chrome/browser/extensions/extension_devtools_bridge.h
index 5543b97..1745ef7 100644
--- a/chrome/browser/extensions/extension_devtools_bridge.h
+++ b/chrome/browser/extensions/extension_devtools_bridge.h
@@ -13,7 +13,6 @@
#include "chrome/browser/extensions/extension_message_service.h"
class Profile;
-struct DevToolsMessageData;
// This class is a DevToolsClientHost that fires extension events.
class ExtensionDevToolsBridge : public DevToolsClientHost {
@@ -32,7 +31,11 @@ class ExtensionDevToolsBridge : public DevToolsClientHost {
virtual void SendMessageToClient(const IPC::Message& msg);
private:
- void OnRpcMessage(const DevToolsMessageData& data);
+ void OnRpcMessage(const std::string& class_name,
+ const std::string& message_name,
+ const std::string& param1,
+ const std::string& param2,
+ const std::string& param3);
// ID of the tab we are monitoring.
int tab_id_;
diff --git a/chrome/common/devtools_messages.h b/chrome/common/devtools_messages.h
index 6c095f4..abb740d 100644
--- a/chrome/common/devtools_messages.h
+++ b/chrome/common/devtools_messages.h
@@ -5,33 +5,6 @@
#ifndef CHROME_COMMON_DEVTOOLS_MESSAGES_H_
#define CHROME_COMMON_DEVTOOLS_MESSAGES_H_
-#include "ipc/ipc_message_utils.h"
-#include "webkit/glue/devtools/devtools_message_data.h"
-
-namespace IPC {
-
-// Traits for DevToolsMessageData structure to pack/unpack.
-template <>
-struct ParamTraits<DevToolsMessageData> {
- typedef DevToolsMessageData param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.class_name);
- WriteParam(m, p.method_name);
- WriteParam(m, p.arguments);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->class_name) &&
- ReadParam(m, iter, &p->method_name) &&
- ReadParam(m, iter, &p->arguments);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"<DevToolsMessageData>");
- }
-};
-
-} // namespace IPC
-
#define MESSAGES_INTERNAL_FILE "chrome/common/devtools_messages_internal.h"
#include "ipc/ipc_message_macros.h"
diff --git a/chrome/common/devtools_messages_internal.h b/chrome/common/devtools_messages_internal.h
index d48ec09..d80c0ed 100644
--- a/chrome/common/devtools_messages_internal.h
+++ b/chrome/common/devtools_messages_internal.h
@@ -43,15 +43,18 @@
// This file describes developer tools message types.
#include "ipc/ipc_message_macros.h"
-#include "webkit/glue/devtools/devtools_message_data.h"
// These are messages sent from DevToolsAgent to DevToolsClient through the
// browser.
IPC_BEGIN_MESSAGES(DevToolsClient)
// Sends glue-level Rpc message to the client.
- IPC_MESSAGE_CONTROL1(DevToolsClientMsg_RpcMessage,
- DevToolsMessageData /* message data */)
+ IPC_MESSAGE_CONTROL5(DevToolsClientMsg_RpcMessage,
+ std::string /* class_name */,
+ std::string /* method_name */,
+ std::string /* p1 */,
+ std::string /* p2 */,
+ std::string /* p3 */)
IPC_END_MESSAGES(DevToolsClient)
@@ -69,8 +72,12 @@ IPC_BEGIN_MESSAGES(DevToolsAgent)
IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_Detach)
// Sends glue-level Rpc message to the agent.
- IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_RpcMessage,
- DevToolsMessageData /* message data */)
+ IPC_MESSAGE_CONTROL5(DevToolsAgentMsg_RpcMessage,
+ std::string /* class_name */,
+ std::string /* method_name */,
+ std::string /* p1 */,
+ std::string /* p2 */,
+ std::string /* p3 */)
// Send debugger command to the debugger agent. Debugger commands should
// be handled on IO thread(while all other devtools messages are handled in
diff --git a/chrome/renderer/devtools_agent.cc b/chrome/renderer/devtools_agent.cc
index 11211fd..d1e81e2 100644
--- a/chrome/renderer/devtools_agent.cc
+++ b/chrome/renderer/devtools_agent.cc
@@ -9,16 +9,13 @@
#include "chrome/renderer/devtools_agent_filter.h"
#include "chrome/renderer/render_view.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgent.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebDevToolsMessageData.h"
#include "third_party/WebKit/WebKit/chromium/public/WebPoint.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
-#include "webkit/glue/devtools/devtools_message_data.h"
#include "webkit/glue/glue_util.h"
using WebKit::WebDevToolsAgent;
using WebKit::WebPoint;
using WebKit::WebString;
-using WebKit::WebVector;
using WebKit::WebView;
// static
@@ -56,11 +53,19 @@ bool DevToolsAgent::OnMessageReceived(const IPC::Message& message) {
return handled;
}
-void DevToolsAgent::sendMessageToFrontend(
- const WebKit::WebDevToolsMessageData& data) {
+void DevToolsAgent::sendMessageToFrontend(const WebString& class_name,
+ const WebString& method_name,
+ const WebString& param1,
+ const WebString& param2,
+ const WebString& param3) {
IPC::Message* m = new ViewHostMsg_ForwardToDevToolsClient(
routing_id_,
- DevToolsClientMsg_RpcMessage(DevToolsMessageData(data)));
+ DevToolsClientMsg_RpcMessage(
+ class_name.utf8(),
+ method_name.utf8(),
+ param1.utf8(),
+ param2.utf8(),
+ param3.utf8()));
render_view_->Send(m);
}
@@ -108,10 +113,19 @@ void DevToolsAgent::OnDetach() {
}
}
-void DevToolsAgent::OnRpcMessage(const DevToolsMessageData& data) {
+void DevToolsAgent::OnRpcMessage(const std::string& class_name,
+ const std::string& method_name,
+ const std::string& param1,
+ const std::string& param2,
+ const std::string& param3) {
WebDevToolsAgent* web_agent = GetWebAgent();
if (web_agent) {
- web_agent->dispatchMessageFromFrontend(data.ToWebDevToolsMessageData());
+ web_agent->dispatchMessageFromFrontend(
+ WebString::fromUTF8(class_name),
+ WebString::fromUTF8(method_name),
+ WebString::fromUTF8(param1),
+ WebString::fromUTF8(param2),
+ WebString::fromUTF8(param3));
}
}
@@ -141,6 +155,15 @@ WebDevToolsAgent* DevToolsAgent::GetWebAgent() {
// static
void WebKit::WebDevToolsAgentClient::sendMessageToFrontendOnIOThread(
- const WebDevToolsMessageData& data) {
- DevToolsAgentFilter::SendRpcMessage(DevToolsMessageData(data));
+ const WebString& class_name,
+ const WebString& method_name,
+ const WebString& param1,
+ const WebString& param2,
+ const WebString& param3) {
+ DevToolsAgentFilter::SendRpcMessage(
+ class_name.utf8(),
+ method_name.utf8(),
+ param1.utf8(),
+ param2.utf8(),
+ param3.utf8());
}
diff --git a/chrome/renderer/devtools_agent.h b/chrome/renderer/devtools_agent.h
index 4d05fe0..26a6297 100644
--- a/chrome/renderer/devtools_agent.h
+++ b/chrome/renderer/devtools_agent.h
@@ -21,7 +21,6 @@ class WebDevToolsAgent;
}
class RenderView;
-struct DevToolsMessageData;
// DevToolsAgent belongs to the inspectable RenderView and provides Glue's
// agents with the communication capabilities. All messages from/to Glue's
@@ -38,9 +37,11 @@ class DevToolsAgent : public WebKit::WebDevToolsAgentClient {
virtual bool OnMessageReceived(const IPC::Message& message);
// WebDevToolsAgentClient implementation
- virtual void sendMessageToFrontend(
- const WebKit::WebDevToolsMessageData& data);
-
+ virtual void sendMessageToFrontend(const WebKit::WebString& class_name,
+ const WebKit::WebString& method_name,
+ const WebKit::WebString& param1,
+ const WebKit::WebString& param2,
+ const WebKit::WebString& param3);
virtual int hostIdentifier();
virtual void forceRepaint();
virtual void runtimeFeatureStateChanged(const WebKit::WebString& feature,
@@ -58,7 +59,11 @@ class DevToolsAgent : public WebKit::WebDevToolsAgentClient {
void OnAttach(const std::vector<std::string>& runtime_features);
void OnDetach();
- void OnRpcMessage(const DevToolsMessageData& data);
+ void OnRpcMessage(const std::string& class_name,
+ const std::string& method_name,
+ const std::string& param1,
+ const std::string& param2,
+ const std::string& param3);
void OnInspectElement(int x, int y);
void OnSetApuAgentEnabled(bool enabled);
diff --git a/chrome/renderer/devtools_agent_filter.cc b/chrome/renderer/devtools_agent_filter.cc
index d3a8289..375c743 100644
--- a/chrome/renderer/devtools_agent_filter.cc
+++ b/chrome/renderer/devtools_agent_filter.cc
@@ -11,9 +11,7 @@
#include "chrome/renderer/plugin_channel_host.h"
#include "chrome/renderer/render_view.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgent.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebDevToolsMessageData.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
-#include "webkit/glue/devtools/devtools_message_data.h"
using WebKit::WebDevToolsAgent;
using WebKit::WebString;
@@ -64,15 +62,32 @@ void DevToolsAgentFilter::OnDebuggerPauseScript() {
WebDevToolsAgent::debuggerPauseScript();
}
-void DevToolsAgentFilter::OnRpcMessage(const DevToolsMessageData& data) {
+void DevToolsAgentFilter::OnRpcMessage(const std::string& class_name,
+ const std::string& method_name,
+ const std::string& param1,
+ const std::string& param2,
+ const std::string& param3) {
message_handled_ = WebDevToolsAgent::dispatchMessageFromFrontendOnIOThread(
- data.ToWebDevToolsMessageData());
+ WebString::fromUTF8(class_name),
+ WebString::fromUTF8(method_name),
+ WebString::fromUTF8(param1),
+ WebString::fromUTF8(param2),
+ WebString::fromUTF8(param3));
}
// static
-void DevToolsAgentFilter::SendRpcMessage(const DevToolsMessageData& data) {
+void DevToolsAgentFilter::SendRpcMessage(const std::string& class_name,
+ const std::string& method_name,
+ const std::string& param1,
+ const std::string& param2,
+ const std::string& param3) {
IPC::Message* m = new ViewHostMsg_ForwardToDevToolsClient(
current_routing_id_,
- DevToolsClientMsg_RpcMessage(data));
+ DevToolsClientMsg_RpcMessage(
+ class_name,
+ method_name,
+ param1,
+ param2,
+ param3));
channel_->Send(m);
}
diff --git a/chrome/renderer/devtools_agent_filter.h b/chrome/renderer/devtools_agent_filter.h
index 8d23918..ac5fd0c 100644
--- a/chrome/renderer/devtools_agent_filter.h
+++ b/chrome/renderer/devtools_agent_filter.h
@@ -10,8 +10,6 @@
#include "ipc/ipc_channel_proxy.h"
-struct DevToolsMessageData;
-
// DevToolsAgentFilter is registered as an IPC filter in order to be able to
// dispatch messages while on the IO thread. The reason for that is that while
// debugging, Render thread is being held by the v8 and hence no messages
@@ -24,7 +22,11 @@ class DevToolsAgentFilter : public IPC::ChannelProxy::MessageFilter {
DevToolsAgentFilter();
virtual ~DevToolsAgentFilter();
- static void SendRpcMessage(const DevToolsMessageData& data);
+ static void SendRpcMessage(const std::string& class_name,
+ const std::string& method_name,
+ const std::string& param1,
+ const std::string& param2,
+ const std::string& param3);
private:
// IPC::ChannelProxy::MessageFilter override. Called on IO thread.
@@ -38,7 +40,11 @@ class DevToolsAgentFilter : public IPC::ChannelProxy::MessageFilter {
// handle debug messages even when v8 is stopped.
void OnDebuggerCommand(const std::string& command);
void OnDebuggerPauseScript();
- void OnRpcMessage(const DevToolsMessageData& data);
+ void OnRpcMessage(const std::string& class_name,
+ const std::string& method_name,
+ const std::string& param1,
+ const std::string& param2,
+ const std::string& param3);
bool message_handled_;
diff --git a/chrome/renderer/devtools_client.cc b/chrome/renderer/devtools_client.cc
index 2ab162e..8083288 100644
--- a/chrome/renderer/devtools_client.cc
+++ b/chrome/renderer/devtools_client.cc
@@ -11,7 +11,6 @@
#include "chrome/renderer/render_thread.h"
#include "chrome/renderer/render_view.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDevToolsFrontend.h"
-#include "third_party/WebKit/WebKit/chromium/public/WebDevToolsMessageData.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
using WebKit::WebDevToolsFrontend;
@@ -48,9 +47,17 @@ bool DevToolsClient::OnMessageReceived(const IPC::Message& message) {
return handled;
}
-void DevToolsClient::sendMessageToAgent(
- const WebKit::WebDevToolsMessageData& data) {
- Send(DevToolsAgentMsg_RpcMessage(DevToolsMessageData(data)));
+void DevToolsClient::sendMessageToAgent(const WebString& class_name,
+ const WebString& method_name,
+ const WebString& param1,
+ const WebString& param2,
+ const WebString& param3) {
+ Send(DevToolsAgentMsg_RpcMessage(
+ class_name.utf8(),
+ method_name.utf8(),
+ param1.utf8(),
+ param2.utf8(),
+ param3.utf8()));
}
void DevToolsClient::sendDebuggerCommandToAgent(const WebString& command) {
@@ -81,7 +88,15 @@ void DevToolsClient::undockWindow() {
render_view_->routing_id()));
}
-void DevToolsClient::OnRpcMessage(const DevToolsMessageData& data) {
+void DevToolsClient::OnRpcMessage(const std::string& class_name,
+ const std::string& method_name,
+ const std::string& param1,
+ const std::string& param2,
+ const std::string& param3) {
web_tools_frontend_->dispatchMessageFromAgent(
- data.ToWebDevToolsMessageData());
+ WebString::fromUTF8(class_name),
+ WebString::fromUTF8(method_name),
+ WebString::fromUTF8(param1),
+ WebString::fromUTF8(param2),
+ WebString::fromUTF8(param3));
}
diff --git a/chrome/renderer/devtools_client.h b/chrome/renderer/devtools_client.h
index c8eba9f..aad5c09 100644
--- a/chrome/renderer/devtools_client.h
+++ b/chrome/renderer/devtools_client.h
@@ -21,8 +21,6 @@ namespace WebKit {
class WebDevToolsFrontend;
}
-struct DevToolsMessageData;
-
// Developer tools UI end of communication channel between the render process of
// the page being inspected and tools UI renderer process. All messages will
// go through browser process. On the side of the inspected page there's
@@ -39,8 +37,11 @@ class DevToolsClient : public WebKit::WebDevToolsFrontendClient {
bool OnMessageReceived(const IPC::Message& message);
// WebDevToolsFrontendClient implementation
- virtual void sendMessageToAgent(
- const WebKit::WebDevToolsMessageData& data);
+ virtual void sendMessageToAgent(const WebKit::WebString& class_name,
+ const WebKit::WebString& method_name,
+ const WebKit::WebString& param1,
+ const WebKit::WebString& param2,
+ const WebKit::WebString& param3);
virtual void sendDebuggerCommandToAgent(const WebKit::WebString& command);
virtual void sendDebuggerPauseScript();
@@ -50,7 +51,11 @@ class DevToolsClient : public WebKit::WebDevToolsFrontendClient {
virtual void undockWindow();
private:
- void OnRpcMessage(const DevToolsMessageData& data);
+ void OnRpcMessage(const std::string& class_name,
+ const std::string& method_name,
+ const std::string& param1,
+ const std::string& param2,
+ const std::string& param3);
// Sends message to DevToolsAgent.
void Send(const IPC::Message& tools_agent_message);