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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js

Issue 2782953002: DevTools: Make EntryHighlighted an event rather than method on data provider (Closed)
Patch Set: clean up Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js
index 871e27f00f0b4322d3c60a42ec68adea257ab234..296742004b644557735756968026e8b5259ca228 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineFlameChartDataProvider.js
@@ -504,25 +504,6 @@ Timeline.TimelineFlameChartDataProvider = class {
/**
* @override
* @param {number} entryIndex
- */
- highlightEntry(entryIndex) {
- SDK.DOMModel.hideDOMNodeHighlight();
- if (this._entryType(entryIndex) !== Timeline.TimelineFlameChartEntryType.Event)
- return;
- var event = /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]);
- var target = this._model.targetByEvent(event);
- if (!target)
- return;
- var timelineData = TimelineModel.TimelineData.forEvent(event);
- var backendNodeId = timelineData.backendNodeId;
- if (!backendNodeId)
- return;
- new SDK.DeferredDOMNode(target, backendNodeId).highlight();
- }
-
- /**
- * @override
- * @param {number} entryIndex
* @return {string}
*/
entryColor(entryIndex) {
@@ -883,13 +864,11 @@ Timeline.TimelineFlameChartDataProvider = class {
if (this._lastInitiatorEntry === entryIndex)
return false;
this._lastInitiatorEntry = entryIndex;
- var event = this._entryType(entryIndex) === Timeline.TimelineFlameChartEntryType.Event ?
- /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]) :
- null;
- var td = this._timelineData;
+ var event = this.eventByIndex(entryIndex);
var initiator = event && TimelineModel.TimelineData.forEvent(event).initiator();
if (initiator && !this._isVisible(initiator))
initiator = null;
+ var td = this._timelineData;
if (td.flowStartTimes.length || initiator) {
td.flowStartTimes = [];
td.flowStartLevels = [];
@@ -906,6 +885,16 @@ Timeline.TimelineFlameChartDataProvider = class {
td.flowEndLevels.push(td.entryLevels[eventIndex]);
return true;
}
+
+ /**
+ * @param {number} entryIndex
+ * @return {?SDK.TracingModel.Event}
+ */
+ eventByIndex(entryIndex) {
+ return this._entryType(entryIndex) === Timeline.TimelineFlameChartEntryType.Event ?
+ /** @type {!SDK.TracingModel.Event} */ (this._entryData[entryIndex]) :
+ null;
+ }
};
Timeline.TimelineFlameChartDataProvider.InstantEventVisibleDurationMs = 0.001;

Powered by Google App Engine
This is Rietveld 408576698