| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.TimelineUIUtils} | 7 * @extends {WebInspector.TimelineUIUtils} |
| 8 */ | 8 */ |
| 9 WebInspector.TracingTimelineUIUtils = function() | 9 WebInspector.TracingTimelineUIUtils = function() |
| 10 { | 10 { |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 * @param {string} url | 450 * @param {string} url |
| 451 * @param {number} lineNumber | 451 * @param {number} lineNumber |
| 452 * @param {number=} columnNumber | 452 * @param {number=} columnNumber |
| 453 */ | 453 */ |
| 454 function linkifyLocation(scriptId, url, lineNumber, columnNumber) | 454 function linkifyLocation(scriptId, url, lineNumber, columnNumber) |
| 455 { | 455 { |
| 456 if (!url) | 456 if (!url) |
| 457 return null; | 457 return null; |
| 458 | 458 |
| 459 // FIXME(62725): stack trace line/column numbers are one-based. | 459 // FIXME(62725): stack trace line/column numbers are one-based. |
| 460 return linkifier.linkifyLocationByScriptId(target, scriptId, url, lineNu
mber - 1, (columnNumber ||1) - 1, "timeline-details"); | 460 return linkifier.linkifyScriptLocation(target, scriptId, url, lineNumber
- 1, (columnNumber ||1) - 1, "timeline-details"); |
| 461 } | 461 } |
| 462 | 462 |
| 463 /** | 463 /** |
| 464 * @param {!ConsoleAgent.CallFrame} callFrame | |
| 465 */ | |
| 466 function linkifyCallFrame(callFrame) | |
| 467 { | |
| 468 return linkifyLocation(callFrame.scriptId, callFrame.url, callFrame.line
Number, callFrame.columnNumber); | |
| 469 } | |
| 470 | |
| 471 /** | |
| 472 * @return {?Element} | 464 * @return {?Element} |
| 473 */ | 465 */ |
| 474 function linkifyTopCallFrame() | 466 function linkifyTopCallFrame() |
| 475 { | 467 { |
| 476 var stackTrace = event.stackTrace; | 468 var stackTrace = event.stackTrace; |
| 477 if (!stackTrace) { | 469 if (!stackTrace) { |
| 478 var initiator = event.initiator; | 470 var initiator = event.initiator; |
| 479 if (initiator) | 471 if (initiator) |
| 480 stackTrace = initiator.stackTrace; | 472 stackTrace = initiator.stackTrace; |
| 481 } | 473 } |
| 482 if (!stackTrace || !stackTrace.length) | 474 if (!stackTrace || !stackTrace.length) |
| 483 return null; | 475 return null; |
| 484 return linkifyCallFrame(stackTrace[0]); | 476 return linkifier.linkifyConsoleCallFrame(target, stackTrace[0], "timelin
e-details"); |
| 485 } | 477 } |
| 486 } | 478 } |
| 487 | 479 |
| 488 /** | 480 /** |
| 489 * @param {!WebInspector.TracingModel.Event} event | 481 * @param {!WebInspector.TracingModel.Event} event |
| 490 * @param {!WebInspector.TracingTimelineModel} model | 482 * @param {!WebInspector.TracingTimelineModel} model |
| 491 * @param {!WebInspector.Linkifier} linkifier | 483 * @param {!WebInspector.Linkifier} linkifier |
| 492 * @param {function(!DocumentFragment)} callback | 484 * @param {function(!DocumentFragment)} callback |
| 493 */ | 485 */ |
| 494 WebInspector.TracingTimelineUIUtils.buildTraceEventDetails = function(event, mod
el, linkifier, callback) | 486 WebInspector.TracingTimelineUIUtils.buildTraceEventDetails = function(event, mod
el, linkifier, callback) |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 810 return result; | 802 return result; |
| 811 } | 803 } |
| 812 | 804 |
| 813 /** | 805 /** |
| 814 * @return {!WebInspector.TracingTimelineModel.Filter} | 806 * @return {!WebInspector.TracingTimelineModel.Filter} |
| 815 */ | 807 */ |
| 816 WebInspector.TracingTimelineUIUtils.hiddenEventsFilter = function() | 808 WebInspector.TracingTimelineUIUtils.hiddenEventsFilter = function() |
| 817 { | 809 { |
| 818 return new WebInspector.TracingTimelineModel.InclusiveEventNameFilter(WebIns
pector.TracingTimelineUIUtils._visibleTypes()); | 810 return new WebInspector.TracingTimelineModel.InclusiveEventNameFilter(WebIns
pector.TracingTimelineUIUtils._visibleTypes()); |
| 819 } | 811 } |
| OLD | NEW |