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

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

Issue 466343002: Filter out workers started by other pages when showing Timeline based on trace events (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/timeline/TracingModel.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {!WebInspector.TracingModel} tracingModel 7 * @param {!WebInspector.TracingModel} tracingModel
8 * @param {!WebInspector.TimelineModel.Filter} recordFilter 8 * @param {!WebInspector.TimelineModel.Filter} recordFilter
9 * @extends {WebInspector.TimelineModel} 9 * @extends {WebInspector.TimelineModel}
10 */ 10 */
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 _didStopRecordingJSSamples: function(error, cpuProfile) 205 _didStopRecordingJSSamples: function(error, cpuProfile)
206 { 206 {
207 if (error) 207 if (error)
208 WebInspector.console.error(error); 208 WebInspector.console.error(error);
209 this._cpuProfile = cpuProfile; 209 this._cpuProfile = cpuProfile;
210 }, 210 },
211 211
212 _didStopRecordingTraceEvents: function() 212 _didStopRecordingTraceEvents: function()
213 { 213 {
214 this._stopCallbackBarrier = null; 214 this._stopCallbackBarrier = null;
215 var events = this._tracingModel.devtoolsMetadataEvents(); 215 var events = this._tracingModel.devtoolsPageMetadataEvents();
216 var workerMetadataEvents = this._tracingModel.devtoolsWorkerMetadataEven ts();
216 events.sort(WebInspector.TracingModel.Event.compareStartTime); 217 events.sort(WebInspector.TracingModel.Event.compareStartTime);
217 218
218 this._resetProcessingState(); 219 this._resetProcessingState();
219 for (var i = 0, length = events.length; i < length; i++) { 220 for (var i = 0, length = events.length; i < length; i++) {
220 var event = events[i]; 221 var event = events[i];
221 var process = event.thread.process(); 222 var process = event.thread.process();
222 var startTime = event.startTime; 223 var startTime = event.startTime;
223 224
224 var endTime = Infinity; 225 var endTime = Infinity;
225 if (i + 1 < length) 226 if (i + 1 < length)
226 endTime = events[i + 1].startTime; 227 endTime = events[i + 1].startTime;
227 228
228 process.sortedThreads().forEach(this._processThreadEvents.bind(this, startTime, endTime, event.thread)); 229 var threads = process.sortedThreads();
230 for (var j = 0; j < threads.length; j++) {
231 var thread = threads[j];
232 if (thread.name() === "WebCore: Worker" && !workerMetadataEvents .some(function(e) { return e.thread === thread; }))
233 continue;
234 this._processThreadEvents(startTime, endTime, event.thread, thre ad);
235 }
229 } 236 }
230 this._resetProcessingState(); 237 this._resetProcessingState();
231 238
232 this._inspectedTargetEvents.sort(WebInspector.TracingModel.Event.compare StartTime); 239 this._inspectedTargetEvents.sort(WebInspector.TracingModel.Event.compare StartTime);
233 240
234 if (this._cpuProfile) { 241 if (this._cpuProfile) {
235 var jsSamples = WebInspector.TimelineJSProfileProcessor.generateTrac ingEventsFromCpuProfile(this, this._cpuProfile); 242 var jsSamples = WebInspector.TimelineJSProfileProcessor.generateTrac ingEventsFromCpuProfile(this, this._cpuProfile);
236 this._inspectedTargetEvents = this._inspectedTargetEvents.mergeOrder ed(jsSamples, WebInspector.TracingModel.Event.orderedCompareStartTime); 243 this._inspectedTargetEvents = this._inspectedTargetEvents.mergeOrder ed(jsSamples, WebInspector.TracingModel.Event.orderedCompareStartTime);
237 this._setMainThreadEvents(this.mainThreadEvents().mergeOrdered(jsSam ples, WebInspector.TracingModel.Event.orderedCompareStartTime)); 244 this._setMainThreadEvents(this.mainThreadEvents().mergeOrdered(jsSam ples, WebInspector.TracingModel.Event.orderedCompareStartTime));
238 this._cpuProfile = null; 245 this._cpuProfile = null;
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 }, 1002 },
996 1003
997 _didWriteNextChunk: function(stream) 1004 _didWriteNextChunk: function(stream)
998 { 1005 {
999 if (this._recordIndex === this._payloads.length) 1006 if (this._recordIndex === this._payloads.length)
1000 stream.close(); 1007 stream.close();
1001 else 1008 else
1002 this._writeNextChunk(stream); 1009 this._writeNextChunk(stream);
1003 } 1010 }
1004 } 1011 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/timeline/TracingModel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698