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

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

Issue 1186883007: DevTools: Update dedicated workers thread name. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « LayoutTests/inspector/tracing/worker-js-profile-expected.txt ('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 /* 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 RecordsCleared: "RecordsCleared", 158 RecordsCleared: "RecordsCleared",
159 RecordingStarted: "RecordingStarted", 159 RecordingStarted: "RecordingStarted",
160 RecordingStopped: "RecordingStopped", 160 RecordingStopped: "RecordingStopped",
161 RecordFilterChanged: "RecordFilterChanged", 161 RecordFilterChanged: "RecordFilterChanged",
162 BufferUsage: "BufferUsage", 162 BufferUsage: "BufferUsage",
163 RetrieveEventsProgress: "RetrieveEventsProgress" 163 RetrieveEventsProgress: "RetrieveEventsProgress"
164 } 164 }
165 165
166 WebInspector.TimelineModel.MainThreadName = "main"; 166 WebInspector.TimelineModel.MainThreadName = "main";
167 167
168 WebInspector.TimelineModel.WorkerThreadName = "DedicatedWorker Thread";
169
168 /** 170 /**
169 * @param {!Array.<!WebInspector.TracingModel.Event>} events 171 * @param {!Array.<!WebInspector.TracingModel.Event>} events
170 * @param {function(!WebInspector.TracingModel.Event)} onStartEvent 172 * @param {function(!WebInspector.TracingModel.Event)} onStartEvent
171 * @param {function(!WebInspector.TracingModel.Event)} onEndEvent 173 * @param {function(!WebInspector.TracingModel.Event)} onEndEvent
172 * @param {function(!WebInspector.TracingModel.Event,?WebInspector.TracingModel. Event)=} onInstantEvent 174 * @param {function(!WebInspector.TracingModel.Event,?WebInspector.TracingModel. Event)=} onInstantEvent
173 */ 175 */
174 WebInspector.TimelineModel.forEachEvent = function(events, onStartEvent, onEndEv ent, onInstantEvent) 176 WebInspector.TimelineModel.forEachEvent = function(events, onStartEvent, onEndEv ent, onInstantEvent)
175 { 177 {
176 var stack = []; 178 var stack = [];
177 for (var i = 0; i < events.length; ++i) { 179 for (var i = 0; i < events.length; ++i) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 /** @type {!Map<!WebInspector.AsyncEventGroup, !Array<!WebInspector.TracingM odel.AsyncEvent>>} */ 236 /** @type {!Map<!WebInspector.AsyncEventGroup, !Array<!WebInspector.TracingM odel.AsyncEvent>>} */
235 this.asyncEventsByGroup = new Map(); 237 this.asyncEventsByGroup = new Map();
236 } 238 }
237 239
238 WebInspector.TimelineModel.VirtualThread.prototype = { 240 WebInspector.TimelineModel.VirtualThread.prototype = {
239 /** 241 /**
240 * @return {boolean} 242 * @return {boolean}
241 */ 243 */
242 isWorker: function() 244 isWorker: function()
243 { 245 {
244 return this.name === "WebCore: Worker"; 246 return this.name === WebInspector.TimelineModel.WorkerThreadName;
245 } 247 }
246 } 248 }
247 249
248 /** 250 /**
249 * @constructor 251 * @constructor
250 * @param {!WebInspector.TimelineModel} model 252 * @param {!WebInspector.TimelineModel} model
251 * @param {!WebInspector.TracingModel.Event} traceEvent 253 * @param {!WebInspector.TracingModel.Event} traceEvent
252 */ 254 */
253 WebInspector.TimelineModel.Record = function(model, traceEvent) 255 WebInspector.TimelineModel.Record = function(model, traceEvent)
254 { 256 {
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 var workerMetadataEvents = this._tracingModel.devtoolsWorkerMetadataEven ts(); 760 var workerMetadataEvents = this._tracingModel.devtoolsWorkerMetadataEven ts();
759 761
760 this._resetProcessingState(); 762 this._resetProcessingState();
761 var startTime = 0; 763 var startTime = 0;
762 for (var i = 0, length = metaEvents.length; i < length; i++) { 764 for (var i = 0, length = metaEvents.length; i < length; i++) {
763 var metaEvent = metaEvents[i]; 765 var metaEvent = metaEvents[i];
764 var process = metaEvent.thread.process(); 766 var process = metaEvent.thread.process();
765 var endTime = i + 1 < length ? metaEvents[i + 1].startTime : Infinit y; 767 var endTime = i + 1 < length ? metaEvents[i + 1].startTime : Infinit y;
766 this._currentPage = metaEvent.args["data"] && metaEvent.args["data"] ["page"]; 768 this._currentPage = metaEvent.args["data"] && metaEvent.args["data"] ["page"];
767 for (var thread of process.sortedThreads()) { 769 for (var thread of process.sortedThreads()) {
768 if (thread.name() === "WebCore: Worker" && !workerMetadataEvents .some(function(e) { return e.args["data"]["workerThreadId"] === thread.id(); })) 770 if (thread.name() === WebInspector.TimelineModel.WorkerThreadNam e && !workerMetadataEvents.some(function(e) { return e.args["data"]["workerThrea dId"] === thread.id(); }))
769 continue; 771 continue;
770 this._processThreadEvents(startTime, endTime, metaEvent.thread, thread); 772 this._processThreadEvents(startTime, endTime, metaEvent.thread, thread);
771 } 773 }
772 startTime = endTime; 774 startTime = endTime;
773 } 775 }
774 this._inspectedTargetEvents.sort(WebInspector.TracingModel.Event.compare StartTime); 776 this._inspectedTargetEvents.sort(WebInspector.TracingModel.Event.compare StartTime);
775 777
776 this._cpuProfiles = null; 778 this._cpuProfiles = null;
777 this._buildTimelineRecords(); 779 this._buildTimelineRecords();
778 this._buildGPUTasks(); 780 this._buildGPUTasks();
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after
2078 /** @type {!Object.<string, !Array.<!WebInspector.InvalidationTrackingEv ent>>} */ 2080 /** @type {!Object.<string, !Array.<!WebInspector.InvalidationTrackingEv ent>>} */
2079 this._invalidations = {}; 2081 this._invalidations = {};
2080 /** @type {!Object.<number, !Array.<!WebInspector.InvalidationTrackingEv ent>>} */ 2082 /** @type {!Object.<number, !Array.<!WebInspector.InvalidationTrackingEv ent>>} */
2081 this._invalidationsByNodeId = {}; 2083 this._invalidationsByNodeId = {};
2082 2084
2083 this._lastRecalcStyle = undefined; 2085 this._lastRecalcStyle = undefined;
2084 this._lastPaintWithLayer = undefined; 2086 this._lastPaintWithLayer = undefined;
2085 this._didPaint = false; 2087 this._didPaint = false;
2086 } 2088 }
2087 } 2089 }
OLDNEW
« no previous file with comments | « LayoutTests/inspector/tracing/worker-js-profile-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698