diff options
author | yurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-15 10:09:18 +0000 |
---|---|---|
committer | yurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-15 10:09:18 +0000 |
commit | efd233d9b7831d1371594aee9434e5a684aa0c3a (patch) | |
tree | 17e43fc1398bd7e4dd2e12d6154eca2ec55e76d7 /webkit | |
parent | 34fd3763e84b2347ab89ec5be7c7f73dac9ccb6a (diff) | |
download | chromium_src-efd233d9b7831d1371594aee9434e5a684aa0c3a.zip chromium_src-efd233d9b7831d1371594aee9434e5a684aa0c3a.tar.gz chromium_src-efd233d9b7831d1371594aee9434e5a684aa0c3a.tar.bz2 |
DevTools: provide async parameter for dispatchOnInjectedScript
Review URL: http://codereview.chromium.org/492032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/devtools/devtools_rpc.h | 7 | ||||
-rw-r--r-- | webkit/glue/devtools/js/inspector_controller_impl.js | 12 | ||||
-rw-r--r-- | webkit/glue/devtools/tools_agent.h | 4 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsagent_impl.cc | 10 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsagent_impl.h | 3 |
5 files changed, 11 insertions, 25 deletions
diff --git a/webkit/glue/devtools/devtools_rpc.h b/webkit/glue/devtools/devtools_rpc.h index 1a068b2..2a2ef12 100644 --- a/webkit/glue/devtools/devtools_rpc.h +++ b/webkit/glue/devtools/devtools_rpc.h @@ -77,13 +77,10 @@ template<> struct RpcTypeTrait<bool> { typedef bool ApiType; static bool Parse(const WebCore::String& t) { - bool success; - int i = t.toIntStrict(&success); - ASSERT(success); - return i; + return t == "true"; } static WebCore::String ToString(bool b) { - return WebCore::String::number(b ? 1 : 0); + return b ? "true" : "false"; } }; diff --git a/webkit/glue/devtools/js/inspector_controller_impl.js b/webkit/glue/devtools/js/inspector_controller_impl.js index 89f33c2..b15f4a7 100644 --- a/webkit/glue/devtools/js/inspector_controller_impl.js +++ b/webkit/glue/devtools/js/inspector_controller_impl.js @@ -192,16 +192,8 @@ devtools.InspectorBackendImpl.prototype.takeHeapSnapshot = function() { /** * @override */ -devtools.InspectorBackendImpl.prototype.dispatchOnInjectedScript = function( - callId, methodName, argsString, async) { - var callback = function(result, isException) { - WebInspector.didDispatchOnInjectedScript(callId, result, isException); - }; - RemoteToolsAgent.DispatchOnInjectedScript( - WebInspector.Callback.wrap(callback), - async ? methodName + "_async" : methodName, - argsString); -}; +devtools.InspectorBackendImpl.prototype.dispatchOnInjectedScript = + RemoteToolsAgent.DispatchOnInjectedScript.bind(RemoteToolsAgent); /** diff --git a/webkit/glue/devtools/tools_agent.h b/webkit/glue/devtools/tools_agent.h index b67f2eb..02c6f5b 100644 --- a/webkit/glue/devtools/tools_agent.h +++ b/webkit/glue/devtools/tools_agent.h @@ -19,8 +19,8 @@ String /* function_name */, String /* json_args */) \ \ /* Dispatches given function on the InjectedScript object */ \ - METHOD3(DispatchOnInjectedScript, int /* call_id */, \ - String /* function_name */, String /* json_args */) \ + METHOD4(DispatchOnInjectedScript, int /* call_id */, \ + String /* function_name */, String /* json_args */, bool /* async */) \ \ /* Requests that the agent sends content of the resource with given id to the delegate. */ \ diff --git a/webkit/glue/webdevtoolsagent_impl.cc b/webkit/glue/webdevtoolsagent_impl.cc index aad0348..903231cc 100644 --- a/webkit/glue/webdevtoolsagent_impl.cc +++ b/webkit/glue/webdevtoolsagent_impl.cc @@ -245,16 +245,12 @@ void WebDevToolsAgentImpl::DispatchOnInspectorController( void WebDevToolsAgentImpl::DispatchOnInjectedScript( int call_id, const String& function_name, - const String& json_args) { + const String& json_args, + bool async) { String result; String exception; - String fname = function_name; - bool async = function_name.endsWith("_async"); - if (async) { - fname = fname.substring(0, fname.length() - 6); - } result = debugger_agent_impl_->ExecuteUtilityFunction(utility_context_, - call_id, "InjectedScript", fname, json_args, async, &exception); + call_id, "InjectedScript", function_name, json_args, async, &exception); if (!async) { tools_agent_delegate_stub_->DidDispatchOn(call_id, result, exception); diff --git a/webkit/glue/webdevtoolsagent_impl.h b/webkit/glue/webdevtoolsagent_impl.h index 59864b0..736050a 100644 --- a/webkit/glue/webdevtoolsagent_impl.h +++ b/webkit/glue/webdevtoolsagent_impl.h @@ -55,7 +55,8 @@ class WebDevToolsAgentImpl : public WebKit::WebDevToolsAgentPrivate, virtual void DispatchOnInjectedScript( int call_id, const WebCore::String& function_name, - const WebCore::String& json_args); + const WebCore::String& json_args, + bool async); virtual void ExecuteVoidJavaScript(); virtual void GetResourceContent( int call_id, |