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

Unified Diff: Source/devtools/front_end/TimelineFlameChart.js

Issue 186553002: TimelineFlameChart: process new records incrementally. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: test was fixed Created 6 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/TimelineFlameChart.js
diff --git a/Source/devtools/front_end/TimelineFlameChart.js b/Source/devtools/front_end/TimelineFlameChart.js
index 450642d2be4997febacf00cbe9028c588e99fc03..ac9a638ce47295edb096d5d23e05d7a7f72633f9 100644
--- a/Source/devtools/front_end/TimelineFlameChart.js
+++ b/Source/devtools/front_end/TimelineFlameChart.js
@@ -94,7 +94,7 @@ WebInspector.TimelineFlameChartDataProvider.prototype = {
reset: function()
{
- this._invalidate();
+ this._timelineData = null;
},
/**
@@ -102,12 +102,7 @@ WebInspector.TimelineFlameChartDataProvider.prototype = {
*/
addRecord: function(record)
{
- this._invalidate();
- },
-
- _invalidate: function()
- {
- this._timelineData = null;
+ WebInspector.TimelineModel.forAllRecords([record], this._appendRecord.bind(this));
},
/**
@@ -185,10 +180,11 @@ WebInspector.TimelineFlameChartDataProvider.prototype = {
*/
_appendRecord: function(record, depth)
{
- var timelineData = this._timelineData;
+ var timelineData = this.timelineData();
this._startTime = this._startTime ? Math.min(this._startTime, record.startTime) : record.startTime;
var startTime = this._startTime;
+ this._zeroTime = startTime;
var endTime = record.endTime || record.startTime - startTime;
this._endTime = Math.max(this._endTime, endTime);
this._totalTime = Math.max(1000, this._endTime - this._startTime);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698