Commit 0cbc6919 authored by yurys@chromium.org's avatar yurys@chromium.org

Filter out workers started by other pages when showing Timeline based on trace events

BUG=401895
R=alph@chromium.org

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

git-svn-id: svn://svn.chromium.org/blink/trunk@180167 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent a7d15564
...@@ -81,9 +81,17 @@ WebInspector.TracingModel.prototype = { ...@@ -81,9 +81,17 @@ WebInspector.TracingModel.prototype = {
/** /**
* @return {!Array.<!WebInspector.TracingModel.Event>} * @return {!Array.<!WebInspector.TracingModel.Event>}
*/ */
devtoolsMetadataEvents: function() devtoolsPageMetadataEvents: function()
{ {
return this._devtoolsMetadataEvents; return this._devtoolsPageMetadataEvents;
},
/**
* @return {!Array.<!WebInspector.TracingModel.Event>}
*/
devtoolsWorkerMetadataEvents: function()
{
return this._devtoolsWorkerMetadataEvents;
}, },
/** /**
...@@ -175,7 +183,8 @@ WebInspector.TracingModel.prototype = { ...@@ -175,7 +183,8 @@ WebInspector.TracingModel.prototype = {
this._minimumRecordTime = 0; this._minimumRecordTime = 0;
this._maximumRecordTime = 0; this._maximumRecordTime = 0;
this._sessionId = null; this._sessionId = null;
this._devtoolsMetadataEvents = []; this._devtoolsPageMetadataEvents = [];
this._devtoolsWorkerMetadataEvents = [];
this._rawEvents = []; this._rawEvents = [];
}, },
...@@ -212,7 +221,11 @@ WebInspector.TracingModel.prototype = { ...@@ -212,7 +221,11 @@ WebInspector.TracingModel.prototype = {
if (event && event.name === WebInspector.TracingModel.DevToolsMetadataEvent.TracingStartedInPage && if (event && event.name === WebInspector.TracingModel.DevToolsMetadataEvent.TracingStartedInPage &&
event.category === WebInspector.TracingModel.DevToolsMetadataEventCategory && event.category === WebInspector.TracingModel.DevToolsMetadataEventCategory &&
event.args["sessionId"] === this._sessionId) event.args["sessionId"] === this._sessionId)
this._devtoolsMetadataEvents.push(event); this._devtoolsPageMetadataEvents.push(event);
if (event && event.name === WebInspector.TracingModel.DevToolsMetadataEvent.TracingStartedInWorker &&
event.category === WebInspector.TracingModel.DevToolsMetadataEventCategory &&
event.args["sessionId"] === this._sessionId)
this._devtoolsWorkerMetadataEvents.push(event);
return; return;
} }
switch (payload.name) { switch (payload.name) {
......
...@@ -212,7 +212,8 @@ WebInspector.TracingTimelineModel.prototype = { ...@@ -212,7 +212,8 @@ WebInspector.TracingTimelineModel.prototype = {
_didStopRecordingTraceEvents: function() _didStopRecordingTraceEvents: function()
{ {
this._stopCallbackBarrier = null; this._stopCallbackBarrier = null;
var events = this._tracingModel.devtoolsMetadataEvents(); var events = this._tracingModel.devtoolsPageMetadataEvents();
var workerMetadataEvents = this._tracingModel.devtoolsWorkerMetadataEvents();
events.sort(WebInspector.TracingModel.Event.compareStartTime); events.sort(WebInspector.TracingModel.Event.compareStartTime);
this._resetProcessingState(); this._resetProcessingState();
...@@ -225,7 +226,13 @@ WebInspector.TracingTimelineModel.prototype = { ...@@ -225,7 +226,13 @@ WebInspector.TracingTimelineModel.prototype = {
if (i + 1 < length) if (i + 1 < length)
endTime = events[i + 1].startTime; endTime = events[i + 1].startTime;
process.sortedThreads().forEach(this._processThreadEvents.bind(this, startTime, endTime, event.thread)); var threads = process.sortedThreads();
for (var j = 0; j < threads.length; j++) {
var thread = threads[j];
if (thread.name() === "WebCore: Worker" && !workerMetadataEvents.some(function(e) { return e.thread === thread; }))
continue;
this._processThreadEvents(startTime, endTime, event.thread, thread);
}
} }
this._resetProcessingState(); this._resetProcessingState();
......
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