Skip to content

Instantly share code, notes, and snippets.

@jasonLaster
Created November 27, 2018 19:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonLaster/eeed44d2092da1c9a0a3807b952b71c0 to your computer and use it in GitHub Desktop.
Save jasonLaster/eeed44d2092da1c9a0a3807b952b71c0 to your computer and use it in GitHub Desktop.
commit 3f9e1c41ec518f36a1283efc6b549c436ac542df
Author: Jason Laster <jlaster@mozilla.com>
Date: Mon Nov 26 18:24:27 2018 -0500
Bug 1510048 - Player UI Updates. r=dwalsh
Tags: #secure-revision
Bug #: 1510048
Differential Revision: https://phabricator.services.mozilla.com/D13017
diff --git a/devtools/client/framework/toolbox.js b/devtools/client/framework/toolbox.js
index ae94194f6efd..203e92decc9a 100644
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -64,6 +64,10 @@ loader.lazyRequireGetter(this, "sortPanelDefinitions",
"devtools/client/framework/toolbox-tabs-order-manager", true);
loader.lazyRequireGetter(this, "createEditContextMenu",
"devtools/client/framework/toolbox-context-menu", true);
+loader.lazyGetter(this, "reloadAndRecordTab",
+ () => require("devtools/client/webreplay/menu.js").reloadAndRecordTab);
+loader.lazyGetter(this, "reloadAndStopRecordingTab",
+ () => require("devtools/client/webreplay/menu.js").reloadAndStopRecordingTab);
loader.lazyGetter(this, "domNodeConstants", () => {
return require("devtools/shared/dom-node-constants");
@@ -2179,7 +2183,6 @@ Toolbox.prototype = {
reloadTarget: function(force) {
if (this.target.canRewind) {
// Recording tabs need to be reloaded in a new content process.
- const { reloadAndRecordTab } = require("devtools/client/webreplay/menu");
reloadAndRecordTab();
} else {
this.target.activeTab.reload({ force: force });
@@ -2837,6 +2840,10 @@ Toolbox.prototype = {
// toolbox closing we need to handle it here instead.
this.telemetry.toolClosed(this.currentToolId, this.sessionId, this);
+ const shouldStopRecording = Services.prefs.getBoolPref("devtools.recordreplay.mvp.enabled")
+ && this._target.canRewind
+ && this._target.isLocalTab;
+
this._lastFocusedElement = null;
if (this._sourceMapURLService) {
@@ -2970,6 +2977,10 @@ Toolbox.prototype = {
this._win = null;
this._toolPanels.clear();
+ // if (shouldStopRecording) {
+ // reloadAndStopRecordingTab();
+ // }
+
// Force GC to prevent long GC pauses when running tests and to free up
// memory in general when the toolbox is closed.
if (flags.testing) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment