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

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

Issue 155217: DevTools: Push context id to the client on 'window object cleared' event. (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_impl.cc ('k') | webkit/glue/devtools/js/devtools.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 20134)
+++ webkit/glue/devtools/js/debugger_agent.js (working copy)
@@ -15,8 +15,8 @@
devtools.DebuggerAgent = function() {
RemoteDebuggerAgent.DebuggerOutput =
goog.bind(this.handleDebuggerOutput_, this);
- RemoteDebuggerAgent.DidGetContextId =
- goog.bind(this.didGetContextId_, this);
+ RemoteDebuggerAgent.SetContextId =
+ goog.bind(this.setContextId_, this);
RemoteDebuggerAgent.DidIsProfilingStarted =
goog.bind(this.didIsProfilingStarted_, this);
RemoteDebuggerAgent.DidGetNextLogLines =
@@ -119,26 +119,18 @@
/**
- * Requests scripts list if it has not been requested yet.
- */
-devtools.DebuggerAgent.prototype.initializeScriptsCache = function() {
- if (!this.scriptsCacheInitialized_) {
- this.scriptsCacheInitialized_ = true;
- this.requestScripts();
- }
-};
-
-
-/**
* Asynchronously requests for all parsed script sources. Response will be
* processed in handleScriptsResponse_.
*/
devtools.DebuggerAgent.prototype.requestScripts = function() {
- if (this.contextId_ === null) {
- // Update context id first to filter the scripts.
- RemoteDebuggerAgent.GetContextId();
+ 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.
return;
}
+
+ RemoteDebuggerAgent.GetContextId();
var cmd = new devtools.DebugCommand('scripts', {
'includeSource': false
});
@@ -545,13 +537,11 @@
/**
- * Handles GetContextId response.
+ * Sets debugger context id for scripts filtering.
* @param {number} contextId Id of the inspected page global context.
*/
-devtools.DebuggerAgent.prototype.didGetContextId_ = function(contextId) {
+devtools.DebuggerAgent.prototype.setContextId_ = function(contextId) {
this.contextId_ = contextId;
- // Update scripts.
- this.requestScripts();
};
@@ -719,7 +709,7 @@
* @param {devtools.DebuggerMessage} msg
*/
devtools.DebuggerAgent.prototype.handleAfterCompileEvent_ = function(msg) {
- if (!this.scriptsCacheInitialized_) {
+ if (!this.contextId_) {
// Ignore scripts delta if main request has not been issued yet.
return;
}
« no previous file with comments | « webkit/glue/devtools/debugger_agent_impl.cc ('k') | webkit/glue/devtools/js/devtools.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698