diff options
Diffstat (limited to 'chrome/browser')
4 files changed, 15 insertions, 28 deletions
diff --git a/chrome/browser/debugger/inspectable_tab_proxy.cc b/chrome/browser/debugger/inspectable_tab_proxy.cc index 29e5d32..159be0b 100644 --- a/chrome/browser/debugger/inspectable_tab_proxy.cc +++ b/chrome/browser/debugger/inspectable_tab_proxy.cc @@ -34,21 +34,18 @@ void DevToolsClientHostImpl::SendMessageToClient( IPC_END_MESSAGE_MAP() } -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) { +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 (class_name == kDebuggerAgentDelegate && message_name == kDebuggerOutput) { - DebuggerOutput(param1); - } else if (class_name == kToolsAgentDelegate && - message_name == kFrameNavigate) { - FrameNavigate(param1); + 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]); } } diff --git a/chrome/browser/debugger/inspectable_tab_proxy.h b/chrome/browser/debugger/inspectable_tab_proxy.h index 13da2ec..67b5952 100644 --- a/chrome/browser/debugger/inspectable_tab_proxy.h +++ b/chrome/browser/debugger/inspectable_tab_proxy.h @@ -15,6 +15,7 @@ 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 @@ -81,11 +82,7 @@ class DevToolsClientHostImpl : public DevToolsClientHost { private: // Message handling routines - 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 OnRpcMessage(const DevToolsMessageData& data); 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 99f515b..dcf6375 100644 --- a/chrome/browser/extensions/extension_devtools_bridge.cc +++ b/chrome/browser/extensions/extension_devtools_bridge.cc @@ -80,16 +80,12 @@ void ExtensionDevToolsBridge::SendMessageToClient(const IPC::Message& msg) { static const char kApuAgentClassName[] = "ApuAgentDelegate"; static const char kApuPageEventMessageName[] = "DispatchToApu"; -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) { +void ExtensionDevToolsBridge::OnRpcMessage(const DevToolsMessageData& data) { DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI); - if (class_name == kApuAgentClassName - && message_name == kApuPageEventMessageName) { - std::string json = StringPrintf("[%s]", param1.c_str()); + if (data.class_name == kApuAgentClassName + && data.method_name == kApuPageEventMessageName) { + std::string json = StringPrintf("[%s]", data.arguments[0].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 1745ef7..5543b97 100644 --- a/chrome/browser/extensions/extension_devtools_bridge.h +++ b/chrome/browser/extensions/extension_devtools_bridge.h @@ -13,6 +13,7 @@ #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 { @@ -31,11 +32,7 @@ class ExtensionDevToolsBridge : public DevToolsClientHost { virtual void SendMessageToClient(const IPC::Message& msg); private: - 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 OnRpcMessage(const DevToolsMessageData& data); // ID of the tab we are monitoring. int tab_id_; |