Chromium Code Reviews| 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 278 | 278 |
| 279 var networkLog = target && WebInspector.NetworkLog.fromTarget(target); | 279 var networkLog = target && WebInspector.NetworkLog.fromTarget(target); |
| 280 this.request = (requestId && networkLog) ? networkLog.requestForId(requestId ) : null; | 280 this.request = (requestId && networkLog) ? networkLog.requestForId(requestId ) : null; |
| 281 | 281 |
| 282 if (this.request) { | 282 if (this.request) { |
| 283 var initiator = this.request.initiator(); | 283 var initiator = this.request.initiator(); |
| 284 if (initiator) { | 284 if (initiator) { |
| 285 this.stackTrace = initiator.stack || undefined; | 285 this.stackTrace = initiator.stack || undefined; |
| 286 if (initiator.url) { | 286 if (initiator.url) { |
| 287 this.url = initiator.url; | 287 this.url = initiator.url; |
| 288 this.line = initiator.lineNumber || 0; | 288 this.line = (initiator.lineNumber - 1) || 0; |
| 289 } | 289 } |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 } | 292 } |
| 293 | 293 |
| 294 WebInspector.ConsoleMessage.prototype = { | 294 WebInspector.ConsoleMessage.prototype = { |
| 295 /** | 295 /** |
| 296 * @return {?WebInspector.Target} | 296 * @return {?WebInspector.Target} |
| 297 */ | 297 */ |
| 298 target: function() | 298 target: function() |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 516 */ | 516 */ |
| 517 entryAdded: function(payload) | 517 entryAdded: function(payload) |
| 518 { | 518 { |
| 519 var consoleMessage = new WebInspector.ConsoleMessage( | 519 var consoleMessage = new WebInspector.ConsoleMessage( |
| 520 this._console.target(), | 520 this._console.target(), |
| 521 payload.source, | 521 payload.source, |
| 522 payload.level, | 522 payload.level, |
| 523 payload.text, | 523 payload.text, |
| 524 undefined, | 524 undefined, |
| 525 payload.url, | 525 payload.url, |
| 526 typeof payload.lineNumber === "undefined" ? undefined : payload.line Number + 1, | 526 typeof payload.lineNumber === "undefined" ? undefined : payload.line Number, |
|
dgozman
2016/07/20 00:59:14
Can just pass payload.lineNumber.
kozy
2016/07/20 01:11:50
Done.
| |
| 527 undefined, | 527 undefined, |
| 528 payload.networkRequestId, | 528 payload.networkRequestId, |
| 529 undefined, | 529 undefined, |
| 530 payload.stackTrace, | 530 payload.stackTrace, |
| 531 payload.timestamp, | 531 payload.timestamp, |
| 532 undefined, | 532 undefined, |
| 533 undefined, | 533 undefined, |
| 534 payload.workerId); | 534 payload.workerId); |
| 535 this._console.addMessage(consoleMessage); | 535 this._console.addMessage(consoleMessage); |
| 536 } | 536 } |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 615 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEv aluated, event.data); | 615 this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.CommandEv aluated, event.data); |
| 616 }, | 616 }, |
| 617 | 617 |
| 618 __proto__: WebInspector.Object.prototype | 618 __proto__: WebInspector.Object.prototype |
| 619 } | 619 } |
| 620 | 620 |
| 621 /** | 621 /** |
| 622 * @type {!WebInspector.MultitargetConsoleModel} | 622 * @type {!WebInspector.MultitargetConsoleModel} |
| 623 */ | 623 */ |
| 624 WebInspector.multitargetConsoleModel; | 624 WebInspector.multitargetConsoleModel; |
| OLD | NEW |