Changeset 241982 in webkit
- Timestamp:
- Feb 22, 2019 8:17:58 PM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r241981 r241982 1 2019-02-22 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Timelines: add UI for preventing auto-stop 4 https://bugs.webkit.org/show_bug.cgi?id=194956 5 6 Reviewed by Joseph Pecoraro. 7 8 Add a checkbox to the navigation area of the Timelines tab that controls whether recordings 9 automatically stop (e.g. after "load" or a period of inactivity). 10 11 * UserInterface/Views/TimelineRecordingContentView.js: 12 (WI.TimelineRecordingContentView): 13 (WI.TimelineRecordingContentView.prototype.get navigationItems): 14 (WI.TimelineRecordingContentView.prototype._handleAutoStopCheckboxCheckedDidChange): Added. 15 (WI.TimelineRecordingContentView.prototype._handleTimelinesAutoStopSettingChanged): Added. 16 17 * UserInterface/Controllers/TimelineManager.js: 18 (WI.TimelineManager): 19 (WI.TimelineManager.prototype.capturingStopped): 20 (WI.TimelineManager.prototype._stopAutoRecordingSoon): 21 (WI.TimelineManager.prototype._resetAutoRecordingMaxTimeTimeout): 22 (WI.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout): 23 (WI.TimelineManager.prototype._handleTimelinesAutoStopSettingChanged): 24 25 * UserInterface/Base/Setting.js: 26 * Localizations/en.lproj/localizedStrings.js: 27 1 28 2019-02-22 Devin Rousso <drousso@apple.com> 2 29 -
trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
r241750 r241982 939 939 localizedStrings["Stop recording (%s)"] = "Stop recording (%s)"; 940 940 localizedStrings["Stop recording canvas actions"] = "Stop recording canvas actions"; 941 localizedStrings["Stop recording once page loads"] = "Stop recording once page loads"; 941 942 localizedStrings["Stopping the \u201C%s\u201D audit"] = "Stopping the \u201C%s\u201D audit"; 942 943 localizedStrings["Storage"] = "Storage"; -
trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js
r241633 r241982 151 151 showWhitespaceCharacters: new WI.Setting("show-whitespace-characters", false), 152 152 tabSize: new WI.Setting("tab-size", 4), 153 timelinesAutoStop: new WI.Setting("timelines-auto-stop", true), 153 154 zoomFactor: new WI.Setting("zoom-factor", 1), 154 155 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js
r241750 r241982 40 40 WI.memoryManager.addEventListener(WI.MemoryManager.Event.MemoryPressure, this._memoryPressure, this); 41 41 42 WI.settings.timelinesAutoStop.addEventListener(WI.Setting.Event.Changed, this._handleTimelinesAutoStopSettingChanged, this); 43 42 44 this._enabledTimelineTypesSetting = new WI.Setting("enabled-instrument-types", WI.TimelineManager.defaultTimelineTypes()); 43 45 … … 305 307 WI.DOMNode.removeEventListener(null, null, this); 306 308 307 if (this._stopCapturingTimeout) { 308 clearTimeout(this._stopCapturingTimeout); 309 this._stopCapturingTimeout = undefined; 310 } 311 312 if (this._deadTimeTimeout) { 313 clearTimeout(this._deadTimeTimeout); 314 this._deadTimeTimeout = undefined; 315 } 309 this.relaxAutoStop(); 316 310 317 311 this._isCapturing = false; … … 848 842 _stopAutoRecordingSoon() 849 843 { 844 if (!WI.settings.timelinesAutoStop.value) 845 return; 846 850 847 // Only auto stop when auto capturing. 851 848 if (!this._isCapturing || !this._mainResourceForAutoCapturing) … … 859 856 _resetAutoRecordingMaxTimeTimeout() 860 857 { 858 if (!WI.settings.timelinesAutoStop.value) 859 return; 860 861 861 if (this._stopCapturingTimeout) 862 862 clearTimeout(this._stopCapturingTimeout); … … 866 866 _resetAutoRecordingDeadTimeTimeout() 867 867 { 868 if (!WI.settings.timelinesAutoStop.value) 869 return; 870 868 871 // Only monitor dead time when auto capturing. 869 872 if (!this._isCapturing || !this._mainResourceForAutoCapturing) … … 947 950 948 951 this.activeRecording.addMemoryPressureEvent(event.data.memoryPressureEvent); 952 } 953 954 _handleTimelinesAutoStopSettingChanged(event) 955 { 956 if (!this._isCapturing) 957 return; 958 959 if (WI.settings.timelinesAutoStop.value) 960 this._resetAutoRecordingMaxTimeTimeout(); 961 else 962 this.relaxAutoStop(); 949 963 } 950 964 -
trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js
r241953 r241982 57 57 this.addSubview(this._timelineContentBrowser); 58 58 59 this._autoStopCheckboxNavigationItem = new WI.CheckboxNavigationItem("auto-stop-recording", WI.UIString("Stop recording once page loads"), WI.settings.timelinesAutoStop.value); 60 this._autoStopCheckboxNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; 61 this._autoStopCheckboxNavigationItem.addEventListener(WI.CheckboxNavigationItem.Event.CheckedDidChange, this._handleAutoStopCheckboxCheckedDidChange, this); 62 63 WI.settings.timelinesAutoStop.addEventListener(WI.Setting.Event.Changed, this._handleTimelinesAutoStopSettingChanged, this); 64 59 65 this._clearTimelineNavigationItem = new WI.ButtonNavigationItem("clear-timeline", WI.UIString("Clear Timeline (%s)").format(WI.clearKeyboardShortcut.displayName), "Images/NavigationItemTrash.svg", 15, 15); 60 66 this._clearTimelineNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; … … 153 159 get navigationItems() 154 160 { 155 return [this._clearTimelineNavigationItem]; 161 return [ 162 this._autoStopCheckboxNavigationItem, 163 new WI.DividerNavigationItem, 164 this._clearTimelineNavigationItem, 165 ]; 156 166 } 157 167 … … 535 545 this._recording.removeEventListener(WI.TimelineRecording.Event.TimesUpdated, this._recordingTimesUpdated, this); 536 546 this._waitingToResetCurrentTime = false; 547 } 548 549 _handleAutoStopCheckboxCheckedDidChange(event) 550 { 551 WI.settings.timelinesAutoStop.value = this._autoStopCheckboxNavigationItem.checked; 552 } 553 554 _handleTimelinesAutoStopSettingChanged(event) 555 { 556 this._autoStopCheckboxNavigationItem.checked = WI.settings.timelinesAutoStop.value; 537 557 } 538 558
Note: See TracChangeset
for help on using the changeset viewer.