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

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

Issue 342473003: Use isProgram method to detect Program events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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
Index: Source/devtools/front_end/timeline/TimelinePresentationModel.js
diff --git a/Source/devtools/front_end/timeline/TimelinePresentationModel.js b/Source/devtools/front_end/timeline/TimelinePresentationModel.js
index b1bddb0853f5f1a7cad9eced0fbb4248108e8cd6..476d16014265e9c6aebdcdd02a1c5b7c14e97a16 100644
--- a/Source/devtools/front_end/timeline/TimelinePresentationModel.js
+++ b/Source/devtools/front_end/timeline/TimelinePresentationModel.js
@@ -88,14 +88,13 @@ WebInspector.TimelinePresentationModel.prototype = {
*/
addRecord: function(record)
{
- var records;
- if (record.type() === WebInspector.TimelineModel.RecordType.Program)
- records = record.children();
- else
- records = [record];
-
- for (var i = 0; i < records.length; ++i)
- this._innerAddRecord(this._rootRecord, records[i]);
+ if (record.isProgram()) {
+ var records = record.children();
+ for (var i = 0; i < records.length; ++i)
+ this._innerAddRecord(this._rootRecord, records[i]);
+ } else {
+ this._innerAddRecord(this._rootRecord, record);
+ }
},
/**
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineModelImpl.js ('k') | Source/devtools/front_end/timeline/TracingTimelineModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698