| Index: Source/devtools/front_end/timeline/TracingTimelineModel.js
|
| diff --git a/Source/devtools/front_end/timeline/TimelineTraceEventBindings.js b/Source/devtools/front_end/timeline/TracingTimelineModel.js
|
| similarity index 90%
|
| rename from Source/devtools/front_end/timeline/TimelineTraceEventBindings.js
|
| rename to Source/devtools/front_end/timeline/TracingTimelineModel.js
|
| index 4b5b1533fa4f7790f5a833dd5493ff610c207257..3e1c67cac7b5f8d4d36e227f0d75f06b039f14f8 100644
|
| --- a/Source/devtools/front_end/timeline/TimelineTraceEventBindings.js
|
| +++ b/Source/devtools/front_end/timeline/TracingTimelineModel.js
|
| @@ -3,14 +3,16 @@
|
| // found in the LICENSE file.
|
|
|
| /**
|
| + * @param {!WebInspector.TracingModel} tracingModel
|
| * @constructor
|
| */
|
| -WebInspector.TimelineTraceEventBindings = function()
|
| +WebInspector.TracingTimelineModel = function(tracingModel)
|
| {
|
| - this._reset();
|
| + this._tracingModel = tracingModel;
|
| + this._mainThreadEvents = [];
|
| }
|
|
|
| -WebInspector.TimelineTraceEventBindings.RecordType = {
|
| +WebInspector.TracingTimelineModel.RecordType = {
|
| Program: "Program",
|
| EventDispatch: "EventDispatch",
|
|
|
| @@ -87,19 +89,51 @@ WebInspector.TimelineTraceEventBindings.RecordType = {
|
| };
|
|
|
|
|
| -WebInspector.TimelineTraceEventBindings.prototype = {
|
| +WebInspector.TracingTimelineModel.prototype = {
|
| + willStartRecordingTraceEvents: function()
|
| + {
|
| + this._mainThreadEvents = [];
|
| + },
|
| +
|
| + didStopRecordingTraceEvents: function()
|
| + {
|
| + var events = this._tracingModel.inspectedTargetEvents();
|
| + this._resetProcessingState();
|
| + for (var i = 0, length = events.length; i < length; i++)
|
| + this._processEvent(events[i]);
|
| + this._resetProcessingState();
|
| + },
|
| +
|
| + /**
|
| + * @return {?number}
|
| + */
|
| + minimumRecordTime: function()
|
| + {
|
| + return this._tracingModel.minimumRecordTime();
|
| + },
|
| +
|
| + /**
|
| + * @return {?number}
|
| + */
|
| + maximumRecordTime: function()
|
| + {
|
| + return this._tracingModel.maximumRecordTime();
|
| + },
|
| +
|
| /**
|
| * @return {!Array.<!WebInspector.TracingModel.Event>}
|
| */
|
| - mainThreadEvents: function()
|
| + inspectedTargetEvents: function()
|
| {
|
| - return this._mainThreadEvents;
|
| + return this._tracingModel.inspectedTargetEvents();
|
| },
|
|
|
| - _reset: function()
|
| + /**
|
| + * @return {!Array.<!WebInspector.TracingModel.Event>}
|
| + */
|
| + mainThreadEvents: function()
|
| {
|
| - this._resetProcessingState();
|
| - this._mainThreadEvents = [];
|
| + return this._mainThreadEvents;
|
| },
|
|
|
| _resetProcessingState: function()
|
| @@ -118,22 +152,11 @@ WebInspector.TimelineTraceEventBindings.prototype = {
|
| },
|
|
|
| /**
|
| - * @param {!Array.<!WebInspector.TracingModel.Event>} events
|
| - */
|
| - setEvents: function(events)
|
| - {
|
| - this._resetProcessingState();
|
| - for (var i = 0, length = events.length; i < length; i++)
|
| - this._processEvent(events[i]);
|
| - this._resetProcessingState();
|
| - },
|
| -
|
| - /**
|
| * @param {!WebInspector.TracingModel.Event} event
|
| */
|
| _processEvent: function(event)
|
| {
|
| - var recordTypes = WebInspector.TimelineTraceEventBindings.RecordType;
|
| + var recordTypes = WebInspector.TracingTimelineModel.RecordType;
|
|
|
| var eventStack = this._eventStack;
|
| while (eventStack.length && eventStack.peekLast().endTime < event.startTime)
|
|
|