summaryrefslogtreecommitdiffstats
path: root/chrome/browser/debugger
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 08:26:47 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-03 08:26:47 +0000
commit68c5b685ff0f00d0c14c34d9a8dff87b448ba5c4 (patch)
tree89e5f4fbbd27a9d242599e9d4e042b946c644348 /chrome/browser/debugger
parent97c5c596e4b649651fbef56875e125c06acb0f90 (diff)
downloadchromium_src-68c5b685ff0f00d0c14c34d9a8dff87b448ba5c4.zip
chromium_src-68c5b685ff0f00d0c14c34d9a8dff87b448ba5c4.tar.gz
chromium_src-68c5b685ff0f00d0c14c34d9a8dff87b448ba5c4.tar.bz2
DevTools: Get rid of DevTools RPC.
Review URL: http://codereview.chromium.org/3005044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54722 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/debugger')
-rw-r--r--chrome/browser/debugger/devtools_http_protocol_handler.cc23
-rw-r--r--chrome/browser/debugger/inspectable_tab_proxy.cc21
-rw-r--r--chrome/browser/debugger/inspectable_tab_proxy.h3
3 files changed, 10 insertions, 37 deletions
diff --git a/chrome/browser/debugger/devtools_http_protocol_handler.cc b/chrome/browser/debugger/devtools_http_protocol_handler.cc
index 8c5b0ad0..c93ee50 100644
--- a/chrome/browser/debugger/devtools_http_protocol_handler.cc
+++ b/chrome/browser/debugger/devtools_http_protocol_handler.cc
@@ -47,7 +47,8 @@ class DevToolsClientHostImpl : public DevToolsClientHost {
virtual void SendMessageToClient(const IPC::Message& msg) {
IPC_BEGIN_MESSAGE_MAP(DevToolsClientHostImpl, msg)
- IPC_MESSAGE_HANDLER(DevToolsClientMsg_RpcMessage, OnRpcMessage);
+ IPC_MESSAGE_HANDLER(DevToolsClientMsg_DispatchOnInspectorFrontend,
+ OnDispatchOnInspectorFrontend);
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP()
}
@@ -57,17 +58,9 @@ class DevToolsClientHostImpl : public DevToolsClientHost {
}
private:
// Message handling routines
- void OnRpcMessage(const DevToolsMessageData& data) {
+ void OnDispatchOnInspectorFrontend(const std::string& data) {
std::string message;
- message += "devtools$$dispatch(\"" + data.class_name + "\", \"" +
- data.method_name + "\"";
- for (std::vector<std::string>::const_iterator it = data.arguments.begin();
- it != data.arguments.end(); ++it) {
- std::string param = *it;
- if (!param.empty())
- message += ", " + param;
- }
- message += ")";
+ message += "devtools$$dispatch(\"" + data + "\")";
socket_->SendOverWebSocket(message);
}
HttpListenSocket* socket_;
@@ -251,15 +244,9 @@ void DevToolsHttpProtocolHandler::OnWebSocketMessageUI(
if (it == socket_to_client_host_ui_.end())
return;
- // TODO(pfeldman): Replace with proper parsing / dispatching.
- DevToolsMessageData message_data;
- message_data.class_name = "ToolsAgent";
- message_data.method_name = "dispatchOnInspectorController";
- message_data.arguments.push_back(data);
-
DevToolsManager* manager = DevToolsManager::GetInstance();
manager->ForwardToDevToolsAgent(it->second,
- DevToolsAgentMsg_RpcMessage(DevToolsMessageData(message_data)));
+ DevToolsAgentMsg_DispatchOnInspectorBackend(data));
}
void DevToolsHttpProtocolHandler::OnCloseUI(HttpListenSocket* socket) {
diff --git a/chrome/browser/debugger/inspectable_tab_proxy.cc b/chrome/browser/debugger/inspectable_tab_proxy.cc
index ec84066..96d4e3e 100644
--- a/chrome/browser/debugger/inspectable_tab_proxy.cc
+++ b/chrome/browser/debugger/inspectable_tab_proxy.cc
@@ -29,29 +29,16 @@ void DevToolsClientHostImpl::Close() {
void DevToolsClientHostImpl::SendMessageToClient(
const IPC::Message& msg) {
+ // TODO(prybin): Restore FrameNavigate.
IPC_BEGIN_MESSAGE_MAP(DevToolsClientHostImpl, msg)
- IPC_MESSAGE_HANDLER(DevToolsClientMsg_RpcMessage, OnRpcMessage);
+ IPC_MESSAGE_HANDLER(DevToolsClientMsg_DebuggerOutput, OnDebuggerOutput);
IPC_MESSAGE_UNHANDLED_ERROR()
IPC_END_MESSAGE_MAP()
}
-void DevToolsClientHostImpl::OnRpcMessage(const DevToolsMessageData& data) {
- 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]);
- }
-}
-
-void DevToolsClientHostImpl::DebuggerOutput(const std::string& msg) {
- service_->DebuggerOutput(id_, msg);
+void DevToolsClientHostImpl::OnDebuggerOutput(const std::string& data) {
+ service_->DebuggerOutput(id_, data);
}
void DevToolsClientHostImpl::FrameNavigate(const std::string& url) {
diff --git a/chrome/browser/debugger/inspectable_tab_proxy.h b/chrome/browser/debugger/inspectable_tab_proxy.h
index d446d40..af08232 100644
--- a/chrome/browser/debugger/inspectable_tab_proxy.h
+++ b/chrome/browser/debugger/inspectable_tab_proxy.h
@@ -83,8 +83,7 @@ class DevToolsClientHostImpl : public DevToolsClientHost {
private:
// Message handling routines
- void OnRpcMessage(const DevToolsMessageData& data);
- void DebuggerOutput(const std::string& msg);
+ void OnDebuggerOutput(const std::string& msg);
void FrameNavigate(const std::string& url);
void TabClosed();