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

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

Issue 463033002: Do not coalesce events from different threads having same name (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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 | « Source/devtools/front_end/timeline/TimelineFlameChart.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/timeline/TracingTimelineModel.js
diff --git a/Source/devtools/front_end/timeline/TracingTimelineModel.js b/Source/devtools/front_end/timeline/TracingTimelineModel.js
index 89a3f3130ec9ff08389345541b4840203a3b3c22..2cb679ce2418f020b8c175dda501014163c7ea03 100644
--- a/Source/devtools/front_end/timeline/TracingTimelineModel.js
+++ b/Source/devtools/front_end/timeline/TracingTimelineModel.js
@@ -98,6 +98,17 @@ WebInspector.TracingTimelineModel.RecordType = {
PictureSnapshot: "cc::Picture"
};
+/**
+ * @constructor
+ * @param {string} name
+ */
+WebInspector.TracingTimelineModel.VirtualThread = function(name)
+{
+ this.name = name;
+ /** @type {!Array.<!WebInspector.TracingModel.Event>} */
+ this.events = [];
+}
+
WebInspector.TracingTimelineModel.prototype = {
/**
* @param {boolean} captureStacks
@@ -259,7 +270,7 @@ WebInspector.TracingTimelineModel.prototype = {
*/
mainThreadEvents: function()
{
- return this._virtualThreads[WebInspector.TimelineModel.MainThreadName] || [];
+ return this._mainThreadEvents;
},
/**
@@ -267,11 +278,11 @@ WebInspector.TracingTimelineModel.prototype = {
*/
_setMainThreadEvents: function(events)
{
- this._virtualThreads[WebInspector.TimelineModel.MainThreadName] = events;
+ this._mainThreadEvents = events;
},
/**
- * @return {!Object.<string, !Array.<!WebInspector.TracingModel.Event>>}
+ * @return {!Array.<!WebInspector.TracingTimelineModel.VirtualThread>}
*/
virtualThreads: function()
{
@@ -300,7 +311,8 @@ WebInspector.TracingTimelineModel.prototype = {
reset: function()
{
- this._virtualThreads = {};
+ this._virtualThreads = [];
+ this._mainThreadEvents = [];
this._inspectedTargetEvents = [];
WebInspector.TimelineModel.prototype.reset.call(this);
},
@@ -375,18 +387,21 @@ WebInspector.TracingTimelineModel.prototype = {
var length = events.length;
var i = events.lowerBound(startTime, function (time, event) { return time - event.startTime });
+ var threadEvents;
+ if (thread === mainThread) {
+ threadEvents = this._mainThreadEvents;
+ } else {
+ var virtualThread = new WebInspector.TracingTimelineModel.VirtualThread(thread.name());
+ threadEvents = virtualThread.events;
+ this._virtualThreads.push(virtualThread);
+ }
+
this._eventStack = [];
for (; i < length; i++) {
var event = events[i];
if (endTime && event.startTime >= endTime)
break;
this._processEvent(event);
- var threadName = thread === mainThread ? WebInspector.TimelineModel.MainThreadName : thread.name();
- var threadEvents = this._virtualThreads[threadName];
- if (!threadEvents) {
- threadEvents = [];
- this._virtualThreads[threadName] = threadEvents;
- }
threadEvents.push(event);
this._inspectedTargetEvents.push(event);
}
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineFlameChart.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698