diff options
author | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-10 14:12:18 +0000 |
---|---|---|
committer | pfeldman@chromium.org <pfeldman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-10 14:12:18 +0000 |
commit | b24067e608fb7466f9bcfde230404be027b2f54b (patch) | |
tree | c43d61123fe7f736fe97c4cda08721c6d28162f3 /webkit | |
parent | 84077754c8129dfbc8ae6b624df34267a1e2b9ef (diff) | |
download | chromium_src-b24067e608fb7466f9bcfde230404be027b2f54b.zip chromium_src-b24067e608fb7466f9bcfde230404be027b2f54b.tar.gz chromium_src-b24067e608fb7466f9bcfde230404be027b2f54b.tar.bz2 |
DevTools: postpone after-compile event propagation to the UI until scripts panel is shown.
Review URL: http://codereview.chromium.org/155352
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20374 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/devtools/js/debugger_agent.js | 31 | ||||
-rw-r--r-- | webkit/glue/devtools/js/devtools.js | 2 |
2 files changed, 24 insertions, 9 deletions
diff --git a/webkit/glue/devtools/js/debugger_agent.js b/webkit/glue/devtools/js/debugger_agent.js index efd7230..d333c88 100644 --- a/webkit/glue/devtools/js/debugger_agent.js +++ b/webkit/glue/devtools/js/debugger_agent.js @@ -126,10 +126,18 @@ devtools.DebuggerAgent.prototype.reset = function() { /** - * Asynchronously requests for all parsed script sources. Response will be - * processed in handleScriptsResponse_. - */ -devtools.DebuggerAgent.prototype.requestScripts = function() { + * Initializes scripts UI. Asynchronously requests for all parsed scripts + * if necessary. Response will be processed in handleScriptsResponse_. + */ +devtools.DebuggerAgent.prototype.initUI = function() { + // There can be a number of scripts from after-compile events that are + // pending addition into the UI. + for (var scriptId in this.parsedScripts_) { + var script = this.parsedScripts_[scriptId]; + WebInspector.parsedScriptSource(scriptId, script.getUrl(), + undefined /* script source */, script.getLineOffset()); + } + if (this.contextId_) { // We already have context id. This means that we are here from the // very beginning of the page load cycle and hence will get all scripts @@ -659,6 +667,9 @@ devtools.DebuggerAgent.prototype.handleDebuggerOutput_ = function(output) { * @param {devtools.DebuggerMessage} msg */ devtools.DebuggerAgent.prototype.handleBreakEvent_ = function(msg) { + // Force scrips panel to be shown first. + WebInspector.currentPanel = WebInspector.panels.scripts; + var body = msg.getBody(); var line = devtools.DebuggerAgent.v8ToWwebkitLineNumber_(body.sourceLine); @@ -674,9 +685,10 @@ devtools.DebuggerAgent.prototype.handleBreakEvent_ = function(msg) { * @param {devtools.DebuggerMessage} msg */ devtools.DebuggerAgent.prototype.handleExceptionEvent_ = function(msg) { + // Force scrips panel to be shown first. + WebInspector.currentPanel = WebInspector.panels.scripts; + var body = msg.getBody(); - debugPrint('Uncaught exception in ' + body.script.name + ':' + - body.sourceLine + '\n' + body.sourceLineText); if (this.pauseOnExceptions_) { var body = msg.getBody(); @@ -836,8 +848,11 @@ devtools.DebuggerAgent.prototype.addScriptInfo_ = function(script, msg) { var contextType = context.data.type; this.parsedScripts_[script.id] = new devtools.ScriptInfo( script.id, script.name, script.lineOffset, contextType); - WebInspector.parsedScriptSource( - script.id, script.name, script.source, script.lineOffset); + if (WebInspector.panels.scripts.element.parentElement) { + // Only report script as parsed after scripts panel has been shown. + WebInspector.parsedScriptSource( + script.id, script.name, script.source, script.lineOffset); + } }; diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js index bbd6314..aa32dcc 100644 --- a/webkit/glue/devtools/js/devtools.js +++ b/webkit/glue/devtools/js/devtools.js @@ -900,7 +900,7 @@ WebInspector.ScriptsPanel.prototype.doEvalInCallFrame = (function() { var oldShow = WebInspector.ScriptsPanel.prototype.show; WebInspector.ScriptsPanel.prototype.show = function() { - devtools.tools.getDebuggerAgent().requestScripts(); + devtools.tools.getDebuggerAgent().initUI(); this.enableToggleButton.addStyleClass('hidden'); oldShow.call(this); }; |