Bug 1467679 - Clear the devtools.toolbox.host value if this value is unexpected. rgl
☠☠ backed out by 5a6ef0a517fa ☠ ☠
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Fri, 08 Jun 2018 13:18:54 +0900
changeset 478733 120a4d4dced81e390d3d25dba18004ad8a0a544d
parent 478732 2ed797e0a24ef9150170f92f0f2936b7a8d771e3
child 478734 d2da1fe0c939cb2f381fabe1198a7b3ebb2d7016
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1467679, 1192642
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1467679 - Clear the devtools.toolbox.host value if this value is unexpected. rgl Bug 1192642 introduced new host type. If updating to this version, previous preference value will be unexpected. This patch will restore this preference to default value if this pref is unexpected value. MozReview-Commit-ID: LO3R6fFHWh6
devtools/client/framework/toolbox-host-manager.js
devtools/client/framework/toolbox-hosts.js
--- a/devtools/client/framework/toolbox-host-manager.js
+++ b/devtools/client/framework/toolbox-host-manager.js
@@ -39,16 +39,21 @@ let ID_COUNTER = 1;
 
 function ToolboxHostManager(target, hostType, hostOptions) {
   this.target = target;
 
   this.frameId = ID_COUNTER++;
 
   if (!hostType) {
     hostType = Services.prefs.getCharPref(LAST_HOST);
+    if (!Hosts[hostType]) {
+      // If the preference value is unexpected, restore to the default value.
+      Services.prefs.clearUserPref(LAST_HOST);
+      hostType = Services.prefs.getCharPref(LAST_HOST);
+    }
   }
   this.host = this.createHost(hostType, hostOptions);
   this.hostType = hostType;
 }
 
 ToolboxHostManager.prototype = {
   async create(toolId) {
     await this.host.create();
--- a/devtools/client/framework/toolbox-hosts.js
+++ b/devtools/client/framework/toolbox-hosts.js
@@ -121,17 +121,17 @@ BottomHost.prototype = {
 };
 
 /**
  * Base Host object for the in-browser sidebar
  */
 class SidebarHost {
   constructor(hostTab, hostType) {
     this.hostTab = hostTab;
-    this.type = hostType;
+    this.hostType = hostType;
     this.widthPref = "devtools.toolbox.sidebar.width";
 
     EventEmitter.decorate(this);
   }
 
   /**
    * Create a box in the sidebar of the host tab.
    */