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

Unified Diff: webkit/glue/webdevtoolsagent_impl.cc

Issue 460018: DevTools: make possible profiling of scripts doing heavy calculations. (Closed)
Patch Set: Comments addressed Created 11 years 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/devtools/profiler_agent_impl.cc ('k') | webkit/glue/webdevtoolsfrontend_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webdevtoolsagent_impl.cc
diff --git a/webkit/glue/webdevtoolsagent_impl.cc b/webkit/glue/webdevtoolsagent_impl.cc
index 43ebc89bc685812e61844a39a0b6fe28f5cff296..ab8d9555de114013649dbdeff775a49a613fbf48 100644
--- a/webkit/glue/webdevtoolsagent_impl.cc
+++ b/webkit/glue/webdevtoolsagent_impl.cc
@@ -41,6 +41,7 @@
#include "webkit/glue/devtools/bound_object.h"
#include "webkit/glue/devtools/debugger_agent_impl.h"
#include "webkit/glue/devtools/debugger_agent_manager.h"
+#include "webkit/glue/devtools/profiler_agent_impl.h"
#include "webkit/glue/glue_util.h"
#include "webkit/glue/webdevtoolsagent_impl.h"
@@ -112,6 +113,27 @@ static const char kApuAgentFeatureName[] = "apu-agent";
static const char kTimelineFeatureName[] = "timeline-profiler";
static const char kResourceTrackingFeatureName[] = "resource-tracking";
+class IoRpcDelegate : public DevToolsRpc::Delegate {
+ public:
+ IoRpcDelegate() {}
+ virtual ~IoRpcDelegate() {}
+ virtual void SendRpcMessage(const String& class_name,
+ const String& method_name,
+ const String& p1,
+ const String& p2,
+ const String& p3) {
+ WebDevToolsAgentClient::sendMessageToFrontendOnIOThread(
+ webkit_glue::StringToWebString(class_name),
+ webkit_glue::StringToWebString(method_name),
+ webkit_glue::StringToWebString(p1),
+ webkit_glue::StringToWebString(p2),
+ webkit_glue::StringToWebString(p3));
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(IoRpcDelegate);
+};
+
} // namespace
WebDevToolsAgentImpl::WebDevToolsAgentImpl(
@@ -604,4 +626,23 @@ void WebDevToolsAgent::setMessageLoopDispatchHandler(
DebuggerAgentManager::SetMessageLoopDispatchHandler(handler);
}
+// static
+bool WebDevToolsAgent::dispatchMessageFromFrontendOnIOThread(
+ const WebString& className,
+ const WebString& methodName,
+ const WebString& param1,
+ const WebString& param2,
+ const WebString& param3) {
+ IoRpcDelegate transport;
+ ProfilerAgentDelegateStub stub(&transport);
+ ProfilerAgentImpl agent(&stub);
+ return ProfilerAgentDispatch::Dispatch(
+ &agent,
+ webkit_glue::WebStringToString(className),
+ webkit_glue::WebStringToString(methodName),
+ webkit_glue::WebStringToString(param1),
+ webkit_glue::WebStringToString(param2),
+ webkit_glue::WebStringToString(param3));
+}
+
} // namespace WebKit
« no previous file with comments | « webkit/glue/devtools/profiler_agent_impl.cc ('k') | webkit/glue/webdevtoolsfrontend_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698