| Index: Source/devtools/front_end/timeline/TracingModel.js
|
| diff --git a/Source/devtools/front_end/sdk/TracingModel.js b/Source/devtools/front_end/timeline/TracingModel.js
|
| similarity index 90%
|
| rename from Source/devtools/front_end/sdk/TracingModel.js
|
| rename to Source/devtools/front_end/timeline/TracingModel.js
|
| index 16c48114103a4da315c1eeb9229d0070b01d62cd..7f66b2eec0d99717a5d174dfe67e60bc54fd54a4 100644
|
| --- a/Source/devtools/front_end/sdk/TracingModel.js
|
| +++ b/Source/devtools/front_end/timeline/TracingModel.js
|
| @@ -174,6 +174,7 @@ WebInspector.TracingModel.prototype = {
|
|
|
| _tracingComplete: function()
|
| {
|
| + this._bindings = new WebInspector.TracingModel.EventBindings(this);
|
| this._active = false;
|
| if (!this._pendingStopCallback)
|
| return;
|
| @@ -181,6 +182,14 @@ WebInspector.TracingModel.prototype = {
|
| this._pendingStopCallback = null;
|
| },
|
|
|
| + /**
|
| + * @return {?WebInspector.TracingModel.EventBindings}
|
| + */
|
| + bindings: function()
|
| + {
|
| + return this._bindings;
|
| + },
|
| +
|
| reset: function()
|
| {
|
| this._processById = {};
|
| @@ -192,6 +201,7 @@ WebInspector.TracingModel.prototype = {
|
| this._inspectedTargetMainThreadEvents = [];
|
| this._inspectedTargetLayerTreeHostId = 0;
|
| this._frameLifecycleEvents = [];
|
| + this._bindings = null;
|
| },
|
|
|
| /**
|
| @@ -291,6 +301,45 @@ WebInspector.TracingModel.prototype = {
|
| }
|
|
|
| /**
|
| + * @param {!WebInspector.TracingModel} model
|
| + * @constructor
|
| + */
|
| +WebInspector.TracingModel.EventBindings = function(model)
|
| +{
|
| + this._eventToWarning = new Map();
|
| + this._model = model;
|
| + this._calculateWarnings();
|
| +}
|
| +
|
| +WebInspector.TracingModel.EventBindings.prototype = {
|
| + /**
|
| + * @param {!WebInspector.TracingModel.Event} event
|
| + * @return {string|undefined}
|
| + */
|
| + eventWarning: function(event)
|
| + {
|
| + return this._eventToWarning.get(event);
|
| + },
|
| +
|
| + _calculateWarnings: function()
|
| + {
|
| + var events = this._model.inspectedTargetMainThreadEvents();
|
| + var currentScriptEvent = null;
|
| + for (var i = 0, length = events.length; i < length; i++) {
|
| + var event = events[i];
|
| + if (currentScriptEvent && event.startTime > currentScriptEvent.endTime)
|
| + currentScriptEvent = null;
|
| + if (event.name === WebInspector.TimelineModel.RecordType.Layout) {
|
| + if (currentScriptEvent)
|
| + this._eventToWarning.put(event, WebInspector.UIString("Forced synchronous layout is a possible performance bottleneck."));
|
| + }
|
| + if (!currentScriptEvent && (event.name === WebInspector.TimelineModel.RecordType.EvaluateScript || event.name === WebInspector.TimelineModel.RecordType.FunctionCall))
|
| + currentScriptEvent = event;
|
| + }
|
| + }
|
| +}
|
| +
|
| +/**
|
| * @constructor
|
| * @param {!WebInspector.TracingModel.EventPayload} payload
|
| * @param {number} level
|
|
|