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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineModel.js

Issue 1211613002: Timeline: check category presence in list, not string equality (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed tracing-session-id.html 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 data: function() 354 data: function()
355 { 355 {
356 return this._event.args["data"]; 356 return this._event.args["data"];
357 }, 357 },
358 358
359 /** 359 /**
360 * @return {string} 360 * @return {string}
361 */ 361 */
362 type: function() 362 type: function()
363 { 363 {
364 if (this._event.category === WebInspector.TracingModel.ConsoleEventCateg ory) 364 if (this._event.hasCategory(WebInspector.TracingModel.ConsoleEventCatego ry))
365 return WebInspector.TimelineModel.RecordType.ConsoleTime; 365 return WebInspector.TimelineModel.RecordType.ConsoleTime;
366 return this._event.name; 366 return this._event.name;
367 }, 367 },
368 368
369 /** 369 /**
370 * @return {string} 370 * @return {string}
371 */ 371 */
372 frameId: function() 372 frameId: function()
373 { 373 {
374 switch (this._event.name) { 374 switch (this._event.name) {
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 if (!this._firstCompositeLayers) 836 if (!this._firstCompositeLayers)
837 return; 837 return;
838 838
839 // First Paint is actually a DrawFrame that happened after first Composi teLayers following last CommitLoadEvent. 839 // First Paint is actually a DrawFrame that happened after first Composi teLayers following last CommitLoadEvent.
840 var recordTypes = WebInspector.TimelineModel.RecordType; 840 var recordTypes = WebInspector.TimelineModel.RecordType;
841 var i = insertionIndexForObjectInListSortedByFunction(this._firstComposi teLayers, this._inspectedTargetEvents, WebInspector.TracingModel.Event.compareSt artTime); 841 var i = insertionIndexForObjectInListSortedByFunction(this._firstComposi teLayers, this._inspectedTargetEvents, WebInspector.TracingModel.Event.compareSt artTime);
842 for (; i < this._inspectedTargetEvents.length && this._inspectedTargetEv ents[i].name !== recordTypes.DrawFrame; ++i) { } 842 for (; i < this._inspectedTargetEvents.length && this._inspectedTargetEv ents[i].name !== recordTypes.DrawFrame; ++i) { }
843 if (i >= this._inspectedTargetEvents.length) 843 if (i >= this._inspectedTargetEvents.length)
844 return; 844 return;
845 var drawFrameEvent = this._inspectedTargetEvents[i]; 845 var drawFrameEvent = this._inspectedTargetEvents[i];
846 var firstPaintEvent = new WebInspector.TracingModel.Event(drawFrameEvent .category, recordTypes.MarkFirstPaint, WebInspector.TracingModel.Phase.Instant, drawFrameEvent.startTime, drawFrameEvent.thread); 846 var firstPaintEvent = new WebInspector.TracingModel.Event(drawFrameEvent .categoriesString, recordTypes.MarkFirstPaint, WebInspector.TracingModel.Phase.I nstant, drawFrameEvent.startTime, drawFrameEvent.thread);
847 this._mainThreadEvents.splice(insertionIndexForObjectInListSortedByFunct ion(firstPaintEvent, this._mainThreadEvents, WebInspector.TracingModel.Event.com pareStartTime), 0, firstPaintEvent); 847 this._mainThreadEvents.splice(insertionIndexForObjectInListSortedByFunct ion(firstPaintEvent, this._mainThreadEvents, WebInspector.TracingModel.Event.com pareStartTime), 0, firstPaintEvent);
848 var firstPaintRecord = new WebInspector.TimelineModel.Record(this, first PaintEvent); 848 var firstPaintRecord = new WebInspector.TimelineModel.Record(this, first PaintEvent);
849 this._eventDividerRecords.splice(insertionIndexForObjectInListSortedByFu nction(firstPaintRecord, this._eventDividerRecords, WebInspector.TimelineModel.R ecord._compareStartTime), 0, firstPaintRecord); 849 this._eventDividerRecords.splice(insertionIndexForObjectInListSortedByFu nction(firstPaintRecord, this._eventDividerRecords, WebInspector.TimelineModel.R ecord._compareStartTime), 0, firstPaintRecord);
850 }, 850 },
851 851
852 _buildTimelineRecords: function() 852 _buildTimelineRecords: function()
853 { 853 {
854 var topLevelRecords = this._buildTimelineRecordsForThread(this.mainThrea dEvents()); 854 var topLevelRecords = this._buildTimelineRecordsForThread(this.mainThrea dEvents());
855 for (var i = 0; i < topLevelRecords.length; i++) { 855 for (var i = 0; i < topLevelRecords.length; i++) {
856 var record = topLevelRecords[i]; 856 var record = topLevelRecords[i];
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 return true; 1226 return true;
1227 }, 1227 },
1228 1228
1229 /** 1229 /**
1230 * @param {!WebInspector.TracingModel.AsyncEvent} asyncEvent 1230 * @param {!WebInspector.TracingModel.AsyncEvent} asyncEvent
1231 * @return {?WebInspector.AsyncEventGroup} 1231 * @return {?WebInspector.AsyncEventGroup}
1232 */ 1232 */
1233 _processAsyncEvent: function(asyncEvent) 1233 _processAsyncEvent: function(asyncEvent)
1234 { 1234 {
1235 var groups = WebInspector.TimelineUIUtils.asyncEventGroups(); 1235 var groups = WebInspector.TimelineUIUtils.asyncEventGroups();
1236 if (asyncEvent.category === WebInspector.TracingModel.ConsoleEventCatego ry) 1236 if (asyncEvent.hasCategory(WebInspector.TracingModel.ConsoleEventCategor y))
1237 return groups.console; 1237 return groups.console;
1238 1238
1239 return null; 1239 return null;
1240 }, 1240 },
1241 1241
1242 /** 1242 /**
1243 * @param {string} name 1243 * @param {string} name
1244 * @return {?WebInspector.TracingModel.Event} 1244 * @return {?WebInspector.TracingModel.Event}
1245 */ 1245 */
1246 _findAncestorEvent: function(name) 1246 _findAncestorEvent: function(name)
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 } 1562 }
1563 1563
1564 WebInspector.InclusiveTraceEventNameFilter.prototype = { 1564 WebInspector.InclusiveTraceEventNameFilter.prototype = {
1565 /** 1565 /**
1566 * @override 1566 * @override
1567 * @param {!WebInspector.TracingModel.Event} event 1567 * @param {!WebInspector.TracingModel.Event} event
1568 * @return {boolean} 1568 * @return {boolean}
1569 */ 1569 */
1570 accept: function(event) 1570 accept: function(event)
1571 { 1571 {
1572 return event.category === WebInspector.TracingModel.ConsoleEventCategory 1572 return event.hasCategory(WebInspector.TracingModel.ConsoleEventCategory)
1573 || !!this._eventNames[event.name]; 1573 || !!this._eventNames[event.name];
1574 }, 1574 },
1575 1575
1576 __proto__: WebInspector.TraceEventNameFilter.prototype 1576 __proto__: WebInspector.TraceEventNameFilter.prototype
1577 } 1577 }
1578 1578
1579 /** 1579 /**
1580 * @constructor 1580 * @constructor
1581 * @implements {WebInspector.TraceEventFilter} 1581 * @implements {WebInspector.TraceEventFilter}
1582 */ 1582 */
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
2083 /** @type {!Object.<string, !Array.<!WebInspector.InvalidationTrackingEv ent>>} */ 2083 /** @type {!Object.<string, !Array.<!WebInspector.InvalidationTrackingEv ent>>} */
2084 this._invalidations = {}; 2084 this._invalidations = {};
2085 /** @type {!Object.<number, !Array.<!WebInspector.InvalidationTrackingEv ent>>} */ 2085 /** @type {!Object.<number, !Array.<!WebInspector.InvalidationTrackingEv ent>>} */
2086 this._invalidationsByNodeId = {}; 2086 this._invalidationsByNodeId = {};
2087 2087
2088 this._lastRecalcStyle = undefined; 2088 this._lastRecalcStyle = undefined;
2089 this._lastPaintWithLayer = undefined; 2089 this._lastPaintWithLayer = undefined;
2090 this._didPaint = false; 2090 this._didPaint = false;
2091 } 2091 }
2092 } 2092 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineFlameChart.js ('k') | Source/devtools/front_end/timeline/TimelineUIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698