OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
454 this._target = target; | 454 this._target = target; |
455 this._font = "12px " + WebInspector.fontFamily(); | 455 this._font = "12px " + WebInspector.fontFamily(); |
456 this._linkifier = new WebInspector.Linkifier(); | 456 this._linkifier = new WebInspector.Linkifier(); |
457 this._palette = new WebInspector.TraceViewPalette(); | 457 this._palette = new WebInspector.TraceViewPalette(); |
458 this._entryIndexToTitle = {}; | 458 this._entryIndexToTitle = {}; |
459 this._filters = []; | 459 this._filters = []; |
460 this.addFilter(WebInspector.TracingTimelineUIUtils.hiddenEventsFilter()); | 460 this.addFilter(WebInspector.TracingTimelineUIUtils.hiddenEventsFilter()); |
461 this.addFilter(new WebInspector.TracingTimelineModel.ExclusiveEventNameFilte r([WebInspector.TracingTimelineModel.RecordType.Program])); | 461 this.addFilter(new WebInspector.TracingTimelineModel.ExclusiveEventNameFilte r([WebInspector.TracingTimelineModel.RecordType.Program])); |
462 } | 462 } |
463 | 463 |
464 WebInspector.TracingBasedTimelineFlameChartDataProvider.InstantEventVisibleDurat ion = 0.01; | |
yurys
2014/07/17 14:32:40
InstantEventVisibleDurationMs
alph
2014/07/17 15:48:43
Done.
| |
465 | |
464 WebInspector.TracingBasedTimelineFlameChartDataProvider.prototype = { | 466 WebInspector.TracingBasedTimelineFlameChartDataProvider.prototype = { |
465 /** | 467 /** |
466 * @return {number} | 468 * @return {number} |
467 */ | 469 */ |
468 barHeight: function() | 470 barHeight: function() |
469 { | 471 { |
470 return 20; | 472 return 20; |
471 }, | 473 }, |
472 | 474 |
473 /** | 475 /** |
(...skipping 25 matching lines...) Expand all Loading... | |
499 * @param {number} entryIndex | 501 * @param {number} entryIndex |
500 * @return {?string} | 502 * @return {?string} |
501 */ | 503 */ |
502 entryTitle: function(entryIndex) | 504 entryTitle: function(entryIndex) |
503 { | 505 { |
504 var event = this._entryEvents[entryIndex]; | 506 var event = this._entryEvents[entryIndex]; |
505 if (event) { | 507 if (event) { |
506 var name = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(ev ent.name).title; | 508 var name = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(ev ent.name).title; |
507 // TODO(yurys): support event dividers | 509 // TODO(yurys): support event dividers |
508 var details = WebInspector.TracingTimelineUIUtils.buildDetailsNodeFo rTraceEvent(event, this._linkifier, false, this._target); | 510 var details = WebInspector.TracingTimelineUIUtils.buildDetailsNodeFo rTraceEvent(event, this._linkifier, false, this._target); |
511 if (event.name === WebInspector.TracingTimelineModel.RecordType.JSFr ame && details) | |
512 return details.textContent; | |
509 return details ? WebInspector.UIString("%s (%s)", name, details.text Content) : name; | 513 return details ? WebInspector.UIString("%s (%s)", name, details.text Content) : name; |
510 } | 514 } |
511 var title = this._entryIndexToTitle[entryIndex]; | 515 var title = this._entryIndexToTitle[entryIndex]; |
512 if (!title) { | 516 if (!title) { |
513 title = WebInspector.UIString("Unexpected entryIndex %d", entryIndex ); | 517 title = WebInspector.UIString("Unexpected entryIndex %d", entryIndex ); |
514 console.error(title); | 518 console.error(title); |
515 } | 519 } |
516 return title; | 520 return title; |
517 }, | 521 }, |
518 | 522 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
653 | 657 |
654 /** | 658 /** |
655 * @param {number} entryIndex | 659 * @param {number} entryIndex |
656 * @return {string} | 660 * @return {string} |
657 */ | 661 */ |
658 entryColor: function(entryIndex) | 662 entryColor: function(entryIndex) |
659 { | 663 { |
660 var event = this._entryEvents[entryIndex]; | 664 var event = this._entryEvents[entryIndex]; |
661 if (!event) | 665 if (!event) |
662 return "#555"; | 666 return "#555"; |
667 if (event.name === WebInspector.TracingTimelineModel.RecordType.JSFrame) | |
668 return WebInspector.TimelineFlameChartDataProvider.jsFrameColorGener ator().colorForID(event.args.data["functionName"]); | |
663 var style = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(event .name); | 669 var style = WebInspector.TracingTimelineUIUtils.styleForTraceEvent(event .name); |
664 return style.category.fillColorStop1; | 670 return style.category.fillColorStop1; |
665 }, | 671 }, |
666 | 672 |
667 /** | 673 /** |
668 * @param {number} entryIndex | 674 * @param {number} entryIndex |
669 * @param {!CanvasRenderingContext2D} context | 675 * @param {!CanvasRenderingContext2D} context |
670 * @param {?string} text | 676 * @param {?string} text |
671 * @param {number} barX | 677 * @param {number} barX |
672 * @param {number} barY | 678 * @param {number} barY |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
730 * @param {number} entryIndex | 736 * @param {number} entryIndex |
731 * @return {?{startTime: number, endTime: number}} | 737 * @return {?{startTime: number, endTime: number}} |
732 */ | 738 */ |
733 highlightTimeRange: function(entryIndex) | 739 highlightTimeRange: function(entryIndex) |
734 { | 740 { |
735 var event = this._entryEvents[entryIndex]; | 741 var event = this._entryEvents[entryIndex]; |
736 if (!event) | 742 if (!event) |
737 return null; | 743 return null; |
738 return { | 744 return { |
739 startTime: event.startTime, | 745 startTime: event.startTime, |
740 endTime: event.endTime | 746 endTime: event.endTime || event.startTime + WebInspector.TracingBase dTimelineFlameChartDataProvider.InstantEventVisibleDuration |
741 } | 747 } |
742 }, | 748 }, |
743 | 749 |
744 /** | 750 /** |
745 * @return {number} | 751 * @return {number} |
746 */ | 752 */ |
747 paddingLeft: function() | 753 paddingLeft: function() |
748 { | 754 { |
749 return 0; | 755 return 0; |
750 }, | 756 }, |
(...skipping 23 matching lines...) Expand all Loading... | |
774 | 780 |
775 /** | 781 /** |
776 * @param {!WebInspector.TracingModel.Event} event | 782 * @param {!WebInspector.TracingModel.Event} event |
777 * @param {number} level | 783 * @param {number} level |
778 */ | 784 */ |
779 _appendEvent: function(event, level) | 785 _appendEvent: function(event, level) |
780 { | 786 { |
781 var index = this._entryEvents.length; | 787 var index = this._entryEvents.length; |
782 this._entryEvents.push(event); | 788 this._entryEvents.push(event); |
783 this._timelineData.entryLevels[index] = level; | 789 this._timelineData.entryLevels[index] = level; |
784 this._timelineData.entryTotalTimes[index] = event.duration || 1; | 790 this._timelineData.entryTotalTimes[index] = event.duration || WebInspect or.TracingBasedTimelineFlameChartDataProvider.InstantEventVisibleDuration; |
785 this._timelineData.entryStartTimes[index] = event.startTime; | 791 this._timelineData.entryStartTimes[index] = event.startTime; |
786 }, | 792 }, |
787 | 793 |
788 /** | 794 /** |
789 * @param {number} entryIndex | 795 * @param {number} entryIndex |
790 * @return {?WebInspector.TimelineSelection} | 796 * @return {?WebInspector.TimelineSelection} |
791 */ | 797 */ |
792 createSelection: function(entryIndex) | 798 createSelection: function(entryIndex) |
793 { | 799 { |
794 var event = this._entryEvents[entryIndex]; | 800 var event = this._entryEvents[entryIndex]; |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1012 * @param {number} entryIndex | 1018 * @param {number} entryIndex |
1013 * @return {?WebInspector.TimelineSelection} | 1019 * @return {?WebInspector.TimelineSelection} |
1014 */ | 1020 */ |
1015 createSelection: function(entryIndex) { }, | 1021 createSelection: function(entryIndex) { }, |
1016 /** | 1022 /** |
1017 * @param {?WebInspector.TimelineSelection} selection | 1023 * @param {?WebInspector.TimelineSelection} selection |
1018 * @return {number} | 1024 * @return {number} |
1019 */ | 1025 */ |
1020 entryIndexForSelection: function(selection) { } | 1026 entryIndexForSelection: function(selection) { } |
1021 } | 1027 } |
OLD | NEW |