| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 WebInspector.RawSourceCode.SourceMapping.prototype = { | 259 WebInspector.RawSourceCode.SourceMapping.prototype = { |
| 260 /** | 260 /** |
| 261 * @param {DebuggerAgent.Location} rawLocation | 261 * @param {DebuggerAgent.Location} rawLocation |
| 262 * @return {WebInspector.UILocation} | 262 * @return {WebInspector.UILocation} |
| 263 */ | 263 */ |
| 264 rawLocationToUILocation: function(rawLocation) { }, | 264 rawLocationToUILocation: function(rawLocation) { }, |
| 265 | 265 |
| 266 /** | 266 /** |
| 267 * @param {WebInspector.UISourceCode} uiSourceCode | 267 * @param {WebInspector.UISourceCode} uiSourceCode |
| 268 * @param {number} lineNumber | 268 * @param {number} lineNumber |
| 269 * @param {number} columnNumber |
| 269 * @return {DebuggerAgent.Location} | 270 * @return {DebuggerAgent.Location} |
| 270 */ | 271 */ |
| 271 uiLocationToRawLocation: function(uiSourceCode, lineNumber) { } | 272 uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber) {
} |
| 272 } | 273 } |
| 273 | 274 |
| 274 /** | 275 /** |
| 275 * @constructor | 276 * @constructor |
| 276 * @implements {WebInspector.RawSourceCode.SourceMapping} | 277 * @implements {WebInspector.RawSourceCode.SourceMapping} |
| 277 * @param {WebInspector.RawSourceCode} rawSourceCode | 278 * @param {WebInspector.RawSourceCode} rawSourceCode |
| 278 * @param {WebInspector.UISourceCode} uiSourceCode | 279 * @param {WebInspector.UISourceCode} uiSourceCode |
| 279 */ | 280 */ |
| 280 WebInspector.RawSourceCode.PlainSourceMapping = function(rawSourceCode, uiSource
Code) | 281 WebInspector.RawSourceCode.PlainSourceMapping = function(rawSourceCode, uiSource
Code) |
| 281 { | 282 { |
| 282 this._rawSourceCode = rawSourceCode; | 283 this._rawSourceCode = rawSourceCode; |
| 283 this._uiSourceCodeList = [uiSourceCode]; | 284 this._uiSourceCodeList = [uiSourceCode]; |
| 284 } | 285 } |
| 285 | 286 |
| 286 WebInspector.RawSourceCode.PlainSourceMapping.prototype = { | 287 WebInspector.RawSourceCode.PlainSourceMapping.prototype = { |
| 287 /** | 288 /** |
| 288 * @param {DebuggerAgent.Location} rawLocation | 289 * @param {DebuggerAgent.Location} rawLocation |
| 289 * @return {WebInspector.UILocation} | 290 * @return {WebInspector.UILocation} |
| 290 */ | 291 */ |
| 291 rawLocationToUILocation: function(rawLocation) | 292 rawLocationToUILocation: function(rawLocation) |
| 292 { | 293 { |
| 293 return new WebInspector.UILocation(this._uiSourceCodeList[0], rawLocatio
n.lineNumber, rawLocation.columnNumber || 0); | 294 return new WebInspector.UILocation(this._uiSourceCodeList[0], rawLocatio
n.lineNumber, rawLocation.columnNumber || 0); |
| 294 }, | 295 }, |
| 295 | 296 |
| 296 /** | 297 /** |
| 297 * @param {WebInspector.UISourceCode} uiSourceCode | 298 * @param {WebInspector.UISourceCode} uiSourceCode |
| 298 * @param {number} lineNumber | 299 * @param {number} lineNumber |
| 300 * @param {number} columnNumber |
| 299 * @return {DebuggerAgent.Location} | 301 * @return {DebuggerAgent.Location} |
| 300 */ | 302 */ |
| 301 uiLocationToRawLocation: function(uiSourceCode, lineNumber) | 303 uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber) |
| 302 { | 304 { |
| 303 console.assert(uiSourceCode === this._uiSourceCodeList[0]); | 305 console.assert(uiSourceCode === this._uiSourceCodeList[0]); |
| 304 var rawLocation = { lineNumber: lineNumber, columnNumber: 0 }; | 306 var rawLocation = { lineNumber: lineNumber, columnNumber: columnNumber }
; |
| 305 rawLocation.scriptId = this._rawSourceCode._scriptForRawLocation(rawLoca
tion.lineNumber, rawLocation.columnNumber).scriptId; | 307 rawLocation.scriptId = this._rawSourceCode._scriptForRawLocation(rawLoca
tion.lineNumber, rawLocation.columnNumber).scriptId; |
| 306 return /** @type {DebuggerAgent.Location} */ rawLocation; | 308 return /** @type {DebuggerAgent.Location} */ rawLocation; |
| 307 }, | 309 }, |
| 308 | 310 |
| 309 /** | 311 /** |
| 310 * @return {Array.<WebInspector.UISourceCode>} | 312 * @return {Array.<WebInspector.UISourceCode>} |
| 311 */ | 313 */ |
| 312 uiSourceCodeList: function() | 314 uiSourceCodeList: function() |
| 313 { | 315 { |
| 314 return this._uiSourceCodeList; | 316 return this._uiSourceCodeList; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 335 */ | 337 */ |
| 336 rawLocationToUILocation: function(rawLocation) | 338 rawLocationToUILocation: function(rawLocation) |
| 337 { | 339 { |
| 338 var location = this._mapping.originalToFormatted(rawLocation); | 340 var location = this._mapping.originalToFormatted(rawLocation); |
| 339 return new WebInspector.UILocation(this._uiSourceCodeList[0], location.l
ineNumber, location.columnNumber || 0); | 341 return new WebInspector.UILocation(this._uiSourceCodeList[0], location.l
ineNumber, location.columnNumber || 0); |
| 340 }, | 342 }, |
| 341 | 343 |
| 342 /** | 344 /** |
| 343 * @param {WebInspector.UISourceCode} uiSourceCode | 345 * @param {WebInspector.UISourceCode} uiSourceCode |
| 344 * @param {number} lineNumber | 346 * @param {number} lineNumber |
| 347 * @param {number} columnNumber |
| 345 * @return {DebuggerAgent.Location} | 348 * @return {DebuggerAgent.Location} |
| 346 */ | 349 */ |
| 347 uiLocationToRawLocation: function(uiSourceCode, lineNumber) | 350 uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber) |
| 348 { | 351 { |
| 349 console.assert(uiSourceCode === this._uiSourceCodeList[0]); | 352 console.assert(uiSourceCode === this._uiSourceCodeList[0]); |
| 350 var rawLocation = this._mapping.formattedToOriginal({ lineNumber: lineNu
mber, columnNumber: 0 }); | 353 var rawLocation = this._mapping.formattedToOriginal({ lineNumber: lineNu
mber, columnNumber: columnNumber }); |
| 351 rawLocation.scriptId = this._rawSourceCode._scriptForRawLocation(rawLoca
tion.lineNumber, rawLocation.columnNumber).scriptId; | 354 rawLocation.scriptId = this._rawSourceCode._scriptForRawLocation(rawLoca
tion.lineNumber, rawLocation.columnNumber).scriptId; |
| 352 return rawLocation; | 355 return rawLocation; |
| 353 }, | 356 }, |
| 354 | 357 |
| 355 /** | 358 /** |
| 356 * @return {Array.<WebInspector.UISourceCode>} | 359 * @return {Array.<WebInspector.UISourceCode>} |
| 357 */ | 360 */ |
| 358 uiSourceCodeList: function() | 361 uiSourceCodeList: function() |
| 359 { | 362 { |
| 360 return this._uiSourceCodeList; | 363 return this._uiSourceCodeList; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 385 rawLocationToUILocation: function(rawLocation) | 388 rawLocationToUILocation: function(rawLocation) |
| 386 { | 389 { |
| 387 var location = this._mapping.compiledLocationToSourceLocation(rawLocatio
n.lineNumber, rawLocation.columnNumber || 0); | 390 var location = this._mapping.compiledLocationToSourceLocation(rawLocatio
n.lineNumber, rawLocation.columnNumber || 0); |
| 388 var uiSourceCode = this._uiSourceCodeByURL[location.sourceURL]; | 391 var uiSourceCode = this._uiSourceCodeByURL[location.sourceURL]; |
| 389 return new WebInspector.UILocation(uiSourceCode, location.lineNumber, lo
cation.columnNumber); | 392 return new WebInspector.UILocation(uiSourceCode, location.lineNumber, lo
cation.columnNumber); |
| 390 }, | 393 }, |
| 391 | 394 |
| 392 /** | 395 /** |
| 393 * @param {WebInspector.UISourceCode} uiSourceCode | 396 * @param {WebInspector.UISourceCode} uiSourceCode |
| 394 * @param {number} lineNumber | 397 * @param {number} lineNumber |
| 398 * @param {number} columnNumber |
| 395 * @return {DebuggerAgent.Location} | 399 * @return {DebuggerAgent.Location} |
| 396 */ | 400 */ |
| 397 uiLocationToRawLocation: function(uiSourceCode, lineNumber) | 401 uiLocationToRawLocation: function(uiSourceCode, lineNumber, columnNumber) |
| 398 { | 402 { |
| 399 var rawLocation = this._mapping.sourceLocationToCompiledLocation(uiSourc
eCode.url, lineNumber, 0); | 403 var rawLocation = this._mapping.sourceLocationToCompiledLocation(uiSourc
eCode.url, lineNumber); |
| 400 rawLocation.scriptId = this._rawSourceCode._scriptForRawLocation(rawLoca
tion.lineNumber, rawLocation.columnNumber).scriptId; | 404 rawLocation.scriptId = this._rawSourceCode._scriptForRawLocation(rawLoca
tion.lineNumber, rawLocation.columnNumber).scriptId; |
| 401 return /** @type {DebuggerAgent.Location} */ rawLocation; | 405 return /** @type {DebuggerAgent.Location} */ rawLocation; |
| 402 }, | 406 }, |
| 403 | 407 |
| 404 /** | 408 /** |
| 405 * @return {Array.<WebInspector.UISourceCode>} | 409 * @return {Array.<WebInspector.UISourceCode>} |
| 406 */ | 410 */ |
| 407 get uiSourceCodeList() | 411 get uiSourceCodeList() |
| 408 { | 412 { |
| 409 return this._uiSourceCodeList; | 413 return this._uiSourceCodeList; |
| 410 } | 414 } |
| 411 } | 415 } |
| 412 | 416 |
| 413 /** | 417 /** |
| 414 * @constructor | 418 * @constructor |
| 415 * @param {WebInspector.UISourceCode} uiSourceCode | 419 * @param {WebInspector.UISourceCode} uiSourceCode |
| 416 * @param {number} lineNumber | 420 * @param {number} lineNumber |
| 417 * @param {number} columnNumber | 421 * @param {number} columnNumber |
| 418 */ | 422 */ |
| 419 WebInspector.UILocation = function(uiSourceCode, lineNumber, columnNumber) | 423 WebInspector.UILocation = function(uiSourceCode, lineNumber, columnNumber) |
| 420 { | 424 { |
| 421 this.uiSourceCode = uiSourceCode; | 425 this.uiSourceCode = uiSourceCode; |
| 422 this.lineNumber = lineNumber; | 426 this.lineNumber = lineNumber; |
| 423 this.columnNumber = columnNumber; | 427 this.columnNumber = columnNumber; |
| 424 } | 428 } |
| OLD | NEW |