Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChart.js

Issue 2486853002: Timeline: remove TimelineModel inferred properties from TracingModel.Event (Closed)
Patch Set: addressed comments and rebased Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 /** @type {!WebInspector.TimelineIRModel.Phases} */ (this._entryData[e ntryIndex])); 707 /** @type {!WebInspector.TimelineIRModel.Phases} */ (this._entryData[e ntryIndex]));
708 context.fillStyle = color; 708 context.fillStyle = color;
709 context.fillRect(barX, barY, barWidth - 1, 2); 709 context.fillRect(barX, barY, barWidth - 1, 2);
710 context.fillRect(barX, barY - 3, 2, 3); 710 context.fillRect(barX, barY - 3, 2, 3);
711 context.fillRect(barX + barWidth - 3, barY - 3, 2, 3); 711 context.fillRect(barX + barWidth - 3, barY - 3, 2, 3);
712 return false; 712 return false;
713 } 713 }
714 714
715 if (type === WebInspector.TimelineFlameChartEntryType.Event) { 715 if (type === WebInspector.TimelineFlameChartEntryType.Event) {
716 var event = /** @type {!WebInspector.TracingModel.Event} */ (this._entryDa ta[entryIndex]); 716 var event = /** @type {!WebInspector.TracingModel.Event} */ (this._entryDa ta[entryIndex]);
717 if (event.hasCategory(WebInspector.TimelineModel.Category.LatencyInfo) && event.timeWaitingForMainThread) { 717 if (event.hasCategory(WebInspector.TimelineModel.Category.LatencyInfo)) {
718 context.fillStyle = 'hsla(0, 70%, 60%, 1)'; 718 var timeWaitingForMainThread = WebInspector.TimelineData.forEvent(event) .timeWaitingForMainThread;
719 var width = Math.floor(unclippedBarX - barX + event.timeWaitingForMainTh read * timeToPixels); 719 if (timeWaitingForMainThread) {
720 context.fillRect(barX, barY + barHeight - 3, width, 2); 720 context.fillStyle = 'hsla(0, 70%, 60%, 1)';
721 var width = Math.floor(unclippedBarX - barX + timeWaitingForMainThread * timeToPixels);
722 context.fillRect(barX, barY + barHeight - 3, width, 2);
723 }
721 } 724 }
722 if (event.warning) 725 if (WebInspector.TimelineData.forEvent(event).warning)
723 paintWarningDecoration(barX, barWidth - 1.5); 726 paintWarningDecoration(barX, barWidth - 1.5);
724 } 727 }
725 728
726 /** 729 /**
727 * @param {number} x 730 * @param {number} x
728 * @param {number} width 731 * @param {number} width
729 */ 732 */
730 function paintWarningDecoration(x, width) { 733 function paintWarningDecoration(x, width) {
731 var /** @const */ triangleSize = 8; 734 var /** @const */ triangleSize = 8;
732 context.save(); 735 context.save();
(...skipping 14 matching lines...) Expand all
747 750
748 /** 751 /**
749 * @override 752 * @override
750 * @param {number} entryIndex 753 * @param {number} entryIndex
751 * @return {boolean} 754 * @return {boolean}
752 */ 755 */
753 forceDecoration(entryIndex) { 756 forceDecoration(entryIndex) {
754 var type = this._entryType(entryIndex); 757 var type = this._entryType(entryIndex);
755 return type === WebInspector.TimelineFlameChartEntryType.Frame || 758 return type === WebInspector.TimelineFlameChartEntryType.Frame ||
756 type === WebInspector.TimelineFlameChartEntryType.Event && 759 type === WebInspector.TimelineFlameChartEntryType.Event &&
757 !!(/** @type {!WebInspector.TracingModel.Event} */ (this._entryData[entr yIndex]).warning); 760 !!WebInspector.TimelineData.forEvent(/** @type {!WebInspector.TracingMod el.Event} */ (this._entryData[entryIndex])).warning;
758 } 761 }
759 762
760 /** 763 /**
761 * @param {string} title 764 * @param {string} title
762 * @param {!WebInspector.FlameChart.GroupStyle} style 765 * @param {!WebInspector.FlameChart.GroupStyle} style
763 * @param {boolean=} expanded 766 * @param {boolean=} expanded
764 */ 767 */
765 _appendHeader(title, style, expanded) { 768 _appendHeader(title, style, expanded) {
766 this._timelineData.groups.push({startLevel: this._currentLevel, name: title, expanded: expanded, style: style}); 769 this._timelineData.groups.push({startLevel: this._currentLevel, name: title, expanded: expanded, style: style});
767 } 770 }
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 WebInspector.TimelineFlameChartView.Selection = class { 1483 WebInspector.TimelineFlameChartView.Selection = class {
1481 /** 1484 /**
1482 * @param {!WebInspector.TimelineSelection} selection 1485 * @param {!WebInspector.TimelineSelection} selection
1483 * @param {number} entryIndex 1486 * @param {number} entryIndex
1484 */ 1487 */
1485 constructor(selection, entryIndex) { 1488 constructor(selection, entryIndex) {
1486 this.timelineSelection = selection; 1489 this.timelineSelection = selection;
1487 this.entryIndex = entryIndex; 1490 this.entryIndex = entryIndex;
1488 } 1491 }
1489 }; 1492 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698