summaryrefslogtreecommitdiffstats
path: root/webkit/glue/devtools
diff options
context:
space:
mode:
authorpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-15 10:06:14 +0000
committerpfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-15 10:06:14 +0000
commit104f8da823407fec983b5cbabcd94425c5c2daa9 (patch)
treeb23773e19f3395b0523de956a1e1afc03e1c0de2 /webkit/glue/devtools
parent0ff37cd8a0365e08c649ef6a9e0591ccedac540f (diff)
downloadchromium_src-104f8da823407fec983b5cbabcd94425c5c2daa9.zip
chromium_src-104f8da823407fec983b5cbabcd94425c5c2daa9.tar.gz
chromium_src-104f8da823407fec983b5cbabcd94425c5c2daa9.tar.bz2
DevTools: Provisional commit for https://bugs.webkit.org/attachment.cgi?id=31255 landing.
Review URL: http://codereview.chromium.org/125119 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18377 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/devtools')
-rw-r--r--webkit/glue/devtools/js/debugger_agent.js37
-rw-r--r--webkit/glue/devtools/js/devtools.js51
-rw-r--r--webkit/glue/devtools/js/devtools_host_stub.js9
3 files changed, 59 insertions, 38 deletions
diff --git a/webkit/glue/devtools/js/debugger_agent.js b/webkit/glue/devtools/js/debugger_agent.js
index 88ab92c..562a84a 100644
--- a/webkit/glue/devtools/js/debugger_agent.js
+++ b/webkit/glue/devtools/js/debugger_agent.js
@@ -1042,31 +1042,40 @@ devtools.CallFrame = function() {
* This method is called by
* WebInspector.ScriptsPanel.evaluateInSelectedCallFrame. This method issues
* asynchronous evaluate request.
+ * TODO(pfeldman): Remove this method once new console API is landed.
* @param {string} expression An expression to be evaluated in the context of
* this call frame.
* @return {string} User message that the expression is being evaluated.
*/
devtools.CallFrame.prototype.evaluate = function(expression) {
- devtools.tools.getDebuggerAgent().requestEvaluate({
- 'expression': expression,
- 'frame': this.frameNumber,
- 'global': false,
- 'disable_break': false
- },
- devtools.CallFrame.handleEvaluateResponse_);
+ devtools.CallFrame.doEvalInCallFrame(this, expression, function(value) {
+ WebInspector.console.addMessage(new WebInspector.ConsoleCommandResult(
+ value, false /* exception */, null /* commandMessage */));
+ });
return 'evaluating...';
};
/**
- * Handles 'evaluate' response for a call frame
- * @param {devtools.DebuggerMessage} response
+ * This method issues asynchronous evaluate request, reports result to the
+ * callback.
+ * @param {devtools.CallFrame} callFrame Call frame to evaluate in.
+ * @param {string} expression An expression to be evaluated in the context of
+ * this call frame.
+ * @param {function(Object):undefined} callback Callback to report result to.
*/
-devtools.CallFrame.handleEvaluateResponse_ = function(response) {
- var body = response.getBody();
- var value = devtools.DebuggerAgent.formatObjectReference_(body);
- WebInspector.console.addMessage(new WebInspector.ConsoleCommandResult(
- value, false /* exception */, null /* commandMessage */));
+devtools.CallFrame.doEvalInCallFrame =
+ function(callFrame, expression, callback) {
+ devtools.tools.getDebuggerAgent().requestEvaluate({
+ 'expression': expression,
+ 'frame': callFrame.frameNumber,
+ 'global': false,
+ 'disable_break': false
+ },
+ function(response) {
+ var body = response.getBody();
+ callback(devtools.DebuggerAgent.formatObjectReference_(body));
+ });
};
diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js
index b958492..9e93da0 100644
--- a/webkit/glue/devtools/js/devtools.js
+++ b/webkit/glue/devtools/js/devtools.js
@@ -353,25 +353,6 @@ WebInspector.ElementsPanel.prototype.jumpToPreviousSearchResult = function() {
/**
* @override
*/
-WebInspector.Console.prototype._evalInInspectedWindow = function(expr) {
- return devtools.tools.evaluate(expr);
-};
-
-
-/**
- * Disable autocompletion in the console.
- * TODO(yurys): change WebKit implementation to allow asynchronous completion.
- * @override
- */
-WebInspector.Console.prototype.completions = function(
- wordRange, bestMatchOnly) {
- return null;
-};
-
-
-/**
- * @override
- */
WebInspector.ElementsPanel.prototype.updateStyles = function(forceUpdate) {
var stylesSidebarPane = this.sidebarPanes.styles;
if (!stylesSidebarPane.expanded || !stylesSidebarPane.needsUpdate) {
@@ -798,9 +779,27 @@ WebInspector.ScriptsPanel.prototype.__defineGetter__(
WebInspector.searchableViews_);
-/**
- * @override
- */
+// Console API provisional fix.
+if (WebInspector.Console.prototype.doEvalInWindow) {
+
+
+WebInspector.Console.prototype.doEvalInWindow =
+ function(expression, callback) {
+ devtools.tools.evaluateJavaScript(expression, callback);
+};
+
+
+WebInspector.ScriptsPanel.prototype.doEvalInCallFrame =
+ function(callFrame, expression, callback) {
+ devtools.CallFrame.doEvalInCallFrame(callFrame, expression, callback);
+};
+
+
+} else {
+
+// TODO(pfeldman): remove onces https://bugs.webkit.org/attachment.cgi?id=31255
+// is landed and pushed into Chromium.
+
WebInspector.Console.prototype._evalInInspectedWindow = function(expression) {
if (WebInspector.panels.scripts.paused)
return WebInspector.panels.scripts.evaluateInSelectedCallFrame(expression);
@@ -812,11 +811,15 @@ WebInspector.Console.prototype._evalInInspectedWindow = function(expression) {
console.addMessage(new WebInspector.ConsoleCommandResult(
response, exception, null /* commandMessage */));
});
- // TODO(yurys): refactor WebInspector.Console so that the result is added into
- // the command log message.
return 'evaluating...';
};
+WebInspector.Console.prototype.completions = function(
+ wordRange, bestMatchOnly) {
+ return null;
+};
+
+} // end of Console API provisional fix.
(function() {
var oldShow = WebInspector.ScriptsPanel.prototype.show;
diff --git a/webkit/glue/devtools/js/devtools_host_stub.js b/webkit/glue/devtools/js/devtools_host_stub.js
index 42a27ea..7d10544 100644
--- a/webkit/glue/devtools/js/devtools_host_stub.js
+++ b/webkit/glue/devtools/js/devtools_host_stub.js
@@ -326,6 +326,15 @@ DevToolsHostStub.prototype.loaded = function() {
};
+DevToolsHostStub.prototype.reset = function() {
+};
+
+
+DevToolsHostStub.prototype.getPlatform = function() {
+ return "windows";
+};
+
+
DevToolsHostStub.prototype.addResourceSourceToFrame = function(
identifier, mimeType, element) {
};