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

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

Issue 2313093004: Timeline: always create filmstrip model and share single instance of it (Closed)
Patch Set: Timeline: always create filmstrip model Created 4 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: third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
index 18c519f991c79a99b35a34fbef31934127bb468f..cae97c9a73d2c530ebcc7d63f2df4fdc6a1e84cc 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
@@ -432,12 +432,12 @@ WebInspector.TimelineEventOverview.Responsiveness.prototype = {
* @constructor
* @extends {WebInspector.TimelineEventOverview}
* @param {!WebInspector.TimelineModel} model
- * @param {!WebInspector.TracingModel} tracingModel
+ * @param {!WebInspector.FilmStripModel} filmStripModel
*/
-WebInspector.TimelineFilmStripOverview = function(model, tracingModel)
+WebInspector.TimelineFilmStripOverview = function(model, filmStripModel)
{
WebInspector.TimelineEventOverview.call(this, "filmstrip", null, model);
- this._tracingModel = tracingModel;
+ this._filmStripModel = filmStripModel;
this.reset();
}
@@ -450,8 +450,6 @@ WebInspector.TimelineFilmStripOverview.prototype = {
update: function()
{
WebInspector.TimelineEventOverview.prototype.update.call(this);
- if (!this._filmStripModel)
- return;
var frames = this._filmStripModel.frames();
if (!frames.length)
return;
@@ -503,14 +501,14 @@ WebInspector.TimelineFilmStripOverview.prototype = {
*/
_drawFrames: function(imageWidth, imageHeight)
{
- if (!this._filmStripModel || !imageWidth)
+ if (!imageWidth)
return;
if (!this._filmStripModel.frames().length)
return;
var padding = WebInspector.TimelineFilmStripOverview.Padding;
var width = this._canvas.width;
- var zeroTime = this._tracingModel.minimumRecordTime();
- var spanTime = this._tracingModel.maximumRecordTime() - zeroTime;
+ var zeroTime = this._filmStripModel.zeroTime();
+ var spanTime = this._filmStripModel.spanTime();
var scale = spanTime / width;
var context = this._canvas.getContext("2d");
var drawGeneration = this._drawGeneration;
@@ -548,7 +546,7 @@ WebInspector.TimelineFilmStripOverview.prototype = {
*/
popoverElementPromise: function(x)
{
- if (!this._filmStripModel || !this._filmStripModel.frames().length)
+ if (!this._filmStripModel.frames().length)
return Promise.resolve(/** @type {?Element} */ (null));
var time = this._calculator.positionToTime(x);
@@ -581,7 +579,6 @@ WebInspector.TimelineFilmStripOverview.prototype = {
{
this._lastFrame = undefined;
this._lastElement = null;
- this._filmStripModel = new WebInspector.FilmStripModel(this._tracingModel);
/** @type {!Map<!WebInspector.FilmStripModel.Frame,!Promise<!HTMLImageElement>>} */
this._frameToImagePromise = new Map();
this._imageWidth = 0;

Powered by Google App Engine
This is Rietveld 408576698