Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: webkit/glue/webdevtoolsclient_impl.cc

Issue 115862: DevTools: pass class and method name as arguments to RPC messages (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/webdevtoolsclient_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webdevtoolsclient_impl.cc
===================================================================
--- webkit/glue/webdevtoolsclient_impl.cc (revision 17071)
+++ webkit/glue/webdevtoolsclient_impl.cc (working copy)
@@ -122,18 +122,31 @@
}
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 @@
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();
« no previous file with comments | « webkit/glue/webdevtoolsclient_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698