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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 this._toggleRecordAction = WebInspector.actionRegistry.action("timeline.togg le-recording"); | 51 this._toggleRecordAction = WebInspector.actionRegistry.action("timeline.togg le-recording"); |
52 | 52 |
53 // Create models. | 53 // Create models. |
54 this._tracingModelBackingStorage = new WebInspector.TempFileBackingStorage(" tracing"); | 54 this._tracingModelBackingStorage = new WebInspector.TempFileBackingStorage(" tracing"); |
55 this._tracingModel = new WebInspector.TracingModel(this._tracingModelBacking Storage); | 55 this._tracingModel = new WebInspector.TracingModel(this._tracingModelBacking Storage); |
56 this._model = new WebInspector.TimelineModel(WebInspector.TimelineUIUtils.vi sibleEventsFilter()); | 56 this._model = new WebInspector.TimelineModel(WebInspector.TimelineUIUtils.vi sibleEventsFilter()); |
57 this._frameModel = new WebInspector.TracingTimelineFrameModel(); | 57 this._frameModel = new WebInspector.TracingTimelineFrameModel(); |
58 if (Runtime.experiments.isEnabled("timelineLatencyInfo")) | 58 if (Runtime.experiments.isEnabled("timelineLatencyInfo")) |
59 this._irModel = new WebInspector.TimelineIRModel(); | 59 this._irModel = new WebInspector.TimelineIRModel(); |
60 | 60 |
61 this._controller = new WebInspector.TimelineController(this, this._tracingMo del); | |
62 | |
63 if (Runtime.experiments.isEnabled("cpuThrottling")) | 61 if (Runtime.experiments.isEnabled("cpuThrottling")) |
64 this._cpuThrottlingManager = new WebInspector.CPUThrottlingManager(); | 62 this._cpuThrottlingManager = new WebInspector.CPUThrottlingManager(); |
65 | 63 |
66 /** @type {!Array.<!WebInspector.TimelineModeView>} */ | 64 /** @type {!Array.<!WebInspector.TimelineModeView>} */ |
67 this._currentViews = []; | 65 this._currentViews = []; |
68 | 66 |
69 this._viewModeSetting = WebInspector.settings.createSetting("timelineViewMod e", WebInspector.TimelinePanel.ViewMode.FlameChart); | 67 this._viewModeSetting = WebInspector.settings.createSetting("timelineViewMod e", WebInspector.TimelinePanel.ViewMode.FlameChart); |
70 this._captureNetworkSetting = WebInspector.settings.createSetting("timelineC aptureNetwork", false); | 68 this._captureNetworkSetting = WebInspector.settings.createSetting("timelineC aptureNetwork", false); |
71 this._captureJSProfileSetting = WebInspector.settings.createSetting("timelin eEnableJSSampling", true); | 69 this._captureJSProfileSetting = WebInspector.settings.createSetting("timelin eEnableJSSampling", true); |
72 this._captureMemorySetting = WebInspector.settings.createSetting("timelineCa ptureMemory", false); | 70 this._captureMemorySetting = WebInspector.settings.createSetting("timelineCa ptureMemory", false); |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
602 * @param {!WebInspector.ToolbarButton} toolbarButton | 600 * @param {!WebInspector.ToolbarButton} toolbarButton |
603 */ | 601 */ |
604 function handler(toolbarButton) | 602 function handler(toolbarButton) |
605 { | 603 { |
606 toolbarButton.setEnabled(enabled); | 604 toolbarButton.setEnabled(enabled); |
607 } | 605 } |
608 this._recordingOptionUIControls.forEach(handler); | 606 this._recordingOptionUIControls.forEach(handler); |
609 }, | 607 }, |
610 | 608 |
611 /** | 609 /** |
610 * @return {?WebInspector.TimelineController} | |
611 */ | |
612 _createController: function() | |
caseq
2016/03/17 21:28:22
let's inline this.
alph
2016/03/17 21:36:50
Done.
| |
613 { | |
614 var mainTarget = WebInspector.targetManager.mainTarget(); | |
615 return mainTarget ? new WebInspector.TimelineController(mainTarget, this , this._tracingModel) : null; | |
616 }, | |
617 | |
618 /** | |
612 * @param {boolean} userInitiated | 619 * @param {boolean} userInitiated |
613 */ | 620 */ |
614 _startRecording: function(userInitiated) | 621 _startRecording: function(userInitiated) |
615 { | 622 { |
616 console.assert(!this._statusPane, "Status pane is already opened."); | 623 console.assert(!this._statusPane, "Status pane is already opened."); |
624 this._controller = this._createController(); | |
625 if (!this._controller) | |
626 return; | |
617 this._setState(WebInspector.TimelinePanel.State.StartPending); | 627 this._setState(WebInspector.TimelinePanel.State.StartPending); |
618 this._showRecordingStarted(); | 628 this._showRecordingStarted(); |
619 | 629 |
620 this._autoRecordGeneration = userInitiated ? null : Symbol("Generation") ; | 630 this._autoRecordGeneration = userInitiated ? null : Symbol("Generation") ; |
621 this._controller.startRecording(true, this._captureJSProfileSetting.get( ), this._captureMemorySetting.get(), this._captureLayersAndPicturesSetting.get() , this._captureFilmStripSetting && this._captureFilmStripSetting.get()); | 631 this._controller.startRecording(true, this._captureJSProfileSetting.get( ), this._captureMemorySetting.get(), this._captureLayersAndPicturesSetting.get() , this._captureFilmStripSetting && this._captureFilmStripSetting.get()); |
622 | 632 |
623 for (var i = 0; i < this._overviewControls.length; ++i) | 633 for (var i = 0; i < this._overviewControls.length; ++i) |
624 this._overviewControls[i].timelineStarted(); | 634 this._overviewControls[i].timelineStarted(); |
625 | 635 |
626 if (userInitiated) | 636 if (userInitiated) |
627 WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action .TimelineStarted); | 637 WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action .TimelineStarted); |
628 this._setUIControlsEnabled(false); | 638 this._setUIControlsEnabled(false); |
629 this._hideRecordingHelpMessage(); | 639 this._hideRecordingHelpMessage(); |
630 }, | 640 }, |
631 | 641 |
632 _stopRecording: function() | 642 _stopRecording: function() |
633 { | 643 { |
634 if (this._statusPane) { | 644 if (this._statusPane) { |
635 this._statusPane.finish(); | 645 this._statusPane.finish(); |
636 this._statusPane.updateStatus(WebInspector.UIString("Stopping timeli ne\u2026")); | 646 this._statusPane.updateStatus(WebInspector.UIString("Stopping timeli ne\u2026")); |
637 this._statusPane.updateProgressBar(WebInspector.UIString("Received") , 0); | 647 this._statusPane.updateProgressBar(WebInspector.UIString("Received") , 0); |
638 } | 648 } |
639 this._setState(WebInspector.TimelinePanel.State.StopPending); | 649 this._setState(WebInspector.TimelinePanel.State.StopPending); |
640 this._autoRecordGeneration = null; | 650 this._autoRecordGeneration = null; |
641 this._controller.stopRecording(); | 651 this._controller.stopRecording(); |
652 this._controller = null; | |
642 this._setUIControlsEnabled(true); | 653 this._setUIControlsEnabled(true); |
643 }, | 654 }, |
644 | 655 |
645 _onSuspendStateChanged: function() | 656 _onSuspendStateChanged: function() |
646 { | 657 { |
647 this._updateTimelineControls(); | 658 this._updateTimelineControls(); |
648 }, | 659 }, |
649 | 660 |
650 _updateTimelineControls: function() | 661 _updateTimelineControls: function() |
651 { | 662 { |
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2200 * @override | 2211 * @override |
2201 * @param {!WebInspector.Target} target | 2212 * @param {!WebInspector.Target} target |
2202 */ | 2213 */ |
2203 targetRemoved: function(target) | 2214 targetRemoved: function(target) |
2204 { | 2215 { |
2205 this._targets.remove(target, true); | 2216 this._targets.remove(target, true); |
2206 }, | 2217 }, |
2207 | 2218 |
2208 __proto__: WebInspector.Object.prototype | 2219 __proto__: WebInspector.Object.prototype |
2209 } | 2220 } |
OLD | NEW |