WebKit Bugzilla
Attachment 362739 Details for
Bug 194956
: Web Inspector: Timelines: add UI for preventing auto-stop
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194956-20190222120022.patch (text/plain), 9.08 KB, created by
Devin Rousso
on 2019-02-22 12:00:23 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2019-02-22 12:00:23 PST
Size:
9.08 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index fce7a3e86b94317037527189770742a439698881..3fb5680a33e01117141a68d82d905e1a2a305d0a 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,30 @@ >+2019-02-22 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Timelines: add UI for preventing auto-stop >+ https://bugs.webkit.org/show_bug.cgi?id=194956 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a checkbox to the navigation area of the Timelines tab that controls whether recordings >+ automatically stop (e.g. after "load" or a period of inactivity). >+ >+ * UserInterface/Views/TimelineRecordingContentView.js: >+ (WI.TimelineRecordingContentView): >+ (WI.TimelineRecordingContentView.prototype.get navigationItems): >+ (WI.TimelineRecordingContentView.prototype._handleAutoStopCheckboxCheckedDidChange): Added. >+ (WI.TimelineRecordingContentView.prototype._handleTimelinesAutoStopSettingChanged): Added. >+ >+ * UserInterface/Controllers/TimelineManager.js: >+ (WI.TimelineManager): >+ (WI.TimelineManager.prototype.capturingStopped): >+ (WI.TimelineManager.prototype._stopAutoRecordingSoon): >+ (WI.TimelineManager.prototype._resetAutoRecordingMaxTimeTimeout): >+ (WI.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout): >+ (WI.TimelineManager.prototype._handleTimelinesAutoStopSettingChanged): >+ >+ * UserInterface/Base/Setting.js: >+ * Localizations/en.lproj/localizedStrings.js: >+ > 2019-02-21 Devin Rousso <drousso@apple.com> > > Web Inspector: Canvas: recordings with a single frame sometimes missing TreeElement >diff --git a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >index e938ebadb70c04114fa17009e593f3115554eff7..2b5829a862948961052ce7df47b75dc00806e3fb 100644 >--- a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >+++ b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >@@ -937,6 +937,7 @@ localizedStrings["Stop Recording"] = "Stop Recording"; > localizedStrings["Stop element selection (%s)"] = "Stop element selection (%s)"; > localizedStrings["Stop recording"] = "Stop recording"; > localizedStrings["Stop recording (%s)"] = "Stop recording (%s)"; >+localizedStrings["Stop recording after load"] = "Stop recording after load"; > localizedStrings["Stop recording canvas actions"] = "Stop recording canvas actions"; > localizedStrings["Stopping the \u201C%s\u201D audit"] = "Stopping the \u201C%s\u201D audit"; > localizedStrings["Storage"] = "Storage"; >diff --git a/Source/WebInspectorUI/UserInterface/Base/Setting.js b/Source/WebInspectorUI/UserInterface/Base/Setting.js >index c5ee29256fcd5adab2094f7f61ac585df6e41e56..2b02ae46a93d0e2e67e7f90c4df63adba3a6208e 100644 >--- a/Source/WebInspectorUI/UserInterface/Base/Setting.js >+++ b/Source/WebInspectorUI/UserInterface/Base/Setting.js >@@ -150,6 +150,7 @@ WI.settings = { > showShadowDOM: new WI.Setting("show-shadow-dom", false), > showWhitespaceCharacters: new WI.Setting("show-whitespace-characters", false), > tabSize: new WI.Setting("tab-size", 4), >+ timelinesAutoStop: new WI.Setting("timelines-auto-stop", true), > zoomFactor: new WI.Setting("zoom-factor", 1), > > // Experimental >diff --git a/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js b/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >index 8ca9d97ba4306ad142ff05376ed5372c62b74b64..4d44ed62827e264345be67fc357b89ab06fef4ae 100644 >--- a/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >+++ b/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js >@@ -39,6 +39,8 @@ WI.TimelineManager = class TimelineManager extends WI.Object > WI.heapManager.addEventListener(WI.HeapManager.Event.GarbageCollected, this._garbageCollected, this); > WI.memoryManager.addEventListener(WI.MemoryManager.Event.MemoryPressure, this._memoryPressure, this); > >+ WI.settings.timelinesAutoStop.addEventListener(WI.Setting.Event.Changed, this._handleTimelinesAutoStopSettingChanged, this); >+ > this._enabledTimelineTypesSetting = new WI.Setting("enabled-instrument-types", WI.TimelineManager.defaultTimelineTypes()); > > this._isCapturing = false; >@@ -304,15 +306,7 @@ WI.TimelineManager = class TimelineManager extends WI.Object > > WI.DOMNode.removeEventListener(null, null, this); > >- if (this._stopCapturingTimeout) { >- clearTimeout(this._stopCapturingTimeout); >- this._stopCapturingTimeout = undefined; >- } >- >- if (this._deadTimeTimeout) { >- clearTimeout(this._deadTimeTimeout); >- this._deadTimeTimeout = undefined; >- } >+ this.relaxAutoStop(); > > this._isCapturing = false; > this._isCapturingPageReload = false; >@@ -847,6 +841,9 @@ WI.TimelineManager = class TimelineManager extends WI.Object > > _stopAutoRecordingSoon() > { >+ if (!WI.settings.timelinesAutoStop.value) >+ return; >+ > // Only auto stop when auto capturing. > if (!this._isCapturing || !this._mainResourceForAutoCapturing) > return; >@@ -858,6 +855,9 @@ WI.TimelineManager = class TimelineManager extends WI.Object > > _resetAutoRecordingMaxTimeTimeout() > { >+ if (!WI.settings.timelinesAutoStop.value) >+ return; >+ > if (this._stopCapturingTimeout) > clearTimeout(this._stopCapturingTimeout); > this._stopCapturingTimeout = setTimeout(this._boundStopCapturing, WI.TimelineManager.MaximumAutoRecordDuration); >@@ -865,6 +865,9 @@ WI.TimelineManager = class TimelineManager extends WI.Object > > _resetAutoRecordingDeadTimeTimeout() > { >+ if (!WI.settings.timelinesAutoStop.value) >+ return; >+ > // Only monitor dead time when auto capturing. > if (!this._isCapturing || !this._mainResourceForAutoCapturing) > return; >@@ -948,6 +951,14 @@ WI.TimelineManager = class TimelineManager extends WI.Object > this.activeRecording.addMemoryPressureEvent(event.data.memoryPressureEvent); > } > >+ _handleTimelinesAutoStopSettingChanged(event) >+ { >+ if (WI.settings.timelinesAutoStop.value) >+ this._resetAutoRecordingMaxTimeTimeout(); >+ else >+ this.relaxAutoStop(); >+ } >+ > _scriptProfilerTypeToScriptTimelineRecordType(type) > { > switch (type) { >diff --git a/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js b/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js >index 4c70505926bdbeb3d86675461367f597269b012e..ecfd59241b6a99fa9147b202626adb50ab199a69 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js >@@ -56,6 +56,12 @@ WI.TimelineRecordingContentView = class TimelineRecordingContentView extends WI. > this._timelineContentBrowser.navigationBar.addNavigationItem(this._filterBarNavigationItem); > this.addSubview(this._timelineContentBrowser); > >+ this._autoStopCheckboxNavigationItem = new WI.CheckboxNavigationItem("auto-stop-recording", WI.UIString("Stop recording after load"), WI.settings.timelinesAutoStop.value); >+ this._autoStopCheckboxNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; >+ this._autoStopCheckboxNavigationItem.addEventListener(WI.CheckboxNavigationItem.Event.CheckedDidChange, this._handleAutoStopCheckboxCheckedDidChange, this); >+ >+ WI.settings.timelinesAutoStop.addEventListener(WI.Setting.Event.Changed, this._handleTimelinesAutoStopSettingChanged, this); >+ > this._clearTimelineNavigationItem = new WI.ButtonNavigationItem("clear-timeline", WI.UIString("Clear Timeline (%s)").format(WI.clearKeyboardShortcut.displayName), "Images/NavigationItemTrash.svg", 15, 15); > this._clearTimelineNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; > this._clearTimelineNavigationItem.addEventListener(WI.ButtonNavigationItem.Event.Clicked, this._clearTimeline, this); >@@ -152,7 +158,11 @@ WI.TimelineRecordingContentView = class TimelineRecordingContentView extends WI. > > get navigationItems() > { >- return [this._clearTimelineNavigationItem]; >+ return [ >+ this._autoStopCheckboxNavigationItem, >+ new WI.DividerNavigationItem, >+ this._clearTimelineNavigationItem, >+ ]; > } > > get handleCopyEvent() >@@ -555,6 +565,16 @@ WI.TimelineRecordingContentView = class TimelineRecordingContentView extends WI. > this._waitingToResetCurrentTime = false; > } > >+ _handleAutoStopCheckboxCheckedDidChange(event) >+ { >+ WI.settings.timelinesAutoStop.value = this._autoStopCheckboxNavigationItem.checked; >+ } >+ >+ _handleTimelinesAutoStopSettingChanged(event) >+ { >+ this._autoStopCheckboxNavigationItem.checked = WI.settings.timelinesAutoStop.value; >+ } >+ > _clearTimeline(event) > { > if (WI.timelineManager.activeRecording === this._recording && WI.timelineManager.isCapturing())
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194956
:
362739
|
362748
|
362749