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

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

Issue 1211993002: DevTools: Refactor: Split timeline overview strips into components (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/timeline/TimelineEventOverview.js
diff --git a/Source/devtools/front_end/timeline/TimelineEventOverview.js b/Source/devtools/front_end/timeline/TimelineEventOverview.js
index 37d74677bc7de1e4d79336814e717e57facf11a1..502e16f386a59e0101ce318c9ae555665ac3009b 100644
--- a/Source/devtools/front_end/timeline/TimelineEventOverview.js
+++ b/Source/devtools/front_end/timeline/TimelineEventOverview.js
@@ -31,84 +31,111 @@
/**
* @constructor
* @extends {WebInspector.TimelineOverviewBase}
+ * @param {string} id
caseq 2015/06/26 15:53:47 nit: id -> class or name?
alph 2015/06/26 16:11:19 it's in fact part of id, not the class. so let me
* @param {!WebInspector.TimelineModel} model
- * @param {!WebInspector.TimelineFrameModelBase} frameModel
*/
-WebInspector.TimelineEventOverview = function(model, frameModel)
+WebInspector.TimelineEventOverview = function(id, model)
{
WebInspector.TimelineOverviewBase.call(this);
- this.element.id = "timeline-overview-events";
+ this.element.id = "timeline-overview-" + id;
+ this.element.classList.add("overview-strip");
this._model = model;
- this._frameModel = frameModel;
-
- this._fillStyles = {};
- var categories = WebInspector.TimelineUIUtils.categories();
- for (var category in categories) {
- this._fillStyles[category] = categories[category].fillColorStop1;
- categories[category].addEventListener(WebInspector.TimelineCategory.Events.VisibilityChanged, this._onCategoryVisibilityChanged, this);
- }
-
- this._disabledCategoryFillStyle = "hsl(0, 0%, 67%)";
}
-/** @const */
-WebInspector.TimelineEventOverview._fullStripHeight = 24;
-/** @const */
-WebInspector.TimelineEventOverview._smallStripHeight = 8;
-
WebInspector.TimelineEventOverview.prototype = {
/**
+ * @param {number} y
+ * @param {string} label
+ */
+ _drawHorizontalGuide: function(y, label)
+ {
+ var ctx = this._context;
+ ctx.save();
+ ctx.translate(0, y);
+ ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
+ ctx.beginPath();
+ ctx.moveTo(0, 0);
+ ctx.lineTo(this._canvas.width, 0);
+ ctx.strokeStyle = "hsl(0, 0%, 85%)";
+ ctx.setLineDash([3]);
+ ctx.lineWidth = 1;
+ ctx.stroke();
+ ctx.fillStyle = "hsl(0, 0%, 60%)";
+ ctx.font = "9px " + WebInspector.fontFamily();
+ ctx.fillText(label, 5, 9);
+ ctx.restore();
+ },
+
+ /**
+ * @param {number} begin
+ * @param {number} end
+ * @param {number} position
+ * @param {number} height
+ * @param {string} color
+ */
+ _renderBar: function(begin, end, position, height, color)
+ {
+ var x = begin;
+ var width = end - begin;
+ this._context.fillStyle = color;
+ this._context.fillRect(x, position, width, height);
+ },
+
+ /**
* @override
+ * @param {number} windowLeft
+ * @param {number} windowRight
+ * @return {!{startTime: number, endTime: number}}
*/
- dispose: function()
+ windowTimes: function(windowLeft, windowRight)
{
- WebInspector.TimelineOverviewBase.prototype.dispose.call(this);
- var categories = WebInspector.TimelineUIUtils.categories();
- for (var category in categories)
- categories[category].removeEventListener(WebInspector.TimelineCategory.Events.VisibilityChanged, this._onCategoryVisibilityChanged, this);
+ var absoluteMin = this._model.minimumRecordTime();
+ var timeSpan = this._model.maximumRecordTime() - absoluteMin;
+ return {
+ startTime: absoluteMin + timeSpan * windowLeft,
+ endTime: absoluteMin + timeSpan * windowRight
+ };
},
/**
* @override
+ * @param {number} startTime
+ * @param {number} endTime
+ * @return {!{left: number, right: number}}
*/
- update: function()
+ windowBoundaries: function(startTime, endTime)
{
- var /** @const */ fpsStripHeight = 20;
- this.resetCanvas();
- var threads = this._model.virtualThreads();
- var mainThreadEvents = this._model.mainThreadEvents();
- var networkHeight = this._canvas.clientHeight
- - WebInspector.TimelineEventOverview._fullStripHeight
- - fpsStripHeight
- - 3 * WebInspector.TimelineEventOverview._smallStripHeight;
- var position = 0;
- if (Runtime.experiments.isEnabled("inputEventsOnTimelineOverview")) {
- var inputHeight = this._drawInputEvents(mainThreadEvents, position, WebInspector.TimelineEventOverview._smallStripHeight);
- position += inputHeight;
- networkHeight -= inputHeight;
- }
- position += this._drawNetwork(mainThreadEvents, position, networkHeight);
- position += this._drawStackedUtilizationChart(mainThreadEvents, position, WebInspector.TimelineEventOverview._fullStripHeight);
- for (var thread of threads.filter(function(thread) { return !thread.isWorker(); }))
- this._drawEvents(thread.events, position, WebInspector.TimelineEventOverview._smallStripHeight);
- position += WebInspector.TimelineEventOverview._smallStripHeight;
- for (var thread of threads.filter(function(thread) { return thread.isWorker(); }))
- this._drawEvents(thread.events, position, WebInspector.TimelineEventOverview._smallStripHeight);
- position += WebInspector.TimelineEventOverview._smallStripHeight;
- position += this._drawResponsivenessStrip(position, WebInspector.TimelineEventOverview._smallStripHeight);
- position += this._drawFrames(position, fpsStripHeight);
- console.assert(position === this._canvas.clientHeight);
+ var absoluteMin = this._model.minimumRecordTime();
+ var timeSpan = this._model.maximumRecordTime() - absoluteMin;
+ var haveRecords = absoluteMin > 0;
+ return {
+ left: haveRecords && startTime ? Math.min((startTime - absoluteMin) / timeSpan, 1) : 0,
+ right: haveRecords && endTime < Infinity ? (endTime - absoluteMin) / timeSpan : 1
+ };
},
+ __proto__: WebInspector.TimelineOverviewBase.prototype
+}
+
+/**
+ * @constructor
+ * @extends {WebInspector.TimelineEventOverview}
+ * @param {!WebInspector.TimelineModel} model
+ */
+WebInspector.TimelineEventOverview.Input = function(model)
+{
+ WebInspector.TimelineEventOverview.call(this, "input", model);
+}
+
+WebInspector.TimelineEventOverview.Input.prototype = {
/**
- * @param {!Array.<!WebInspector.TracingModel.Event>} events
- * @param {number} position
- * @param {number} height
- * @return {number}
+ * @override
*/
- _drawInputEvents: function(events, position, height)
+ update: function()
{
- var /** @const */ padding = 1;
+ this.resetCanvas();
+ var events = this._model.mainThreadEvents();
+ var height = this._canvas.height;
var descriptors = WebInspector.TimelineUIUtils.eventDispatchDesciptors();
/** @type {!Map.<string,!WebInspector.TimelineUIUtils.EventDispatchTypeDescriptor>} */
var descriptorsByType = new Map();
@@ -119,14 +146,11 @@ WebInspector.TimelineEventOverview.prototype = {
maxPriority = Math.max(maxPriority, descriptor.priority);
}
- var devicePixelRatio = window.devicePixelRatio;
- var /** @const */ minWidth = 2 * devicePixelRatio;
- var stripHeight = (height - padding) * devicePixelRatio;
+ var /** @const */ minWidth = 2 * window.devicePixelRatio;
var timeOffset = this._model.minimumRecordTime();
var timeSpan = this._model.maximumRecordTime() - timeOffset;
var canvasWidth = this._canvas.width;
var scale = canvasWidth / timeSpan;
- position = (position + padding) * devicePixelRatio;
for (var priority = 0; priority <= maxPriority; ++priority) {
for (var i = 0; i < events.length; ++i) {
@@ -139,28 +163,37 @@ WebInspector.TimelineEventOverview.prototype = {
var start = Number.constrain(Math.floor((event.startTime - timeOffset) * scale), 0, canvasWidth);
var end = Number.constrain(Math.ceil((event.endTime - timeOffset) * scale), 0, canvasWidth);
var width = Math.max(end - start, minWidth);
- this._renderBar(start, start + width, position, stripHeight, descriptor.color);
+ this._renderBar(start, start + width, 0, height, descriptor.color);
}
}
-
- return height;
},
+ __proto__: WebInspector.TimelineEventOverview.prototype
+}
+
+/**
+ * @constructor
+ * @extends {WebInspector.TimelineEventOverview}
+ * @param {!WebInspector.TimelineModel} model
+ */
+WebInspector.TimelineEventOverview.Network = function(model)
+{
+ WebInspector.TimelineEventOverview.call(this, "network", model);
+}
+
+WebInspector.TimelineEventOverview.Network.prototype = {
/**
- * @param {!Array.<!WebInspector.TracingModel.Event>} events
- * @param {number} position
- * @param {number} height
- * @return {number}
+ * @override
*/
- _drawNetwork: function(events, position, height)
+ update: function()
{
- var /** @const */ padding = 1;
- var /** @const */ maxBandHeight = 4;
- position += padding;
- var devicePixelRatio = window.devicePixelRatio;
+ this.resetCanvas();
+ var events = this._model.mainThreadEvents();
+ var height = this._canvas.height;
+ var /** @const */ maxBandHeight = 4 * window.devicePixelRatio;
var bandsCount = WebInspector.TimelineUIUtils.calculateNetworkBandsCount(events);
- var bandInterval = Math.min(maxBandHeight, (height - padding) / (bandsCount || 1));
- var bandHeight = Math.ceil(bandInterval * devicePixelRatio);
+ var bandInterval = Math.min(maxBandHeight, height / (bandsCount || 1));
+ var bandHeight = Math.ceil(bandInterval);
var timeOffset = this._model.minimumRecordTime();
var timeSpan = this._model.maximumRecordTime() - timeOffset;
var canvasWidth = this._canvas.width;
@@ -174,7 +207,7 @@ WebInspector.TimelineEventOverview.prototype = {
* @param {number} startTime
* @param {number} endTime
* @param {?WebInspector.TracingModel.Event} event
- * @this {WebInspector.TimelineEventOverview}
+ * @this {WebInspector.TimelineEventOverview.Network}
*/
function drawBar(band, startTime, endTime, event)
{
@@ -183,27 +216,85 @@ WebInspector.TimelineEventOverview.prototype = {
var color = !event ||
event.name === WebInspector.TimelineModel.RecordType.ResourceReceiveResponse ||
event.name === WebInspector.TimelineModel.RecordType.ResourceSendRequest ? waitingColor : processingColor;
- this._renderBar(Math.floor(start), Math.ceil(end), Math.floor(devicePixelRatio * (position + band * bandInterval)), bandHeight, color);
+ this._renderBar(Math.floor(start), Math.ceil(end), Math.floor(band * bandInterval), bandHeight, color);
}
WebInspector.TimelineUIUtils.iterateNetworkRequestsInRoundRobin(events, bandsCount, drawBar.bind(this));
- return height;
},
+ __proto__: WebInspector.TimelineEventOverview.prototype
+}
+
+/**
+ * @constructor
+ * @extends {WebInspector.TimelineEventOverview}
+ * @param {string} id
+ * @param {!WebInspector.TimelineModel} model
+ */
+WebInspector.TimelineEventOverview.Thread = function(id, model)
+{
+ WebInspector.TimelineEventOverview.call(this, id, model)
+ this._fillStyles = {};
+ var categories = WebInspector.TimelineUIUtils.categories();
+ for (var category in categories) {
+ this._fillStyles[category] = categories[category].fillColorStop1;
+ categories[category].addEventListener(WebInspector.TimelineCategory.Events.VisibilityChanged, this._onCategoryVisibilityChanged, this);
+ }
+ this._disabledCategoryFillStyle = "hsl(0, 0%, 67%)";
+}
+
+WebInspector.TimelineEventOverview.Thread.prototype = {
/**
- * @param {!Array.<!WebInspector.TracingModel.Event>} events
- * @param {number} position
- * @param {number} height
- * @return {number}
+ * @override
+ */
+ dispose: function()
+ {
+ WebInspector.TimelineOverviewBase.prototype.dispose.call(this);
+ var categories = WebInspector.TimelineUIUtils.categories();
+ for (var category in categories)
+ categories[category].removeEventListener(WebInspector.TimelineCategory.Events.VisibilityChanged, this._onCategoryVisibilityChanged, this);
+ },
+
+ _onCategoryVisibilityChanged: function()
+ {
+ this.update();
+ },
+
+ /**
+ * @param {!WebInspector.TimelineCategory} category
+ * @return {string}
*/
- _drawStackedUtilizationChart: function(events, position, height)
+ _categoryColor: function(category)
{
+ return category.hidden ? this._disabledCategoryFillStyle : this._fillStyles[category.name];
+ },
+
+ __proto__: WebInspector.TimelineEventOverview.prototype
+}
+
+/**
+ * @constructor
+ * @extends {WebInspector.TimelineEventOverview.Thread}
+ * @param {!WebInspector.TimelineModel} model
+ */
+WebInspector.TimelineEventOverview.MainThread = function(model)
+{
+ WebInspector.TimelineEventOverview.Thread.call(this, "main-thread", model)
+}
+
+WebInspector.TimelineEventOverview.MainThread.prototype = {
+ /**
+ * @override
+ */
+ update: function()
+ {
+ this.resetCanvas();
+ var events = this._model.mainThreadEvents();
if (!events.length)
- return height;
+ return;
var /** @const */ quantSizePx = 4 * window.devicePixelRatio;
- var /** @const */ padding = 1;
- var visualHeight = (height - padding) * window.devicePixelRatio;
- var baseLine = (position + height) * window.devicePixelRatio;
+ var height = this._canvas.height;
+ var baseLine = height;
var timeOffset = this._model.minimumRecordTime();
var timeSpan = this._model.maximumRecordTime() - timeOffset;
var scale = this._canvas.width / timeSpan;
@@ -220,7 +311,7 @@ WebInspector.TimelineEventOverview.prototype = {
categories[categoryOrder[i]]._overviewIndex = i;
var categoryIndexStack = [];
- this._drawHorizontalGuide(baseLine - visualHeight + 0.5, WebInspector.UIString("100%"));
+ this._drawHorizontalGuide(baseLine - height + 0.5, WebInspector.UIString("100%"));
/**
* @param {!Array<number>} counters
@@ -232,7 +323,7 @@ WebInspector.TimelineEventOverview.prototype = {
for (var i = idleIndex + 1; i < counters.length; ++i) {
if (!counters[i])
continue;
- var h = counters[i] / quantTime * visualHeight;
+ var h = counters[i] / quantTime * height;
ctx.fillStyle = this._categoryColor(categories[categoryOrder[i]]);
ctx.fillRect(x, y - h, quantSizePx, h);
y -= h;
@@ -260,27 +351,44 @@ WebInspector.TimelineEventOverview.prototype = {
WebInspector.TimelineModel.forEachEvent(events, onEventStart, onEventEnd);
quantizer.appendInterval(timeOffset + timeSpan + quantTime, idleIndex); // Kick drawing the last bucket.
- return height;
},
+ __proto__: WebInspector.TimelineEventOverview.Thread.prototype
+}
+
+/**
+ * @constructor
+ * @extends {WebInspector.TimelineEventOverview.Thread}
+ * @param {!WebInspector.TimelineModel} model
+ */
+WebInspector.TimelineEventOverview.OtherThreads = function(model)
+{
+ WebInspector.TimelineEventOverview.Thread.call(this, "other-threads", model);
+}
+
+WebInspector.TimelineEventOverview.OtherThreads.prototype = {
/**
- * @param {!Array.<!WebInspector.TracingModel.Event>} events
- * @param {number} position
- * @param {number} stripHeight
- * @return {number}
+ * @override
*/
- _drawEvents: function(events, position, stripHeight)
+ update: function()
{
- var /** @const */ padding = 1;
- var visualHeight = (stripHeight - padding) * window.devicePixelRatio;
+ this.resetCanvas();
+ this._model.virtualThreads().forEach(this._drawThread.bind(this));
+ },
+
+ /**
+ * @param {!WebInspector.TimelineModel.VirtualThread} thread
+ */
+ _drawThread: function(thread)
+ {
+ var events = thread.events;
+ var height = this._canvas.height;
var timeOffset = this._model.minimumRecordTime();
var timeSpan = this._model.maximumRecordTime() - timeOffset;
var scale = this._canvas.width / timeSpan;
var ditherer = new WebInspector.Dithering();
var categoryStack = [];
var lastX = 0;
- position += padding;
- position *= window.devicePixelRatio;
/**
* @param {!WebInspector.TracingModel.Event} e
@@ -293,7 +401,7 @@ WebInspector.TimelineEventOverview.prototype = {
var category = categoryStack.peekLast();
var bar = ditherer.appendInterval(category, lastX, pos);
if (bar)
- this._renderBar(bar.start, bar.end, position, visualHeight, this._categoryColor(category));
+ this._renderBar(bar.start, bar.end, 0, height, this._categoryColor(category));
}
categoryStack.push(WebInspector.TimelineUIUtils.eventStyle(e).category);
lastX = pos;
@@ -309,77 +417,91 @@ WebInspector.TimelineEventOverview.prototype = {
var pos = (e.endTime - timeOffset) * scale;
var bar = ditherer.appendInterval(category, lastX, pos);
if (bar)
- this._renderBar(bar.start, bar.end, position, visualHeight, this._categoryColor(category));
+ this._renderBar(bar.start, bar.end, 0, height, this._categoryColor(category));
lastX = pos;
}
WebInspector.TimelineModel.forEachEvent(events, onEventStart.bind(this), onEventEnd.bind(this));
- return stripHeight;
},
- /**
- * @param {!WebInspector.TimelineCategory} category
- * @return {string}
- */
- _categoryColor: function(category)
- {
- return category.hidden ? this._disabledCategoryFillStyle : this._fillStyles[category.name];
- },
+ __proto__: WebInspector.TimelineEventOverview.Thread.prototype
+}
+/**
+ * @constructor
+ * @extends {WebInspector.TimelineEventOverview}
+ * @param {!WebInspector.TimelineModel} model
+ * @param {!WebInspector.TimelineFrameModelBase} frameModel
+ */
+WebInspector.TimelineEventOverview.Responsiveness = function(model, frameModel)
+{
+ WebInspector.TimelineEventOverview.call(this, "responsiveness", model)
+ this._frameModel = frameModel;
+}
+
+WebInspector.TimelineEventOverview.Responsiveness.prototype = {
/**
- * @param {number} position
- * @param {number} height
- * @return {number}
+ * @override
*/
- _drawResponsivenessStrip: function(position, height)
+ update: function()
{
- var /** @const */ padding = 1;
- var visualHeight = (height - padding) * window.devicePixelRatio;
+ this.resetCanvas();
+ var height = this._canvas.height;
var timeOffset = this._model.minimumRecordTime();
var timeSpan = this._model.maximumRecordTime() - timeOffset;
var scale = this._canvas.width / timeSpan;
var frames = this._frameModel.frames();
var ctx = this._context;
ctx.beginPath();
- var responsivenessStripY = (position + padding) * window.devicePixelRatio;
+ var responsivenessStripY = (0 + 0) * window.devicePixelRatio;
for (var i = 0; i < frames.length; ++i) {
var frame = frames[i];
if (!frame.hasWarnings())
continue;
var x = scale * (frame.startTime - timeOffset);
var w = scale * frame.duration;
- ctx.rect(x, responsivenessStripY, w, visualHeight);
+ ctx.rect(x, responsivenessStripY, w, height);
}
ctx.fillStyle = "hsl(0, 80%, 70%)";
ctx.fill();
- return height;
},
+ __proto__: WebInspector.TimelineEventOverview.prototype
+}
+
+/**
+ * @constructor
+ * @extends {WebInspector.TimelineEventOverview}
+ * @param {!WebInspector.TimelineModel} model
+ * @param {!WebInspector.TimelineFrameModelBase} frameModel
+ */
+WebInspector.TimelineEventOverview.Frames = function(model, frameModel)
+{
+ WebInspector.TimelineEventOverview.call(this, "framerate", model);
+ this._frameModel = frameModel;
+}
+
+WebInspector.TimelineEventOverview.Frames.prototype = {
/**
- * @param {number} position
- * @param {number} height
- * @return {number}
+ * @override
*/
- _drawFrames: function(position, height)
+ update: function()
{
- var /** @const */ padding = 2;
+ this.resetCanvas();
+ var height = this._canvas.height;
+ var /** @const */ padding = 1 * window.devicePixelRatio;
var /** @const */ baseFrameDurationMs = 1e3 / 60;
- var visualHeight = (height - padding) * window.devicePixelRatio;
+ var visualHeight = height - 2 * padding;
var timeOffset = this._model.minimumRecordTime();
var timeSpan = this._model.maximumRecordTime() - timeOffset;
var scale = this._canvas.width / timeSpan;
var frames = this._frameModel.frames();
- var baseY = height * window.devicePixelRatio;
+ var baseY = height - padding;
var ctx = this._context;
- var y = baseY + 10;
+ var bottomY = baseY + 10 * window.devicePixelRatio;
+ var y = bottomY;
if (!frames.length)
- return height;
-
- ctx.save();
- ctx.translate(0, position * window.devicePixelRatio);
- ctx.beginPath();
- ctx.rect(0, 0, this._canvas.width, height * window.devicePixelRatio);
- ctx.clip();
+ return;
this._drawHorizontalGuide(baseY - visualHeight - 0.5, WebInspector.UIString("60\u2009fps"));
@@ -393,7 +515,7 @@ WebInspector.TimelineEventOverview.prototype = {
var x = Math.round((frame.startTime - timeOffset) * scale) + offset;
ctx.lineTo(x, y);
ctx.lineTo(x, y + tickDepth);
- y = frame.idle ? baseY + 1 : Math.round(baseY - visualHeight * Math.min(baseFrameDurationMs / frame.duration, 1)) - offset;
+ y = frame.idle ? bottomY : Math.round(baseY - visualHeight * Math.min(baseFrameDurationMs / frame.duration, 1)) - offset;
ctx.lineTo(x, y + tickDepth);
ctx.lineTo(x, y);
}
@@ -402,93 +524,15 @@ WebInspector.TimelineEventOverview.prototype = {
var x = Math.round((lastFrame.startTime + lastFrame.duration - timeOffset) * scale) + offset;
ctx.lineTo(x, y);
}
- ctx.lineTo(x, baseY + 10);
+ ctx.lineTo(x, bottomY);
ctx.fillStyle = "hsl(110, 50%, 88%)";
ctx.strokeStyle = "hsl(110, 50%, 60%)";
ctx.lineWidth = lineWidth;
ctx.fill();
ctx.stroke();
- ctx.restore();
- return height;
- },
-
- /**
- * @param {number} y
- * @param {string} label
- */
- _drawHorizontalGuide: function(y, label)
- {
- var ctx = this._context;
- ctx.save();
- ctx.translate(0, y);
- ctx.scale(window.devicePixelRatio, window.devicePixelRatio);
- ctx.beginPath();
- ctx.moveTo(0, 0);
- ctx.lineTo(this._canvas.width, 0);
- ctx.strokeStyle = "hsl(0, 0%, 85%)";
- ctx.setLineDash([3]);
- ctx.lineWidth = 1;
- ctx.stroke();
- ctx.fillStyle = "hsl(0, 0%, 70%)";
- ctx.font = "9px " + WebInspector.fontFamily();
- ctx.fillText(label, 4, 9);
- ctx.restore();
- },
-
- _onCategoryVisibilityChanged: function()
- {
- this.update();
- },
-
- /**
- * @param {number} begin
- * @param {number} end
- * @param {number} position
- * @param {number} height
- * @param {string} color
- */
- _renderBar: function(begin, end, position, height, color)
- {
- var x = begin;
- var width = end - begin;
- this._context.fillStyle = color;
- this._context.fillRect(x, position, width, height);
- },
-
- /**
- * @override
- * @param {number} windowLeft
- * @param {number} windowRight
- * @return {!{startTime: number, endTime: number}}
- */
- windowTimes: function(windowLeft, windowRight)
- {
- var absoluteMin = this._model.minimumRecordTime();
- var timeSpan = this._model.maximumRecordTime() - absoluteMin;
- return {
- startTime: absoluteMin + timeSpan * windowLeft,
- endTime: absoluteMin + timeSpan * windowRight
- };
},
- /**
- * @override
- * @param {number} startTime
- * @param {number} endTime
- * @return {!{left: number, right: number}}
- */
- windowBoundaries: function(startTime, endTime)
- {
- var absoluteMin = this._model.minimumRecordTime();
- var timeSpan = this._model.maximumRecordTime() - absoluteMin;
- var haveRecords = absoluteMin > 0;
- return {
- left: haveRecords && startTime ? Math.min((startTime - absoluteMin) / timeSpan, 1) : 0,
- right: haveRecords && endTime < Infinity ? (endTime - absoluteMin) / timeSpan : 1
- };
- },
-
- __proto__: WebInspector.TimelineOverviewBase.prototype
+ __proto__: WebInspector.TimelineEventOverview.prototype
}
/**
« no previous file with comments | « no previous file | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698