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

Unified Diff: webkit/glue/devtools/js/devtools.js

Issue 159395: DevTools: make pause work for script evaluations (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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/devtools/debugger_agent_manager.cc ('k') | webkit/glue/devtools/js/inject.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/devtools/js/devtools.js
===================================================================
--- webkit/glue/devtools/js/devtools.js (revision 21636)
+++ webkit/glue/devtools/js/devtools.js (working copy)
@@ -67,18 +67,21 @@
/**
* @param {string} script Script exression to be evaluated in the context of the
* inspected page.
- * @param {function(string):undefined} callback Function to call with the
- * result.
+ * @param {function(Object|string, boolean):undefined} opt_callback Function to call
+ * with the result.
*/
-devtools.ToolsAgent.prototype.evaluateJavaScript = function(script, callback) {
- var callbackId = devtools.Callback.wrap(function(result) {
- var pair = JSON.parse(result);
- if (callback) {
- callback(pair[0], pair[1]);
+devtools.ToolsAgent.prototype.evaluateJavaScript = function(script,
+ opt_callback) {
+ var callbackId = devtools.Callback.wrap(function(result, exception) {
+ if (opt_callback) {
+ if (exception) {
+ opt_callback(exception, true /* result is exception */);
+ } else {
+ opt_callback(JSON.parse(result), false);
+ }
}
});
- RemoteToolsAgent.ExecuteUtilityFunction(callbackId,
- 'evaluate', JSON.stringify([script]));
+ RemoteToolsAgent.EvaluateJavaScript(callbackId, script);
};
« no previous file with comments | « webkit/glue/devtools/debugger_agent_manager.cc ('k') | webkit/glue/devtools/js/inject.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698