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

Unified Diff: Source/devtools/front_end/timeline/TimelineView.js

Issue 1315373005: DevTools: remove most convenience wrappers from WI.TimelineModel.Record (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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: Source/devtools/front_end/timeline/TimelineView.js
diff --git a/Source/devtools/front_end/timeline/TimelineView.js b/Source/devtools/front_end/timeline/TimelineView.js
index d7a2f033f8233e63c4f5366aecab0576b27efc0d..448c76f556da986d4d96e1e65ff9d55a50718e02 100644
--- a/Source/devtools/front_end/timeline/TimelineView.js
+++ b/Source/devtools/front_end/timeline/TimelineView.js
@@ -139,7 +139,7 @@ WebInspector.TimelineView.prototype = {
var dividerPosition = Math.round(position);
if (dividerPosition < 0 || dividerPosition >= clientWidth || dividers.has(dividerPosition))
continue;
- dividers.set(dividerPosition, WebInspector.TimelineUIUtils.createDividerForRecord(record, dividerPosition));
+ dividers.set(dividerPosition, WebInspector.TimelineUIUtils.createDividerForRecord(record, this._calculator.zeroTime(), dividerPosition));
}
this._timelineGrid.addEventDividers(dividers.valuesArray());
},
@@ -333,7 +333,7 @@ WebInspector.TimelineView.prototype = {
var aggregatedStats = {};
var presentationChildren = presentationRecord.presentationChildren();
for (var i = 0; i < presentationChildren.length; ++i)
- WebInspector.TimelineUIUtils.aggregateTimeForRecord(aggregatedStats, presentationChildren[i].record());
+ WebInspector.TimelineUIUtils.aggregateTimeForRecord(aggregatedStats, this._model, presentationChildren[i].record());
var idle = presentationRecord.endTime() - presentationRecord.startTime();
for (var category in aggregatedStats)
idle -= aggregatedStats[category];
@@ -658,13 +658,15 @@ WebInspector.TimelineView.prototype = {
if (task.startTime() > endTime)
break;
+ var data = task.traceEvent().args["data"];
+ var foreign = data && data["foreign"];
var left = Math.max(0, this._calculator.computePosition(task.startTime()) + barOffset - widthAdjustment);
var right = Math.min(width, this._calculator.computePosition(task.endTime() || 0) + barOffset + widthAdjustment);
if (lastElement) {
var gap = Math.floor(left) - Math.ceil(lastRight);
if (gap < minGap) {
- if (!task.data["foreign"])
+ if (!foreign)
lastElement.classList.remove(foreignStyle);
lastRight = right;
lastElement._tasksInfo.lastTaskIndex = taskIndex;
@@ -677,7 +679,7 @@ WebInspector.TimelineView.prototype = {
element = container.createChild("div", "timeline-graph-bar");
element.style.left = left + "px";
element._tasksInfo = {name: name, tasks: tasks, firstTaskIndex: taskIndex, lastTaskIndex: taskIndex};
- if (task.data["foreign"])
+ if (foreign)
element.classList.add(foreignStyle);
lastLeft = left;
lastRight = right;

Powered by Google App Engine
This is Rietveld 408576698