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.TimelineUIUtilsImpl = function() | 9 WebInspector.TimelineUIUtilsImpl = function() |
10 { | 10 { |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 * @param {number} lineNumber | 403 * @param {number} lineNumber |
404 * @param {number=} columnNumber | 404 * @param {number=} columnNumber |
405 */ | 405 */ |
406 function linkifyLocation(scriptId, url, lineNumber, columnNumber) | 406 function linkifyLocation(scriptId, url, lineNumber, columnNumber) |
407 { | 407 { |
408 if (!url) | 408 if (!url) |
409 return null; | 409 return null; |
410 | 410 |
411 // FIXME(62725): stack trace line/column numbers are one-based. | 411 // FIXME(62725): stack trace line/column numbers are one-based. |
412 columnNumber = columnNumber ? columnNumber - 1 : 0; | 412 columnNumber = columnNumber ? columnNumber - 1 : 0; |
413 return linkifier.linkifyLocationByScriptId(record.target(), scriptId, ur
l, lineNumber - 1, columnNumber, "timeline-details"); | 413 return linkifier.linkifyScriptLocation(record.target(), scriptId, url, l
ineNumber - 1, columnNumber, "timeline-details"); |
414 } | 414 } |
415 | 415 |
416 /** | 416 /** |
417 * @param {!ConsoleAgent.CallFrame} callFrame | |
418 */ | |
419 function linkifyCallFrame(callFrame) | |
420 { | |
421 return linkifyLocation(callFrame.scriptId, callFrame.url, callFrame.line
Number, callFrame.columnNumber); | |
422 } | |
423 | |
424 /** | |
425 * @return {?Element} | 417 * @return {?Element} |
426 */ | 418 */ |
427 function linkifyTopCallFrame() | 419 function linkifyTopCallFrame() |
428 { | 420 { |
429 if (record.stackTrace()) | 421 if (record.stackTrace()) |
430 return linkifyCallFrame(record.stackTrace()[0]); | 422 return linkifier.linkifyConsoleCallFrame(record.target(), record.sta
ckTrace()[0], "timeline-details"); |
431 if (record.callSiteStackTrace()) | 423 if (record.callSiteStackTrace()) |
432 return linkifyCallFrame(record.callSiteStackTrace()[0]); | 424 return linkifier.linkifyConsoleCallFrame(record.target(), record.cal
lSiteStackTrace()[0], "timeline-details"); |
433 return null; | 425 return null; |
434 } | 426 } |
435 } | 427 } |
436 | 428 |
437 /** | 429 /** |
438 * @param {string=} recordType | 430 * @param {string=} recordType |
439 * @return {boolean} | 431 * @return {boolean} |
440 */ | 432 */ |
441 WebInspector.TimelineUIUtilsImpl._needsPreviewElement = function(recordType) | 433 WebInspector.TimelineUIUtilsImpl._needsPreviewElement = function(recordType) |
442 { | 434 { |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 else if (recordType === recordTypes.TimeStamp) | 675 else if (recordType === recordTypes.TimeStamp) |
684 eventDivider.className += " resources-orange-divider"; | 676 eventDivider.className += " resources-orange-divider"; |
685 else if (recordType === recordTypes.BeginFrame) | 677 else if (recordType === recordTypes.BeginFrame) |
686 eventDivider.className += " timeline-frame-divider"; | 678 eventDivider.className += " timeline-frame-divider"; |
687 | 679 |
688 if (title) | 680 if (title) |
689 eventDivider.title = title; | 681 eventDivider.title = title; |
690 | 682 |
691 return eventDivider; | 683 return eventDivider; |
692 } | 684 } |
OLD | NEW |