OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * Copyright (C) 2012 Intel Inc. All rights reserved. | 3 * Copyright (C) 2012 Intel Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 28 matching lines...) Expand all Loading... |
39 importScript("TimelinePresentationModel.js"); | 39 importScript("TimelinePresentationModel.js"); |
40 importScript("TimelineFrameModel.js"); | 40 importScript("TimelineFrameModel.js"); |
41 importScript("TimelineEventOverview.js"); | 41 importScript("TimelineEventOverview.js"); |
42 importScript("TimelineFrameOverview.js"); | 42 importScript("TimelineFrameOverview.js"); |
43 importScript("TimelineMemoryOverview.js"); | 43 importScript("TimelineMemoryOverview.js"); |
44 importScript("TimelinePowerGraph.js"); | 44 importScript("TimelinePowerGraph.js"); |
45 importScript("TimelinePowerOverview.js"); | 45 importScript("TimelinePowerOverview.js"); |
46 importScript("TimelineFlameChart.js"); | 46 importScript("TimelineFlameChart.js"); |
47 importScript("TimelineUIUtils.js"); | 47 importScript("TimelineUIUtils.js"); |
48 importScript("TimelineView.js"); | 48 importScript("TimelineView.js"); |
49 importScript("TimelineTraceEventBindings.js"); | |
50 importScript("TimelineTracingView.js"); | 49 importScript("TimelineTracingView.js"); |
51 importScript("TimelineLayersView.js"); | 50 importScript("TimelineLayersView.js"); |
52 importScript("TracingModel.js"); | 51 importScript("TracingModel.js"); |
| 52 importScript("TracingTimelineModel.js"); |
53 importScript("TransformController.js"); | 53 importScript("TransformController.js"); |
54 | 54 |
55 /** | 55 /** |
56 * @constructor | 56 * @constructor |
57 * @extends {WebInspector.Panel} | 57 * @extends {WebInspector.Panel} |
58 * @implements {WebInspector.TimelineModeViewDelegate} | 58 * @implements {WebInspector.TimelineModeViewDelegate} |
59 * @implements {WebInspector.Searchable} | 59 * @implements {WebInspector.Searchable} |
60 */ | 60 */ |
61 WebInspector.TimelinePanel = function() | 61 WebInspector.TimelinePanel = function() |
62 { | 62 { |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 }, | 257 }, |
258 | 258 |
259 /** | 259 /** |
260 * @return {!WebInspector.TracingModel} | 260 * @return {!WebInspector.TracingModel} |
261 */ | 261 */ |
262 _tracingModel: function() | 262 _tracingModel: function() |
263 { | 263 { |
264 if (!this._lazyTracingModel) { | 264 if (!this._lazyTracingModel) { |
265 this._lazyTracingModel = new WebInspector.TracingModel(WebInspector.
targetManager.activeTarget()); | 265 this._lazyTracingModel = new WebInspector.TracingModel(WebInspector.
targetManager.activeTarget()); |
266 this._lazyTracingModel.addEventListener(WebInspector.TracingModel.Ev
ents.BufferUsage, this._onTracingBufferUsage, this); | 266 this._lazyTracingModel.addEventListener(WebInspector.TracingModel.Ev
ents.BufferUsage, this._onTracingBufferUsage, this); |
| 267 this._tracingTimelineModel = new WebInspector.TracingTimelineModel(t
his._lazyTracingModel); |
267 } | 268 } |
268 return this._lazyTracingModel; | 269 return this._lazyTracingModel; |
269 }, | 270 }, |
270 | 271 |
271 /** | 272 /** |
272 * @return {!WebInspector.TimelineTraceEventBindings} | |
273 */ | |
274 _traceEventBindings: function() | |
275 { | |
276 if (!this._lazyTraceEventBindings) { | |
277 this._lazyTraceEventBindings = new WebInspector.TimelineTraceEventBi
ndings(); | |
278 if (this._lazyTracingModel) | |
279 this._lazyTraceEventBindings.setEvents(this._lazyTracingModel.in
spectedTargetEvents()); | |
280 } | |
281 return this._lazyTraceEventBindings; | |
282 }, | |
283 | |
284 /** | |
285 * @return {!WebInspector.TimelineView} | 273 * @return {!WebInspector.TimelineView} |
286 */ | 274 */ |
287 _timelineView: function() | 275 _timelineView: function() |
288 { | 276 { |
289 if (!this._lazyTimelineView) | 277 if (!this._lazyTimelineView) |
290 this._lazyTimelineView = new WebInspector.TimelineView(this, this._m
odel); | 278 this._lazyTimelineView = new WebInspector.TimelineView(this, this._m
odel); |
291 return this._lazyTimelineView; | 279 return this._lazyTimelineView; |
292 }, | 280 }, |
293 | 281 |
294 /** | 282 /** |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 | 610 |
623 var isFrameMode = this._overviewModeSetting.get() === WebInspector.Timel
inePanel.OverviewMode.Frames; | 611 var isFrameMode = this._overviewModeSetting.get() === WebInspector.Timel
inePanel.OverviewMode.Frames; |
624 this._removeAllModeViews(); | 612 this._removeAllModeViews(); |
625 this._overviewControls = []; | 613 this._overviewControls = []; |
626 | 614 |
627 if (isFrameMode) | 615 if (isFrameMode) |
628 this._overviewControls.push(new WebInspector.TimelineFrameOverview(t
his._model, this._frameModel())); | 616 this._overviewControls.push(new WebInspector.TimelineFrameOverview(t
his._model, this._frameModel())); |
629 else | 617 else |
630 this._overviewControls.push(new WebInspector.TimelineEventOverview(t
his._model)); | 618 this._overviewControls.push(new WebInspector.TimelineEventOverview(t
his._model)); |
631 | 619 |
632 var tracingModel = null; | 620 var tracingTimelineModel = null; |
633 var traceEventBindings = null; | |
634 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled())
{ | 621 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled())
{ |
635 tracingModel = this._tracingModel(); | 622 this._tracingModel(); |
636 traceEventBindings = this._traceEventBindings(); | 623 tracingTimelineModel = this._tracingTimelineModel; |
637 } | 624 } |
638 if (WebInspector.experimentsSettings.timelineFlameChart.isEnabled() && t
his._flameChartEnabledSetting.get()) | 625 if (WebInspector.experimentsSettings.timelineFlameChart.isEnabled() && t
his._flameChartEnabledSetting.get()) |
639 this._addModeView(new WebInspector.TimelineFlameChart(this, this._mo
del, tracingModel, traceEventBindings, this._frameModel())); | 626 this._addModeView(new WebInspector.TimelineFlameChart(this, this._mo
del, tracingTimelineModel, this._frameModel())); |
640 else | 627 else |
641 this._addModeView(this._timelineView()); | 628 this._addModeView(this._timelineView()); |
642 | 629 |
643 if (this._captureMemorySetting.get()) { | 630 if (this._captureMemorySetting.get()) { |
644 if (!isFrameMode) // Frame mode skews time, don't render aux overvi
ews. | 631 if (!isFrameMode) // Frame mode skews time, don't render aux overvi
ews. |
645 this._overviewControls.push(new WebInspector.TimelineMemoryOverv
iew(this._model)); | 632 this._overviewControls.push(new WebInspector.TimelineMemoryOverv
iew(this._model)); |
646 this._addModeView(new WebInspector.MemoryCountersGraph(this, this._m
odel)); | 633 this._addModeView(new WebInspector.MemoryCountersGraph(this, this._m
odel)); |
647 } | 634 } |
648 | 635 |
649 if (this._capturePowerSetting && this._capturePowerSetting.get()) { | 636 if (this._capturePowerSetting && this._capturePowerSetting.get()) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 this._overviewControls[i].timelineStopped(); | 685 this._overviewControls[i].timelineStopped(); |
699 }, | 686 }, |
700 | 687 |
701 _onTracingComplete: function() | 688 _onTracingComplete: function() |
702 { | 689 { |
703 if (this._lazyFrameModel) { | 690 if (this._lazyFrameModel) { |
704 this._lazyFrameModel.reset(); | 691 this._lazyFrameModel.reset(); |
705 this._lazyFrameModel.addTraceEvents(this._lazyTracingModel.inspected
TargetEvents(), this._lazyTracingModel.sessionId()); | 692 this._lazyFrameModel.addTraceEvents(this._lazyTracingModel.inspected
TargetEvents(), this._lazyTracingModel.sessionId()); |
706 this._overviewPane.update(); | 693 this._overviewPane.update(); |
707 } | 694 } |
708 if (this._lazyTraceEventBindings) { | 695 if (WebInspector.experimentsSettings.timelineOnTraceEvents.isEnabled())
{ |
709 this._lazyTraceEventBindings.setEvents(this._lazyTracingModel.inspec
tedTargetEvents()); | 696 this._tracingTimelineModel.didStopRecordingTraceEvents(); |
710 this._model.didStopRecordingTraceEvents(this._lazyTraceEventBindings
.mainThreadEvents()); | 697 this._model.didStopRecordingTraceEvents(this._tracingTimelineModel.m
ainThreadEvents()); |
711 } | 698 } |
712 this._refreshViews(); | 699 this._refreshViews(); |
713 }, | 700 }, |
714 | 701 |
715 _onProfilingStateChanged: function() | 702 _onProfilingStateChanged: function() |
716 { | 703 { |
717 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); | 704 this._updateToggleTimelineButton(this.toggleTimelineButton.toggled); |
718 }, | 705 }, |
719 | 706 |
720 /** | 707 /** |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 return; | 975 return; |
989 } | 976 } |
990 switch (this._selection.type()) { | 977 switch (this._selection.type()) { |
991 case WebInspector.TimelineSelection.Type.Record: | 978 case WebInspector.TimelineSelection.Type.Record: |
992 var record = /** @type {!WebInspector.TimelineModel.Record} */ (this
._selection.object()); | 979 var record = /** @type {!WebInspector.TimelineModel.Record} */ (this
._selection.object()); |
993 WebInspector.TimelineUIUtils.generatePopupContent(record, this._mode
l, this._detailsLinkifier, this.showInDetails.bind(this, record.title()), this._
model.loadedFromFile()); | 980 WebInspector.TimelineUIUtils.generatePopupContent(record, this._mode
l, this._detailsLinkifier, this.showInDetails.bind(this, record.title()), this._
model.loadedFromFile()); |
994 break; | 981 break; |
995 case WebInspector.TimelineSelection.Type.TraceEvent: | 982 case WebInspector.TimelineSelection.Type.TraceEvent: |
996 var event = /** @type {!WebInspector.TracingModel.Event} */ (this._s
election.object()); | 983 var event = /** @type {!WebInspector.TracingModel.Event} */ (this._s
election.object()); |
997 var title = WebInspector.TimelineUIUtils.styleForTimelineEvent(event
.name).title; | 984 var title = WebInspector.TimelineUIUtils.styleForTimelineEvent(event
.name).title; |
998 var tracingModel = this._tracingModel(); | 985 var tracingModel = this._tracingTimelineModel; |
999 var bindings = this._traceEventBindings(); | 986 WebInspector.TimelineUIUtils.buildTraceEventDetails(event, tracingMo
del, this._detailsLinkifier, this.showInDetails.bind(this, title), false, this._
model.target()); |
1000 WebInspector.TimelineUIUtils.buildTraceEventDetails(event, tracingMo
del, this._detailsLinkifier, this.showInDetails.bind(this, title), false, bindin
gs, this._model.target()); | |
1001 break; | 987 break; |
1002 case WebInspector.TimelineSelection.Type.Frame: | 988 case WebInspector.TimelineSelection.Type.Frame: |
1003 var frame = /** @type {!WebInspector.TimelineFrame} */ (this._select
ion.object()); | 989 var frame = /** @type {!WebInspector.TimelineFrame} */ (this._select
ion.object()); |
1004 if (frame.layerTree) { | 990 if (frame.layerTree) { |
1005 var layersView = this._layersView(); | 991 var layersView = this._layersView(); |
1006 layersView.showLayerTree(frame.layerTree); | 992 layersView.showLayerTree(frame.layerTree); |
1007 this._detailsView.setChildView(WebInspector.UIString("Frame Laye
rs"), layersView); | 993 this._detailsView.setChildView(WebInspector.UIString("Frame Laye
rs"), layersView); |
1008 } else { | 994 } else { |
1009 this.showInDetails(WebInspector.UIString("Frame Statistics"), We
bInspector.TimelineUIUtils.generatePopupContentForFrame(this._lazyFrameModel, fr
ame)); | 995 this.showInDetails(WebInspector.UIString("Frame Statistics"), We
bInspector.TimelineUIUtils.generatePopupContentForFrame(this._lazyFrameModel, fr
ame)); |
1010 } | 996 } |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 * @param {!WebInspector.TimelineModel.Record} record | 1436 * @param {!WebInspector.TimelineModel.Record} record |
1451 * @return {boolean} | 1437 * @return {boolean} |
1452 */ | 1438 */ |
1453 accept: function(record) | 1439 accept: function(record) |
1454 { | 1440 { |
1455 return !this._hiddenRecords[record.type()]; | 1441 return !this._hiddenRecords[record.type()]; |
1456 }, | 1442 }, |
1457 | 1443 |
1458 __proto__: WebInspector.TimelineModel.Filter.prototype | 1444 __proto__: WebInspector.TimelineModel.Filter.prototype |
1459 } | 1445 } |
OLD | NEW |