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

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

Issue 341057: DevTools: add all scripts from afterCompile events when scripts panel is show... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « chrome/browser/debugger/devtools_sanity_unittest.cc ('k') | webkit/glue/devtools/js/tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/devtools/js/debugger_agent.js
===================================================================
--- webkit/glue/devtools/js/debugger_agent.js (revision 30578)
+++ webkit/glue/devtools/js/debugger_agent.js (working copy)
@@ -62,10 +62,10 @@
this.requestSeqToCallback_ = null;
/**
- * Whether the scripts list has been requested.
+ * Whether the scripts panel has been shown and initialilzed.
* @type {boolean}
*/
- this.scriptsCacheInitialized_ = false;
+ this.scriptsPanelInitialized_ = false;
/**
* Whether the scripts list should be requested next time when context id is
@@ -155,14 +155,22 @@
*/
devtools.DebuggerAgent.prototype.initUI = function() {
// Initialize scripts cache when Scripts panel is shown first time.
- if (this.scriptsCacheInitialized_) {
+ if (this.scriptsPanelInitialized_) {
return;
}
- this.scriptsCacheInitialized_ = true;
+ this.scriptsPanelInitialized_ = true;
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
// via after-compile events. No need to request scripts for this session.
+ //
+ // 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());
+ }
return;
}
// Script list should be requested only when current context id is known.
@@ -1033,7 +1041,7 @@
var contextType = context.data.type;
this.parsedScripts_[script.id] = new devtools.ScriptInfo(
script.id, script.name, script.lineOffset, contextType);
- if (WebInspector.panels.scripts.element.parentElement) {
+ if (this.scriptsPanelInitialized_) {
// Only report script as parsed after scripts panel has been shown.
WebInspector.parsedScriptSource(
script.id, script.name, script.source, script.lineOffset);
« no previous file with comments | « chrome/browser/debugger/devtools_sanity_unittest.cc ('k') | webkit/glue/devtools/js/tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698