Bug 1401002 - [1.1] Don't override chrome window type with default argument value. r=tromey
authorEugen Sawin <esawin@mozilla.com>
Mon, 18 Sep 2017 22:09:37 +0200
changeset 383197 505c1e22424aa59809ccf33cec9bf1d20d784c2a
parent 383196 c845865489652eadaa3f9a12736c1db56c0e6f12
child 383198 cbc29f3fed8860014a4bd9b77a0f4a68202c3457
push id52137
push userarchaeopteryx@coole-files.de
push dateWed, 27 Sep 2017 09:50:17 +0000
treeherderautoland@f4c8f9555488 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstromey
bugs1401002
milestone58.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 1401002 - [1.1] Don't override chrome window type with default argument value. r=tromey
devtools/server/main.js
--- a/devtools/server/main.js
+++ b/devtools/server/main.js
@@ -162,17 +162,17 @@ var DebuggerServer = {
   LONG_STRING_INITIAL_LENGTH: 1000,
   LONG_STRING_READ_LENGTH: 65 * 1024,
 
   /**
    * The windowtype of the chrome window to use for actors that use the global
    * window (i.e the global style editor). Set this to your main window type,
    * for example "navigator:browser".
    */
-  chromeWindowType: null,
+  chromeWindowType: "navigator:browser",
 
   /**
    * Allow debugging chrome of (parent or child) processes.
    */
   allowChromeProcess: false,
 
   /**
    * We run a special server in child process whose main actor is an instance
@@ -261,21 +261,23 @@ var DebuggerServer = {
    * @param tab boolean
    *        Registers all the tab actors like console, script, ... all useful
    *        for debugging a target context.
    * @param windowType string
    *        "windowtype" attribute of the main chrome windows. Used by some
    *        actors to retrieve them.
    */
   registerActors({ root = true, browser = true, tab = true,
-                   windowType = "navigator:browser" }) {
-    this.chromeWindowType = windowType;
+                   windowType = null }) {
+    if (windowType) {
+      this.chromeWindowType = windowType;
+    }
 
     if (browser) {
-      this.addBrowserActors(windowType);
+      this.addBrowserActors(this.chromeWindowType);
     }
 
     if (root) {
       this.registerModule("devtools/server/actors/webbrowser");
     }
 
     if (tab) {
       this.addTabActors();
@@ -415,18 +417,20 @@ var DebuggerServer = {
    *
    * /!\ Be careful when adding a new actor, especially global actors.
    * Any new global actor will be exposed and returned by the root actor.
    *
    * That's the reason why tab actors aren't loaded on demand via
    * restrictPrivileges=true, to prevent exposing them on b2g parent process's
    * root actor.
    */
-  addBrowserActors(windowType = "navigator:browser", restrictPrivileges = false) {
-    this.chromeWindowType = windowType;
+  addBrowserActors(windowType = null, restrictPrivileges = false) {
+    if (windowType) {
+      this.chromeWindowType = windowType;
+    }
     this.registerModule("devtools/server/actors/webbrowser");
 
     if (!restrictPrivileges) {
       this.addTabActors();
       this.registerModule("devtools/server/actors/preference", {
         prefix: "preference",
         constructor: "PreferenceActor",
         type: { global: true }