| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 this._filters.push(Timeline.TimelineUIUtils.visibleEventsFilter()); | 60 this._filters.push(Timeline.TimelineUIUtils.visibleEventsFilter()); |
| 61 this._filters.push(new TimelineModel.ExcludeTopLevelFilter()); | 61 this._filters.push(new TimelineModel.ExcludeTopLevelFilter()); |
| 62 } | 62 } |
| 63 | 63 |
| 64 // Create models. | 64 // Create models. |
| 65 this._tracingModelBackingStorage = new Bindings.TempFileBackingStorage('trac
ing'); | 65 this._tracingModelBackingStorage = new Bindings.TempFileBackingStorage('trac
ing'); |
| 66 this._tracingModel = new SDK.TracingModel(this._tracingModelBackingStorage); | 66 this._tracingModel = new SDK.TracingModel(this._tracingModelBackingStorage); |
| 67 this._model = new TimelineModel.TimelineModel(Timeline.TimelineUIUtils.visib
leEventsFilter()); | 67 this._model = new TimelineModel.TimelineModel(Timeline.TimelineUIUtils.visib
leEventsFilter()); |
| 68 this._frameModel = | 68 this._frameModel = |
| 69 new TimelineModel.TimelineFrameModel(event => Timeline.TimelineUIUtils.e
ventStyle(event).category.name); | 69 new TimelineModel.TimelineFrameModel(event => Timeline.TimelineUIUtils.e
ventStyle(event).category.name); |
| 70 this._filmStripModel = new Components.FilmStripModel(this._tracingModel); | 70 this._filmStripModel = new SDK.FilmStripModel(this._tracingModel); |
| 71 this._irModel = new TimelineModel.TimelineIRModel(); | 71 this._irModel = new TimelineModel.TimelineIRModel(); |
| 72 /** @type {!Array<!{title: string, model: !SDK.TracingModel}>} */ | 72 /** @type {!Array<!{title: string, model: !SDK.TracingModel}>} */ |
| 73 this._extensionTracingModels = []; | 73 this._extensionTracingModels = []; |
| 74 this._cpuThrottlingManager = new Timeline.CPUThrottlingManager(); | 74 this._cpuThrottlingManager = new Timeline.CPUThrottlingManager(); |
| 75 | 75 |
| 76 /** @type {!Array<!Timeline.TimelineModeView>} */ | 76 /** @type {!Array<!Timeline.TimelineModeView>} */ |
| 77 this._currentViews = []; | 77 this._currentViews = []; |
| 78 | 78 |
| 79 this._captureJSProfileSetting = Common.settings.createSetting('timelineEnabl
eJSSampling', true); | 79 this._captureJSProfileSetting = Common.settings.createSetting('timelineEnabl
eJSSampling', true); |
| 80 this._captureLayersAndPicturesSetting = Common.settings.createSetting('timel
ineCaptureLayersAndPictures', false); | 80 this._captureLayersAndPicturesSetting = Common.settings.createSetting('timel
ineCaptureLayersAndPictures', false); |
| 81 this._captureFilmStripSetting = Common.settings.createSetting('timelineCaptu
reFilmStrip', false); | 81 this._captureFilmStripSetting = Common.settings.createSetting('timelineCaptu
reFilmStrip', false); |
| 82 | 82 |
| 83 this._showScreenshotsSetting = Common.settings.createLocalSetting('timelineS
howScreenshots', false); | 83 this._showScreenshotsSetting = Common.settings.createLocalSetting('timelineS
howScreenshots', false); |
| 84 this._showScreenshotsSetting.addChangeListener(this._onModeChanged, this); | 84 this._showScreenshotsSetting.addChangeListener(this._onModeChanged, this); |
| 85 this._showMemorySetting = Common.settings.createLocalSetting('timelineShowMe
mory', false); | 85 this._showMemorySetting = Common.settings.createLocalSetting('timelineShowMe
mory', false); |
| 86 this._showMemorySetting.addChangeListener(this._onModeChanged, this); | 86 this._showMemorySetting.addChangeListener(this._onModeChanged, this); |
| 87 | 87 |
| 88 this._panelToolbar = new UI.Toolbar('', this.element); | 88 this._panelToolbar = new UI.Toolbar('', this.element); |
| 89 | 89 |
| 90 this._timelinePane = new UI.VBox(); | 90 this._timelinePane = new UI.VBox(); |
| 91 this._timelinePane.show(this.element); | 91 this._timelinePane.show(this.element); |
| 92 var topPaneElement = this._timelinePane.element.createChild('div', 'hbox'); | 92 var topPaneElement = this._timelinePane.element.createChild('div', 'hbox'); |
| 93 topPaneElement.id = 'timeline-overview-panel'; | 93 topPaneElement.id = 'timeline-overview-panel'; |
| 94 | 94 |
| 95 // Create top overview component. | 95 // Create top overview component. |
| 96 this._overviewPane = new UI.TimelineOverviewPane('timeline'); | 96 this._overviewPane = new Perf_UI.TimelineOverviewPane('timeline'); |
| 97 this._overviewPane.addEventListener(UI.TimelineOverviewPane.Events.WindowCha
nged, this._onWindowChanged.bind(this)); | 97 this._overviewPane.addEventListener( |
| 98 Perf_UI.TimelineOverviewPane.Events.WindowChanged, this._onWindowChanged
.bind(this)); |
| 98 this._overviewPane.show(topPaneElement); | 99 this._overviewPane.show(topPaneElement); |
| 99 this._statusPaneContainer = this._timelinePane.element.createChild('div', 's
tatus-pane-container fill'); | 100 this._statusPaneContainer = this._timelinePane.element.createChild('div', 's
tatus-pane-container fill'); |
| 100 | 101 |
| 101 this._createFileSelector(); | 102 this._createFileSelector(); |
| 102 | 103 |
| 103 SDK.targetManager.addEventListener(SDK.TargetManager.Events.PageReloadReques
ted, this._pageReloadRequested, this); | 104 SDK.targetManager.addEventListener(SDK.TargetManager.Events.PageReloadReques
ted, this._pageReloadRequested, this); |
| 104 SDK.targetManager.addEventListener(SDK.TargetManager.Events.Load, this._load
EventFired, this); | 105 SDK.targetManager.addEventListener(SDK.TargetManager.Events.Load, this._load
EventFired, this); |
| 105 | 106 |
| 106 this._landingPage = new Timeline.TimelineLandingPage(); | 107 this._landingPage = new Timeline.TimelineLandingPage(); |
| 107 | 108 |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 _clear() { | 594 _clear() { |
| 594 this._showLandingPage(); | 595 this._showLandingPage(); |
| 595 this._detailsSplitWidget.hideSidebar(); | 596 this._detailsSplitWidget.hideSidebar(); |
| 596 this._sessionGeneration = null; | 597 this._sessionGeneration = null; |
| 597 this._recordingStartTime = 0; | 598 this._recordingStartTime = 0; |
| 598 this._reset(); | 599 this._reset(); |
| 599 this._recreateToolbarItems(); | 600 this._recreateToolbarItems(); |
| 600 } | 601 } |
| 601 | 602 |
| 602 _reset() { | 603 _reset() { |
| 603 Components.LineLevelProfile.instance().reset(); | 604 Perf_UI.LineLevelProfile.instance().reset(); |
| 604 this._tracingModel.reset(); | 605 this._tracingModel.reset(); |
| 605 this._model.reset(); | 606 this._model.reset(); |
| 606 for (let extensionEntry of this._extensionTracingModels) | 607 for (let extensionEntry of this._extensionTracingModels) |
| 607 extensionEntry.model.reset(); | 608 extensionEntry.model.reset(); |
| 608 this._extensionTracingModels.splice(0); | 609 this._extensionTracingModels.splice(0); |
| 609 | 610 |
| 610 this.requestWindowTimes(0, Infinity); | 611 this.requestWindowTimes(0, Infinity); |
| 611 delete this._selection; | 612 delete this._selection; |
| 612 this._frameModel.reset(); | 613 this._frameModel.reset(); |
| 613 this._filmStripModel.reset(this._tracingModel); | 614 this._filmStripModel.reset(this._tracingModel); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 if (this._statusPane) | 717 if (this._statusPane) |
| 717 this._statusPane.updateStatus(Common.UIString('Processing profile\u2026'))
; | 718 this._statusPane.updateStatus(Common.UIString('Processing profile\u2026'))
; |
| 718 this._model.setEvents(this._tracingModel, loadedFromFile); | 719 this._model.setEvents(this._tracingModel, loadedFromFile); |
| 719 this._frameModel.reset(); | 720 this._frameModel.reset(); |
| 720 this._frameModel.addTraceEvents( | 721 this._frameModel.addTraceEvents( |
| 721 SDK.targetManager.mainTarget(), this._model.inspectedTargetEvents(), thi
s._model.sessionId() || ''); | 722 SDK.targetManager.mainTarget(), this._model.inspectedTargetEvents(), thi
s._model.sessionId() || ''); |
| 722 this._filmStripModel.reset(this._tracingModel); | 723 this._filmStripModel.reset(this._tracingModel); |
| 723 var groups = TimelineModel.TimelineModel.AsyncEventGroup; | 724 var groups = TimelineModel.TimelineModel.AsyncEventGroup; |
| 724 var asyncEventsByGroup = this._model.mainThreadAsyncEvents(); | 725 var asyncEventsByGroup = this._model.mainThreadAsyncEvents(); |
| 725 this._irModel.populate(asyncEventsByGroup.get(groups.input), asyncEventsByGr
oup.get(groups.animation)); | 726 this._irModel.populate(asyncEventsByGroup.get(groups.input), asyncEventsByGr
oup.get(groups.animation)); |
| 726 this._model.cpuProfiles().forEach(profile => Components.LineLevelProfile.ins
tance().appendCPUProfile(profile)); | 727 this._model.cpuProfiles().forEach(profile => Perf_UI.LineLevelProfile.instan
ce().appendCPUProfile(profile)); |
| 727 if (this._statusPane) | 728 if (this._statusPane) |
| 728 this._statusPane.hide(); | 729 this._statusPane.hide(); |
| 729 delete this._statusPane; | 730 delete this._statusPane; |
| 730 | 731 |
| 731 for (let entry of this._extensionTracingModels) | 732 for (let entry of this._extensionTracingModels) |
| 732 entry.model.adjustTime(this._model.minimumRecordTime() + (entry.timeOffset
/ 1000) - this._recordingStartTime); | 733 entry.model.adjustTime(this._model.minimumRecordTime() + (entry.timeOffset
/ 1000) - this._recordingStartTime); |
| 733 | 734 |
| 734 this._recreateToolbarItems(); | 735 this._recreateToolbarItems(); |
| 735 this._flameChart.resizeToPreferredHeights(); | 736 this._flameChart.resizeToPreferredHeights(); |
| 736 this._overviewPane.reset(); | 737 this._overviewPane.reset(); |
| (...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1920 } | 1921 } |
| 1921 | 1922 |
| 1922 /** | 1923 /** |
| 1923 * @override | 1924 * @override |
| 1924 * @param {!SDK.Target} target | 1925 * @param {!SDK.Target} target |
| 1925 */ | 1926 */ |
| 1926 targetRemoved(target) { | 1927 targetRemoved(target) { |
| 1927 this._targets.remove(target, true); | 1928 this._targets.remove(target, true); |
| 1928 } | 1929 } |
| 1929 }; | 1930 }; |
| OLD | NEW |