diff options
author | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-12 09:16:34 +0000 |
---|---|---|
committer | yurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-12 09:16:34 +0000 |
commit | ce8b154d8c8f0e9b9c1c18b0c714c98cacbf5b97 (patch) | |
tree | 7c9cc1eae837386e3efd31c7557a63a12194cee2 /webkit/glue | |
parent | 84d231e748ee933e7a26d683a01d328d6a76a061 (diff) | |
download | chromium_src-ce8b154d8c8f0e9b9c1c18b0c714c98cacbf5b97.zip chromium_src-ce8b154d8c8f0e9b9c1c18b0c714c98cacbf5b97.tar.gz chromium_src-ce8b154d8c8f0e9b9c1c18b0c714c98cacbf5b97.tar.bz2 |
Don't request scripts until ScriptsPanel is visible.
Review URL: http://codereview.chromium.org/115130
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15844 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/devtools/js/debugger_agent.js | 28 | ||||
-rw-r--r-- | webkit/glue/devtools/js/devtools.js | 10 |
2 files changed, 32 insertions, 6 deletions
diff --git a/webkit/glue/devtools/js/debugger_agent.js b/webkit/glue/devtools/js/debugger_agent.js index 4454b83..0fc5812 100644 --- a/webkit/glue/devtools/js/debugger_agent.js +++ b/webkit/glue/devtools/js/debugger_agent.js @@ -49,17 +49,35 @@ devtools.DebuggerAgent = function() { * @type {Object} */ this.requestSeqToCallback_ = null; + + /** + * Whether the scripts list has been requested. + * @type {boolean} + */ + this.scriptsCacheInitialized_ = false; }; /** * Resets debugger agent to its initial state. */ - devtools.DebuggerAgent.prototype.reset = function() { - this.parsedScripts_ = {}; - this.requestNumberToBreakpointInfo_ = {}; - this.currentCallFrame_ = null; - this.requestSeqToCallback_ = {}; +devtools.DebuggerAgent.prototype.reset = function() { + this.scriptsCacheInitialized_ = false; + this.parsedScripts_ = {}; + this.requestNumberToBreakpointInfo_ = {}; + this.currentCallFrame_ = null; + this.requestSeqToCallback_ = {}; +}; + + +/** + * Requests scripts list if it has not been requested yet. + */ +devtools.DebuggerAgent.prototype.initializeScriptsCache = function() { + if (!this.scriptsCacheInitialized_) { + this.scriptsCacheInitialized_ = true; + this.requestScripts(); + } }; diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js index 107a8ea..96c03fd 100644 --- a/webkit/glue/devtools/js/devtools.js +++ b/webkit/glue/devtools/js/devtools.js @@ -38,7 +38,6 @@ devtools.ToolsAgent.prototype.reset = function() { this.debuggerAgent_.reset(); this.domAgent_.getDocumentElementAsync(); - this.debuggerAgent_.requestScripts(); }; @@ -705,3 +704,12 @@ WebInspector.Console.prototype._evalInInspectedWindow = function(expression) { // the command log message. return 'evaluating...'; }; + + +(function() { + var oldShow = WebInspector.ScriptsPanel.prototype.show; + WebInspector.ScriptsPanel.prototype.show = function() { + devtools.tools.getDebuggerAgent().initializeScriptsCache(); + oldShow.call(this); + }; +})(); |