| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Provides communication interface to remote v8 debugger. See | 6 * @fileoverview Provides communication interface to remote v8 debugger. See |
| 7 * protocol decription at http://code.google.com/p/v8/wiki/DebuggerProtocol | 7 * protocol decription at http://code.google.com/p/v8/wiki/DebuggerProtocol |
| 8 */ | 8 */ |
| 9 goog.provide('devtools.DebuggerAgent'); | 9 goog.provide('devtools.DebuggerAgent'); |
| 10 | 10 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 * @param {devtools.DebuggerMessage} msg | 273 * @param {devtools.DebuggerMessage} msg |
| 274 */ | 274 */ |
| 275 devtools.DebuggerAgent.prototype.handleScriptsResponse_ = function(msg) { | 275 devtools.DebuggerAgent.prototype.handleScriptsResponse_ = function(msg) { |
| 276 var scripts = msg.getBody(); | 276 var scripts = msg.getBody(); |
| 277 for (var i = 0; i < scripts.length; i++) { | 277 for (var i = 0; i < scripts.length; i++) { |
| 278 var script = scripts[i]; | 278 var script = scripts[i]; |
| 279 | 279 |
| 280 this.parsedScripts_[script.id] = new devtools.ScriptInfo( | 280 this.parsedScripts_[script.id] = new devtools.ScriptInfo( |
| 281 script.id, script.lineOffset); | 281 script.id, script.lineOffset); |
| 282 | 282 |
| 283 var name = script.name; |
| 284 if (name.indexOf('http') == 0) { |
| 285 var slash = name.lastIndexOf('/'); |
| 286 if (slash != -1) { |
| 287 name = name.substr(slash + 1); |
| 288 } |
| 289 } |
| 290 if (name.length > 100) { |
| 291 name = name.substr(0, 50) + '...' + name.substr(name.length - 50); |
| 292 } |
| 283 WebInspector.parsedScriptSource( | 293 WebInspector.parsedScriptSource( |
| 284 script.id, script.name, script.source, script.lineOffset); | 294 script.id, name, script.source, script.lineOffset); |
| 285 } | 295 } |
| 286 }; | 296 }; |
| 287 | 297 |
| 288 | 298 |
| 289 /** | 299 /** |
| 290 * @param {devtools.DebuggerMessage} msg | 300 * @param {devtools.DebuggerMessage} msg |
| 291 */ | 301 */ |
| 292 devtools.DebuggerAgent.prototype.handleSetBreakpointResponse_ = function(msg) { | 302 devtools.DebuggerAgent.prototype.handleSetBreakpointResponse_ = function(msg) { |
| 293 var requestSeq = msg.getRequestSeq(); | 303 var requestSeq = msg.getRequestSeq(); |
| 294 var breakpointInfo = this.requestNumberToBreakpointInfo_[requestSeq]; | 304 var breakpointInfo = this.requestNumberToBreakpointInfo_[requestSeq]; |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 | 632 |
| 623 | 633 |
| 624 /** | 634 /** |
| 625 * @param {number} handle Object handle. | 635 * @param {number} handle Object handle. |
| 626 * @return {?Object} Returns the object with the handle if it was sent in this | 636 * @return {?Object} Returns the object with the handle if it was sent in this |
| 627 * message(some objects referenced by handles may be missing in the message). | 637 * message(some objects referenced by handles may be missing in the message). |
| 628 */ | 638 */ |
| 629 devtools.DebuggerMessage.prototype.lookup = function(handle) { | 639 devtools.DebuggerMessage.prototype.lookup = function(handle) { |
| 630 return this.refs_[handle]; | 640 return this.refs_[handle]; |
| 631 }; | 641 }; |
| OLD | NEW |