Bug 817580 - Pref off new webapps actor features until we secure remote debugger connection. r=paul.rouget
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 24 Jul 2013 11:29:04 -0400
changeset 139804 36323782eaa34b5638fc03fedab8aa0317259abc
parent 139803 738b7898b6c79352aa9a918c1fae0c5dd5c3531e
child 139805 6d1e2859bb49403cd38c1523d92042d9a1b739f0
push idunknown
push userunknown
push dateunknown
reviewerspaul
bugs817580
milestone25.0a1
Bug 817580 - Pref off new webapps actor features until we secure remote debugger connection. r=paul.rouget
b2g/chrome/content/shell.js
modules/libpref/src/init/all.js
toolkit/devtools/server/actors/webapps.js
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -972,24 +972,29 @@ let RemoteDebugger = {
   },
 
   // Start the debugger server.
   start: function debugger_start() {
     if (!DebuggerServer.initialized) {
       // Ask for remote connections.
       DebuggerServer.init(this.prompt.bind(this));
       DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/webbrowser.js");
-      DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/script.js");
-      DebuggerServer.addGlobalActor(DebuggerServer.ChromeDebuggerActor, "chromeDebugger");
-      DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/webconsole.js");
-      DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/gcli.js");
-      if ("nsIProfiler" in Ci) {
-        DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/profiler.js");
+      // Until we implement unix domain socket, we enable content actors
+      // only on development devices
+      if (Services.prefs.getBoolPref("devtools.debugger.enable-content-actors")) {
+        DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/script.js");
+        DebuggerServer.addGlobalActor(DebuggerServer.ChromeDebuggerActor, "chromeDebugger");
+        DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/webconsole.js");
+        DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/gcli.js");
+        if ("nsIProfiler" in Ci) {
+          DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/profiler.js");
+        }
+        DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/styleeditor.js");
+        DebuggerServer.enableWebappsContentActor = true;
       }
-      DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/styleeditor.js");
       DebuggerServer.addActors('chrome://browser/content/dbg-browser-actors.js');
       DebuggerServer.addActors("resource://gre/modules/devtools/server/actors/webapps.js");
     }
 
     let port = Services.prefs.getIntPref('devtools.debugger.remote-port') || 6000;
     try {
       DebuggerServer.openListener(port);
     } catch (e) {
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -449,16 +449,19 @@ pref("devtools.errorconsole.deprecation_
 // Disable remote debugging protocol logging
 pref("devtools.debugger.log", false);
 // Disable remote debugging connections
 pref("devtools.debugger.remote-enabled", false);
 pref("devtools.debugger.remote-port", 6000);
 // Force debugger server binding on the loopback interface
 pref("devtools.debugger.force-local", true);
 
+// Temporary setting to enable webapps actors
+pref("devtools.debugger.enable-content-actors", false);
+
 // view source
 pref("view_source.syntax_highlight", true);
 pref("view_source.wrap_long_lines", false);
 pref("view_source.editor.external", false);
 pref("view_source.editor.path", "");
 // allows to add further arguments to the editor; use the %LINE% placeholder
 // for jumping to a specific line (e.g. "/line:%LINE%" or "--goto %LINE%")
 pref("view_source.editor.args", "");
--- a/toolkit/devtools/server/actors/webapps.js
+++ b/toolkit/devtools/server/actors/webapps.js
@@ -567,20 +567,26 @@ WebappsActor.prototype = {
     }
   }
 };
 
 /**
  * The request types this actor can handle.
  */
 WebappsActor.prototype.requestTypes = {
-  "install": WebappsActor.prototype.install,
-  "getAll": WebappsActor.prototype.getAll,
-  "launch": WebappsActor.prototype.launch,
-  "close": WebappsActor.prototype.close,
-  "uninstall": WebappsActor.prototype.uninstall,
-  "listRunningApps": WebappsActor.prototype.listRunningApps,
-  "getAppActor": WebappsActor.prototype.getAppActor,
-  "watchApps": WebappsActor.prototype.watchApps,
-  "unwatchApps": WebappsActor.prototype.unwatchApps
+  "install": WebappsActor.prototype.install
 };
 
+// Until we implement unix domain socket, we only enable app install
+// only on production devices
+if (Services.prefs.getBoolPref("devtools.debugger.enable-content-actors")) {
+  let requestTypes = WebappsActor.prototype.requestTypes;
+  requestTypes.getAll = WebappsActor.prototype.getAll;
+  requestTypes.launch = WebappsActor.prototype.launch;
+  requestTypes.close  = WebappsActor.prototype.close;
+  requestTypes.uninstall = WebappsActor.prototype.uninstall;
+  requestTypes.listRunningApps = WebappsActor.prototype.listRunningApps;
+  requestTypes.getAppActor = WebappsActor.prototype.getAppActor;
+  requestTypes.watchApps = WebappsActor.prototype.watchApps;
+  requestTypes.unwatchApps = WebappsActor.prototype.unwatchApps;
+}
+
 DebuggerServer.addGlobalActor(WebappsActor, "webappsActor");