- Revision
- 241982
- Author
- [email protected]
- Date
- 2019-02-22 20:17:58 -0800 (Fri, 22 Feb 2019)
Log Message
Web Inspector: Timelines: add UI for preventing auto-stop
https://bugs.webkit.org/show_bug.cgi?id=194956
Reviewed by Joseph Pecoraro.
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:
Modified Paths
Diff
Modified: trunk/Source/WebInspectorUI/ChangeLog (241981 => 241982)
--- trunk/Source/WebInspectorUI/ChangeLog 2019-02-23 04:10:00 UTC (rev 241981)
+++ trunk/Source/WebInspectorUI/ChangeLog 2019-02-23 04:17:58 UTC (rev 241982)
@@ -1,5 +1,32 @@
2019-02-22 Devin Rousso <[email protected]>
+ Web Inspector: Timelines: add UI for preventing auto-stop
+ https://bugs.webkit.org/show_bug.cgi?id=194956
+
+ Reviewed by Joseph Pecoraro.
+
+ 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-22 Devin Rousso <[email protected]>
+
REGRESSION(r?): Web Inspector: Popovers have inset shadows
https://bugs.webkit.org/show_bug.cgi?id=192963
<rdar://problem/46888679>
Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (241981 => 241982)
--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js 2019-02-23 04:10:00 UTC (rev 241981)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js 2019-02-23 04:17:58 UTC (rev 241982)
@@ -938,6 +938,7 @@
localizedStrings["Stop recording"] = "Stop recording";
localizedStrings["Stop recording (%s)"] = "Stop recording (%s)";
localizedStrings["Stop recording canvas actions"] = "Stop recording canvas actions";
+localizedStrings["Stop recording once page loads"] = "Stop recording once page loads";
localizedStrings["Stopping the \u201C%s\u201D audit"] = "Stopping the \u201C%s\u201D audit";
localizedStrings["Storage"] = "Storage";
localizedStrings["Style Attribute"] = "Style Attribute";
Modified: trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js (241981 => 241982)
--- trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js 2019-02-23 04:10:00 UTC (rev 241981)
+++ trunk/Source/WebInspectorUI/UserInterface/Base/Setting.js 2019-02-23 04:17:58 UTC (rev 241982)
@@ -150,6 +150,7 @@
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
Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js (241981 => 241982)
--- trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js 2019-02-23 04:10:00 UTC (rev 241981)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/TimelineManager.js 2019-02-23 04:17:58 UTC (rev 241982)
@@ -39,6 +39,8 @@
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,16 +306,8 @@
WI.DOMNode.removeEventListener(null, null, this);
- if (this._stopCapturingTimeout) {
- clearTimeout(this._stopCapturingTimeout);
- this._stopCapturingTimeout = undefined;
- }
+ this.relaxAutoStop();
- if (this._deadTimeTimeout) {
- clearTimeout(this._deadTimeTimeout);
- this._deadTimeTimeout = undefined;
- }
-
this._isCapturing = false;
this._isCapturingPageReload = false;
this._shouldSetAutoCapturingMainResource = false;
@@ -847,6 +841,9 @@
_stopAutoRecordingSoon()
{
+ if (!WI.settings.timelinesAutoStop.value)
+ return;
+
// Only auto stop when auto capturing.
if (!this._isCapturing || !this._mainResourceForAutoCapturing)
return;
@@ -858,6 +855,9 @@
_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 @@
_resetAutoRecordingDeadTimeTimeout()
{
+ if (!WI.settings.timelinesAutoStop.value)
+ return;
+
// Only monitor dead time when auto capturing.
if (!this._isCapturing || !this._mainResourceForAutoCapturing)
return;
@@ -948,6 +951,17 @@
this.activeRecording.addMemoryPressureEvent(event.data.memoryPressureEvent);
}
+ _handleTimelinesAutoStopSettingChanged(event)
+ {
+ if (!this._isCapturing)
+ return;
+
+ if (WI.settings.timelinesAutoStop.value)
+ this._resetAutoRecordingMaxTimeTimeout();
+ else
+ this.relaxAutoStop();
+ }
+
_scriptProfilerTypeToScriptTimelineRecordType(type)
{
switch (type) {
Modified: trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js (241981 => 241982)
--- trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js 2019-02-23 04:10:00 UTC (rev 241981)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/TimelineRecordingContentView.js 2019-02-23 04:17:58 UTC (rev 241982)
@@ -56,6 +56,12 @@
this._timelineContentBrowser.navigationBar.addNavigationItem(this._filterBarNavigationItem);
this.addSubview(this._timelineContentBrowser);
+ this._autoStopCheckboxNavigationItem = new WI.CheckboxNavigationItem("auto-stop-recording", WI.UIString("Stop recording once page loads"), 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 @@
get navigationItems()
{
- return [this._clearTimelineNavigationItem];
+ return [
+ this._autoStopCheckboxNavigationItem,
+ new WI.DividerNavigationItem,
+ this._clearTimelineNavigationItem,
+ ];
}
get handleCopyEvent()
@@ -536,6 +546,16 @@
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())