Commit 67254e3f authored by loislo@chromium.org's avatar loislo@chromium.org

TimelineFlameChart: process new records incrementally.

BUG=
R=pfeldman@chromium.org

Review URL: https://codereview.chromium.org/186553002

git-svn-id: svn://svn.chromium.org/blink/trunk@168387 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent bfd3abc5
...@@ -94,7 +94,7 @@ WebInspector.TimelineFlameChartDataProvider.prototype = { ...@@ -94,7 +94,7 @@ WebInspector.TimelineFlameChartDataProvider.prototype = {
reset: function() reset: function()
{ {
this._invalidate(); this._timelineData = null;
}, },
/** /**
...@@ -102,12 +102,7 @@ WebInspector.TimelineFlameChartDataProvider.prototype = { ...@@ -102,12 +102,7 @@ WebInspector.TimelineFlameChartDataProvider.prototype = {
*/ */
addRecord: function(record) addRecord: function(record)
{ {
this._invalidate(); WebInspector.TimelineModel.forAllRecords([record], this._appendRecord.bind(this));
},
_invalidate: function()
{
this._timelineData = null;
}, },
/** /**
...@@ -185,10 +180,11 @@ WebInspector.TimelineFlameChartDataProvider.prototype = { ...@@ -185,10 +180,11 @@ WebInspector.TimelineFlameChartDataProvider.prototype = {
*/ */
_appendRecord: function(record, depth) _appendRecord: function(record, depth)
{ {
var timelineData = this._timelineData; var timelineData = this.timelineData();
this._startTime = this._startTime ? Math.min(this._startTime, record.startTime) : record.startTime; this._startTime = this._startTime ? Math.min(this._startTime, record.startTime) : record.startTime;
var startTime = this._startTime; var startTime = this._startTime;
this._zeroTime = startTime;
var endTime = record.endTime || record.startTime - startTime; var endTime = record.endTime || record.startTime - startTime;
this._endTime = Math.max(this._endTime, endTime); this._endTime = Math.max(this._endTime, endTime);
this._totalTime = Math.max(1000, this._endTime - this._startTime); this._totalTime = Math.max(1000, this._endTime - this._startTime);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment