Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js |
| index 08ff67151f025d211a62d9d39822a6d4a9700d57..10aa475cb74ef051c3fc4480dc49bbf98f82b179 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/timeline_model/TimelineModel.js |
| @@ -160,7 +160,9 @@ WebInspector.TimelineModel.RecordType = { |
| // CpuProfile is a virtual event created on frontend to support |
| // serialization of CPU Profiles within tracing timeline data. |
| - CpuProfile: "CpuProfile" |
| + CpuProfile: "CpuProfile", |
| + |
| + Extension: "Extension" |
|
caseq
2016/07/11 18:58:38
This shouldn't be necessary.
|
| } |
| WebInspector.TimelineModel.Category = { |
| @@ -180,6 +182,7 @@ WebInspector.TimelineModel.WarningType = { |
| } |
| WebInspector.TimelineModel.MainThreadName = "main"; |
| +WebInspector.TimelineModel.ExtensionThreadName = "extension"; |
|
caseq
2016/07/11 18:58:38
ditto.
|
| WebInspector.TimelineModel.WorkerThreadName = "DedicatedWorker Thread"; |
| WebInspector.TimelineModel.RendererMainThreadName = "CrRendererMain"; |
| @@ -481,9 +484,10 @@ WebInspector.TimelineModel.prototype = { |
| /** |
| * @param {!WebInspector.TracingModel} tracingModel |
| + * @param {!Array.<!WebInspector.ExtensionTraceProvider>} traceProviders |
| * @param {boolean=} produceTraceStartedInPage |
| */ |
| - setEvents: function(tracingModel, produceTraceStartedInPage) |
| + setEvents: function(tracingModel, traceProviders, produceTraceStartedInPage) |
| { |
| this.reset(); |
| this._resetProcessingState(); |
| @@ -508,6 +512,7 @@ WebInspector.TimelineModel.prototype = { |
| this._inspectedTargetEvents.sort(WebInspector.TracingModel.Event.compareStartTime); |
| this._processBrowserEvents(tracingModel); |
| + this._processExtensionEvents(traceProviders); |
| this._buildTimelineRecords(); |
| this._buildGPUEvents(tracingModel); |
| this._insertFirstPaintEvent(); |
| @@ -628,6 +633,18 @@ WebInspector.TimelineModel.prototype = { |
| this._mergeAsyncEvents(this._mainThreadAsyncEventsByGroup, asyncEventsByGroup); |
| }, |
| + /** |
| + * @param {!Array.<!WebInspector.ExtensionTraceProvider>} traceProviders |
| + */ |
| + _processExtensionEvents: function(traceProviders) |
| + { |
| + for (var traceProvider of traceProviders) { |
| + traceProvider.tracingModel.threadByName("Extension", "Thread 0").events().forEach(function(entry) { |
| + this._extensionEvents.push(entry); |
| + }, this); |
| + } |
| + }, |
| + |
| _buildTimelineRecords: function() |
| { |
| var topLevelRecords = this._buildTimelineRecordsForThread(this.mainThreadEvents()); |
| @@ -1075,6 +1092,8 @@ WebInspector.TimelineModel.prototype = { |
| this._virtualThreads = []; |
| /** @type {!Array<!WebInspector.TracingModel.Event>} */ |
| this._mainThreadEvents = []; |
| + /** @type {!Array<!WebInspector.TracingModel.Event>} */ |
| + this._extensionEvents = []; |
| /** @type {!Map<!WebInspector.TimelineModel.AsyncEventGroup, !Array<!WebInspector.TracingModel.AsyncEvent>>} */ |
| this._mainThreadAsyncEventsByGroup = new Map(); |
| /** @type {!Array<!WebInspector.TracingModel.Event>} */ |
| @@ -1130,6 +1149,14 @@ WebInspector.TimelineModel.prototype = { |
| }, |
| /** |
| + * @return {!Array.<!WebInspector.TracingModel.Event>} |
| + */ |
| + extensionEvents: function() |
| + { |
| + return this._extensionEvents; |
| + }, |
| + |
| + /** |
| * @param {!Array.<!WebInspector.TracingModel.Event>} events |
| */ |
| _setMainThreadEvents: function(events) |