diff options
author | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 08:37:06 +0000 |
---|---|---|
committer | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-29 08:37:06 +0000 |
commit | 37f39f0516108d8ecc308b5c5f3c06f0753b0038 (patch) | |
tree | 99702d3f3536a0ff9c933a996aa31ecec27a4201 /webkit | |
parent | e13372e4cf728c46c9a08ad300b633f9b975108c (diff) | |
download | chromium_src-37f39f0516108d8ecc308b5c5f3c06f0753b0038.zip chromium_src-37f39f0516108d8ecc308b5c5f3c06f0753b0038.tar.gz chromium_src-37f39f0516108d8ecc308b5c5f3c06f0753b0038.tar.bz2 |
DevTools: decouple class and method names from RPC message arguments. That would allow to select dispatcher wothout parsing the message argument.
Review URL: http://codereview.chromium.org/115862
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17176 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/devtools/devtools_mock_rpc.h | 44 | ||||
-rw-r--r-- | webkit/glue/devtools/devtools_rpc.cc | 6 | ||||
-rw-r--r-- | webkit/glue/devtools/devtools_rpc.h | 72 | ||||
-rw-r--r-- | webkit/glue/devtools/devtools_rpc_unittest.cc | 29 | ||||
-rw-r--r-- | webkit/glue/devtools/js/devtools.js | 10 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsagent.h | 4 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsagent_delegate.h | 4 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsagent_impl.cc | 17 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsagent_impl.h | 8 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsclient.h | 4 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsclient_delegate.h | 4 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsclient_impl.cc | 25 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsclient_impl.h | 9 |
13 files changed, 159 insertions, 77 deletions
diff --git a/webkit/glue/devtools/devtools_mock_rpc.h b/webkit/glue/devtools/devtools_mock_rpc.h index c424306..44d7b59d 100644 --- a/webkit/glue/devtools/devtools_mock_rpc.h +++ b/webkit/glue/devtools/devtools_mock_rpc.h @@ -22,31 +22,67 @@ class DevToolsMockRpc : public DevToolsRpc::Delegate { DevToolsMockRpc() {} ~DevToolsMockRpc() {} - virtual void SendRpcMessage(const std::string& msg) { + virtual void SendRpcMessage(const std::string& class_name, + const std::string& method_name, + const std::string& msg) { + last_class_name_ = class_name; + last_method_name_ = method_name; + last_msg_ = msg; + if (!log_.length()) { - log_ = msg; + log_ = StringPrintf("%s %s %s", class_name.c_str(), + method_name.c_str(), msg.c_str());; } else { - log_ = StringPrintf("%s\n%s", log_.c_str(), msg.c_str()); + log_ = StringPrintf("%s\n%s %s %s", log_.c_str(), class_name.c_str(), + method_name.c_str(), msg.c_str()); } } void Replay() { + ref_last_class_name_ = last_class_name_; + last_class_name_ = ""; + ref_last_method_name_ = last_method_name_; + last_method_name_ = ""; + ref_last_msg_ = last_msg_; + last_msg_ = ""; + ref_log_ = log_; log_ = ""; } void Verify() { + ASSERT_EQ(ref_last_class_name_, last_class_name_); + ASSERT_EQ(ref_last_method_name_, last_method_name_); + ASSERT_EQ(ref_last_msg_, last_msg_); ASSERT_EQ(ref_log_, log_); } void Reset() { + last_class_name_ = ""; + last_method_name_ = ""; + last_msg_ = ""; + + ref_last_class_name_ = ""; + ref_last_method_name_ = ""; + ref_last_msg_ = ""; + ref_log_ = ""; log_ = ""; } - const std::string &get_log() { return log_; } + const std::string& last_class_name() { return last_class_name_; } + const std::string& last_method_name() { return last_method_name_; } + const std::string& last_msg() { return last_msg_; } private: + std::string last_class_name_; + std::string last_method_name_; + std::string last_msg_; + + std::string ref_last_class_name_; + std::string ref_last_method_name_; + std::string ref_last_msg_; + std::string log_; std::string ref_log_; DISALLOW_COPY_AND_ASSIGN(DevToolsMockRpc); diff --git a/webkit/glue/devtools/devtools_rpc.cc b/webkit/glue/devtools/devtools_rpc.cc index 458fcb4..3d5667d 100644 --- a/webkit/glue/devtools/devtools_rpc.cc +++ b/webkit/glue/devtools/devtools_rpc.cc @@ -20,8 +20,10 @@ DevToolsRpc::DevToolsRpc(Delegate* delegate) : delegate_(delegate) { DevToolsRpc::~DevToolsRpc() { } -void DevToolsRpc::SendValueMessage(const Value& value) { - delegate_->SendRpcMessage(Serialize(value)); +void DevToolsRpc::SendValueMessage(const std::string& class_name, + const std::string& method_name, + const Value& value) { + delegate_->SendRpcMessage(class_name, method_name, Serialize(value)); } // static diff --git a/webkit/glue/devtools/devtools_rpc.h b/webkit/glue/devtools/devtools_rpc.h index 8a28d0b..54a7a81 100644 --- a/webkit/glue/devtools/devtools_rpc.h +++ b/webkit/glue/devtools/devtools_rpc.h @@ -174,7 +174,7 @@ if (method_name == #Method) { \ #define TOOLS_RPC_DISPATCH1(Method, T1) \ if (method_name == #Method) { \ RpcTypeTrait<T1>::DispatchType t1; \ - DevToolsRpc::GetListValue(message, 2, &t1); \ + DevToolsRpc::GetListValue(message, 0, &t1); \ delegate->Method( \ RpcTypeTrait<T1>::Pass(t1)); \ return true; \ @@ -184,8 +184,8 @@ if (method_name == #Method) { \ if (method_name == #Method) { \ RpcTypeTrait<T1>::DispatchType t1; \ RpcTypeTrait<T2>::DispatchType t2; \ - DevToolsRpc::GetListValue(message, 2, &t1); \ - DevToolsRpc::GetListValue(message, 3, &t2); \ + DevToolsRpc::GetListValue(message, 0, &t1); \ + DevToolsRpc::GetListValue(message, 1, &t2); \ delegate->Method( \ RpcTypeTrait<T1>::Pass(t1), \ RpcTypeTrait<T2>::Pass(t2) \ @@ -198,9 +198,9 @@ if (method_name == #Method) { \ RpcTypeTrait<T1>::DispatchType t1; \ RpcTypeTrait<T2>::DispatchType t2; \ RpcTypeTrait<T3>::DispatchType t3; \ - DevToolsRpc::GetListValue(message, 2, &t1); \ - DevToolsRpc::GetListValue(message, 3, &t2); \ - DevToolsRpc::GetListValue(message, 4, &t3); \ + DevToolsRpc::GetListValue(message, 0, &t1); \ + DevToolsRpc::GetListValue(message, 1, &t2); \ + DevToolsRpc::GetListValue(message, 2, &t3); \ delegate->Method( \ RpcTypeTrait<T1>::Pass(t1), \ RpcTypeTrait<T2>::Pass(t2), \ @@ -215,10 +215,10 @@ if (method_name == #Method) { \ RpcTypeTrait<T2>::DispatchType t2; \ RpcTypeTrait<T3>::DispatchType t3; \ RpcTypeTrait<T4>::DispatchType t4; \ - DevToolsRpc::GetListValue(message, 2, &t1); \ - DevToolsRpc::GetListValue(message, 3, &t2); \ - DevToolsRpc::GetListValue(message, 4, &t3); \ - DevToolsRpc::GetListValue(message, 5, &t4); \ + DevToolsRpc::GetListValue(message, 0, &t1); \ + DevToolsRpc::GetListValue(message, 1, &t2); \ + DevToolsRpc::GetListValue(message, 2, &t3); \ + DevToolsRpc::GetListValue(message, 3, &t4); \ delegate->Method( \ RpcTypeTrait<T1>::Pass(t1), \ RpcTypeTrait<T2>::Pass(t2), \ @@ -272,21 +272,23 @@ class Class##Dispatch { \ public: \ Class##Dispatch() {} \ virtual ~Class##Dispatch() {} \ + \
+ static bool Dispatch(Class* delegate, \ + const std::string& class_name, \ + const std::string& method_name, \ + const std::string& raw_msg) { \ + OwnPtr<ListValue> message( \
+ static_cast<ListValue*>(DevToolsRpc::ParseMessage(raw_msg))); \
+ return Dispatch(delegate, class_name, method_name, *message.get()); \
+ } \
\ - static bool Dispatch(Class* delegate, const std::string& raw_msg) { \ - OwnPtr<ListValue> message( \ - static_cast<ListValue*>(DevToolsRpc::ParseMessage(raw_msg))); \ - return Dispatch(delegate, *message.get()); \ - } \ - \ - static bool Dispatch(Class* delegate, const ListValue& message) { \ - std::string class_name; \ - message.GetString(0, &class_name); \ + static bool Dispatch(Class* delegate, \ + const std::string& class_name, \ + const std::string& method_name, \ + const ListValue& message) { \ if (class_name != #Class) { \ return false; \ } \ - std::string method_name; \ - message.GetString(1, &method_name); \ typedef Class CLASS; \ STRUCT( \ TOOLS_RPC_DISPATCH0, \ @@ -308,7 +310,9 @@ class DevToolsRpc { public: Delegate() {} virtual ~Delegate() {} - virtual void SendRpcMessage(const std::string& msg) = 0; + virtual void SendRpcMessage(const std::string& class_name, + const std::string& method_name, + const std::string& raw_msg) = 0; private: DISALLOW_COPY_AND_ASSIGN(Delegate); }; @@ -320,9 +324,7 @@ class DevToolsRpc { const std::string& class_name, const std::string& method_name) { ListValue message; - message.Append(CreateValue(&class_name)); - message.Append(CreateValue(&method_name)); - SendValueMessage(message); + SendValueMessage(class_name, method_name, message); } template<typename T1> @@ -331,10 +333,8 @@ class DevToolsRpc { const std::string& method_name, T1 t1) { ListValue message; - message.Append(CreateValue(&class_name)); - message.Append(CreateValue(&method_name)); message.Append(CreateValue(t1)); - SendValueMessage(message); + SendValueMessage(class_name, method_name, message); } template<typename T1, typename T2> @@ -343,11 +343,9 @@ class DevToolsRpc { const std::string& method_name, T1 t1, T2 t2) { ListValue message; - message.Append(CreateValue(&class_name)); - message.Append(CreateValue(&method_name)); message.Append(CreateValue(t1)); message.Append(CreateValue(t2)); - SendValueMessage(message); + SendValueMessage(class_name, method_name, message); } template<typename T1, typename T2, typename T3> @@ -356,12 +354,10 @@ class DevToolsRpc { const std::string& method_name, T1 t1, T2 t2, T3 t3) { ListValue message; - message.Append(CreateValue(&class_name)); - message.Append(CreateValue(&method_name)); message.Append(CreateValue(t1)); message.Append(CreateValue(t2)); message.Append(CreateValue(t3)); - SendValueMessage(message); + SendValueMessage(class_name, method_name, message); } template<typename T1, typename T2, typename T3, typename T4> @@ -370,13 +366,11 @@ class DevToolsRpc { const std::string& method_name, T1 t1, T2 t2, T3 t3, T4 t4) { ListValue message; - message.Append(CreateValue(&class_name)); - message.Append(CreateValue(&method_name)); message.Append(CreateValue(t1)); message.Append(CreateValue(t2)); message.Append(CreateValue(t3)); message.Append(CreateValue(t4)); - SendValueMessage(message); + SendValueMessage(class_name, method_name, message); } static Value* ParseMessage(const std::string& raw_msg); @@ -405,7 +399,9 @@ class DevToolsRpc { static Value* CreateValue(bool* value); static Value* CreateValue(const Value* value); - void SendValueMessage(const Value& value); + void SendValueMessage(const std::string& class_name, + const std::string& method_name, + const Value& value); Delegate* delegate_; DISALLOW_COPY_AND_ASSIGN(DevToolsRpc); diff --git a/webkit/glue/devtools/devtools_rpc_unittest.cc b/webkit/glue/devtools/devtools_rpc_unittest.cc index d900fb8..9f9b1a6 100644 --- a/webkit/glue/devtools/devtools_rpc_unittest.cc +++ b/webkit/glue/devtools/devtools_rpc_unittest.cc @@ -52,21 +52,28 @@ class DevToolsRpcTests : public testing::Test { TEST_F(DevToolsRpcTests, TestSerialize) { MockTestRpcClass mock; mock.Method0(); - EXPECT_EQ("[\"TestRpcClass\",\"Method0\"]", mock.get_log()); + EXPECT_EQ("TestRpcClass", mock.last_class_name()); + EXPECT_EQ("Method0", mock.last_method_name()); + EXPECT_EQ("[]", mock.last_msg()); mock.Reset(); mock.Method1(10); - EXPECT_EQ("[\"TestRpcClass\",\"Method1\",10]", mock.get_log()); + EXPECT_EQ("TestRpcClass", mock.last_class_name()); + EXPECT_EQ("Method1", mock.last_method_name()); + EXPECT_EQ("[10]", mock.last_msg()); mock.Reset(); mock.Method2(20, "foo"); - EXPECT_EQ("[\"TestRpcClass\",\"Method2\",20,\"foo\"]", mock.get_log()); + EXPECT_EQ("TestRpcClass", mock.last_class_name()); + EXPECT_EQ("Method2", mock.last_method_name()); + EXPECT_EQ("[20,\"foo\"]", mock.last_msg()); mock.Reset(); StringValue value("bar"); mock.Method3(30, "foo", value); - EXPECT_EQ("[\"TestRpcClass\",\"Method3\",30,\"foo\",\"bar\"]", - mock.get_log()); + EXPECT_EQ("TestRpcClass", mock.last_class_name()); + EXPECT_EQ("Method3", mock.last_method_name()); + EXPECT_EQ("[30,\"foo\",\"bar\"]", mock.last_msg()); mock.Reset(); } @@ -82,7 +89,8 @@ TEST_F(DevToolsRpcTests, TestDispatch) { remote.Method0(); remote.Replay(); - TestRpcClassDispatch::Dispatch(&remote, local.get_log()); + TestRpcClassDispatch::Dispatch(&remote, local.last_class_name(), + local.last_method_name(), local.last_msg()); remote.Verify(); // Call 2. @@ -91,7 +99,8 @@ TEST_F(DevToolsRpcTests, TestDispatch) { remote.Reset(); remote.Method1(10); remote.Replay(); - TestRpcClassDispatch::Dispatch(&remote, local.get_log()); + TestRpcClassDispatch::Dispatch(&remote, local.last_class_name(), + local.last_method_name(), local.last_msg()); remote.Verify(); // Call 3. @@ -101,7 +110,8 @@ TEST_F(DevToolsRpcTests, TestDispatch) { remote.Method2(20, "foo"); remote.Replay(); - TestRpcClassDispatch::Dispatch(&remote, local.get_log()); + TestRpcClassDispatch::Dispatch(&remote, local.last_class_name(), + local.last_method_name(), local.last_msg()); remote.Verify(); // Call 4. @@ -112,7 +122,8 @@ TEST_F(DevToolsRpcTests, TestDispatch) { remote.Method3(30, "foo", value); remote.Replay(); - TestRpcClassDispatch::Dispatch(&remote, local.get_log()); + TestRpcClassDispatch::Dispatch(&remote, local.last_class_name(), + local.last_method_name(), local.last_msg()); remote.Verify(); } diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js index e4096d9..c301e80 100644 --- a/webkit/glue/devtools/js/devtools.js +++ b/webkit/glue/devtools/js/devtools.js @@ -15,12 +15,12 @@ goog.require('devtools.DomAgent'); /** * Dispatches raw message from the host. + * @param {string} remoteName + * @prama {string} methodName * @param {Object} msg Message to dispatch. */ -devtools.dispatch = function(msg) { - var delegate = msg[0]; - var methodName = msg[1]; - var remoteName = 'Remote' + delegate.substring(0, delegate.length - 8); +devtools.dispatch = function(remoteName, methodName, msg) { + remoteName = 'Remote' + remoteName.substring(0, remoteName.length - 8); var agent = window[remoteName]; if (!agent) { debugPrint('No remote agent "' + remoteName + '" found.'); @@ -31,7 +31,7 @@ devtools.dispatch = function(msg) { debugPrint('No method "' + remoteName + '.' + methodName + '" found.'); return; } - method.apply(this, msg.slice(2)); + method.apply(this, msg); }; diff --git a/webkit/glue/webdevtoolsagent.h b/webkit/glue/webdevtoolsagent.h index 9680e84..177ec2f 100644 --- a/webkit/glue/webdevtoolsagent.h +++ b/webkit/glue/webdevtoolsagent.h @@ -28,7 +28,9 @@ class WebDevToolsAgent { virtual void Detach() = 0; - virtual void DispatchMessageFromClient(const std::string& raw_msg) = 0; + virtual void DispatchMessageFromClient(const std::string& class_name, + const std::string& method_name, + const std::string& raw_msg) = 0; virtual void InspectElement(int x, int y) = 0; diff --git a/webkit/glue/webdevtoolsagent_delegate.h b/webkit/glue/webdevtoolsagent_delegate.h index 5c596ff..0e06714 100644 --- a/webkit/glue/webdevtoolsagent_delegate.h +++ b/webkit/glue/webdevtoolsagent_delegate.h @@ -13,7 +13,9 @@ class WebDevToolsAgentDelegate { WebDevToolsAgentDelegate() {} virtual ~WebDevToolsAgentDelegate() {} - virtual void SendMessageToClient(const std::string& raw_msg) = 0; + virtual void SendMessageToClient(const std::string& class_name, + const std::string& method_name, + const std::string& raw_msg) = 0; // Invalidates widget which leads to the repaint. virtual void ForceRepaint() = 0; diff --git a/webkit/glue/webdevtoolsagent_impl.cc b/webkit/glue/webdevtoolsagent_impl.cc index 50c676f..e77908c 100644 --- a/webkit/glue/webdevtoolsagent_impl.cc +++ b/webkit/glue/webdevtoolsagent_impl.cc @@ -231,10 +231,13 @@ void WebDevToolsAgentImpl::GetResourceContent( } void WebDevToolsAgentImpl::DispatchMessageFromClient( + const std::string& class_name, + const std::string& method_name, const std::string& raw_msg) { OwnPtr<ListValue> message( static_cast<ListValue*>(DevToolsRpc::ParseMessage(raw_msg))); - if (ToolsAgentDispatch::Dispatch(this, *message.get())) { + if (ToolsAgentDispatch::Dispatch( + this, class_name, method_name, *message.get())) { return; } @@ -244,12 +247,13 @@ void WebDevToolsAgentImpl::DispatchMessageFromClient( if (debugger_agent_impl_.get() && DebuggerAgentDispatch::Dispatch( - debugger_agent_impl_.get(), + debugger_agent_impl_.get(), class_name, method_name, *message.get())) { return; } - if (DomAgentDispatch::Dispatch(dom_agent_impl_.get(), *message.get())) { + if (DomAgentDispatch::Dispatch( + dom_agent_impl_.get(), class_name, method_name, *message.get())) { return; } } @@ -264,8 +268,11 @@ void WebDevToolsAgentImpl::InspectElement(int x, int y) { tools_agent_delegate_stub_->UpdateFocusedNode(node_id); } -void WebDevToolsAgentImpl::SendRpcMessage(const std::string& raw_msg) { - delegate_->SendMessageToClient(raw_msg); +void WebDevToolsAgentImpl::SendRpcMessage( + const std::string& class_name, + const std::string& method_name, + const std::string& raw_msg) { + delegate_->SendMessageToClient(class_name, method_name, raw_msg); } // static diff --git a/webkit/glue/webdevtoolsagent_impl.h b/webkit/glue/webdevtoolsagent_impl.h index 9b89514..d87b442 100644 --- a/webkit/glue/webdevtoolsagent_impl.h +++ b/webkit/glue/webdevtoolsagent_impl.h @@ -58,11 +58,15 @@ class WebDevToolsAgentImpl // WebDevToolsAgent implementation. virtual void Attach(); virtual void Detach(); - virtual void DispatchMessageFromClient(const std::string& raw_msg); + virtual void DispatchMessageFromClient(const std::string& class_name, + const std::string& method_name, + const std::string& raw_msg); virtual void InspectElement(int x, int y); // DevToolsRpc::Delegate implementation. - void SendRpcMessage(const std::string& raw_msg); + void SendRpcMessage(const std::string& class_name, + const std::string& method_name, + const std::string& raw_msg); // Methods called by the glue. void SetMainFrameDocumentReady(bool ready); diff --git a/webkit/glue/webdevtoolsclient.h b/webkit/glue/webdevtoolsclient.h index 23529c6..1e9d3c0 100644 --- a/webkit/glue/webdevtoolsclient.h +++ b/webkit/glue/webdevtoolsclient.h @@ -22,7 +22,9 @@ class WebDevToolsClient { WebDevToolsClient() {} virtual ~WebDevToolsClient() {} - virtual void DispatchMessageFromAgent(const std::string& raw_msg) = 0; + virtual void DispatchMessageFromAgent(const std::string& class_name, + const std::string& method_name, + const std::string& raw_msg) = 0; private: DISALLOW_COPY_AND_ASSIGN(WebDevToolsClient); diff --git a/webkit/glue/webdevtoolsclient_delegate.h b/webkit/glue/webdevtoolsclient_delegate.h index 720bff2..2be3656 100644 --- a/webkit/glue/webdevtoolsclient_delegate.h +++ b/webkit/glue/webdevtoolsclient_delegate.h @@ -13,7 +13,9 @@ class WebDevToolsClientDelegate { WebDevToolsClientDelegate() {} virtual ~WebDevToolsClientDelegate() {} - virtual void SendMessageToAgent(const std::string& raw_msg) = 0; + virtual void SendMessageToAgent(const std::string& class_name, + const std::string& method_name, + const std::string& raw_msg) = 0; virtual void SendDebuggerCommandToAgent(const std::string& command) = 0; virtual void ActivateWindow() = 0; diff --git a/webkit/glue/webdevtoolsclient_impl.cc b/webkit/glue/webdevtoolsclient_impl.cc index 182bc58..07c5444 100644 --- a/webkit/glue/webdevtoolsclient_impl.cc +++ b/webkit/glue/webdevtoolsclient_impl.cc @@ -122,18 +122,31 @@ WebDevToolsClientImpl::~WebDevToolsClientImpl() { } void WebDevToolsClientImpl::DispatchMessageFromAgent( - const std::string& raw_msg) { + const std::string& class_name, + const std::string& method_name, + const std::string& raw_msg) { + std::string expr = StringPrintf( + "devtools.dispatch('%s','%s',%s)", + class_name.c_str(), + method_name.c_str(), + raw_msg.c_str()); if (!loaded_) { - pending_incoming_messages_.append(raw_msg); + pending_incoming_messages_.append(expr); return; } - std::string expr = StringPrintf("devtools.dispatch(%s)", raw_msg.c_str()); + ExecuteScript(expr); +} + +void WebDevToolsClientImpl::ExecuteScript(const std::string& expr) { web_view_impl_->GetMainFrame()->ExecuteScript( WebScriptSource(WebString::fromUTF8(expr))); } -void WebDevToolsClientImpl::SendRpcMessage(const std::string& raw_msg) { - delegate_->SendMessageToAgent(raw_msg); + +void WebDevToolsClientImpl::SendRpcMessage(const std::string& class_name, + const std::string& method_name, + const std::string& raw_msg) { + delegate_->SendMessageToAgent(class_name, method_name, raw_msg); } // static @@ -180,7 +193,7 @@ v8::Handle<v8::Value> WebDevToolsClientImpl::JsLoaded( client->pending_incoming_messages_.begin(); it != client->pending_incoming_messages_.end(); ++it) { - client->DispatchMessageFromAgent(*it); + client->ExecuteScript(*it); } client->pending_incoming_messages_.clear(); return v8::Undefined(); diff --git a/webkit/glue/webdevtoolsclient_impl.h b/webkit/glue/webdevtoolsclient_impl.h index a7ae71f5..07df265 100644 --- a/webkit/glue/webdevtoolsclient_impl.h +++ b/webkit/glue/webdevtoolsclient_impl.h @@ -38,12 +38,17 @@ class WebDevToolsClientImpl : public WebDevToolsClient, virtual ~WebDevToolsClientImpl(); // DevToolsRpc::Delegate implementation. - virtual void SendRpcMessage(const std::string& raw_msg); + virtual void SendRpcMessage(const std::string& class_name, + const std::string& method_name, + const std::string& raw_msg); // WebDevToolsClient implementation. - virtual void DispatchMessageFromAgent(const std::string& raw_msg); + virtual void DispatchMessageFromAgent(const std::string& class_name, + const std::string& method_name, + const std::string& raw_msg); private: + void ExecuteScript(const std::string& expr); static v8::Handle<v8::Value> JsAddSourceToFrame(const v8::Arguments& args); static v8::Handle<v8::Value> JsLoaded(const v8::Arguments& args); static v8::Handle<v8::Value> JsActivateWindow(const v8::Arguments& args); |