Bug 1170495 - Let the debugger server started by GCLI debug chrome code. r=ochameau, r=jwalker, a=lizzard
authorPanos Astithas <past@mozilla.com>
Tue, 02 Jun 2015 14:01:37 +0300
changeset 266219 ffc4a84bbcdf
parent 266218 35fad3eed522
child 266220 d999d29c8062
push id4792
push userryanvm@gmail.com
push date2015-06-10 20:30 +0000
treeherdermozilla-beta@f137fedd1455 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau, jwalker, lizzard
bugs1170495
milestone39.0
Bug 1170495 - Let the debugger server started by GCLI debug chrome code. r=ochameau, r=jwalker, a=lizzard
toolkit/devtools/gcli/commands/listen.js
toolkit/devtools/gcli/source/lib/gcli/l10n.js
--- a/toolkit/devtools/gcli/commands/listen.js
+++ b/toolkit/devtools/gcli/commands/listen.js
@@ -24,16 +24,17 @@ XPCOMUtils.defineLazyGetter(this, "debug
   // serverLoader as invisible to the debugger (unlike the usual loader
   // settings).
   let serverLoader = new DevToolsLoader();
   serverLoader.invisibleToDebugger = true;
   serverLoader.main("devtools/server/main");
   let debuggerServer = serverLoader.DebuggerServer;
   debuggerServer.init();
   debuggerServer.addBrowserActors();
+  debuggerServer.allowChromeProcess = !l10n.hiddenByChromePref();
   return debuggerServer;
 });
 
 exports.items = [
   {
     name: "listen",
     description: gcli.lookup("listenDesc"),
     manual: gcli.lookupFormat("listenManual2", [ BRAND_SHORT_NAME ]),
--- a/toolkit/devtools/gcli/source/lib/gcli/l10n.js
+++ b/toolkit/devtools/gcli/source/lib/gcli/l10n.js
@@ -17,17 +17,17 @@
 'use strict';
 
 var Cc = require('chrome').Cc;
 var Ci = require('chrome').Ci;
 var Cu = require('chrome').Cu;
 
 var prefSvc = Cc['@mozilla.org/preferences-service;1']
                         .getService(Ci.nsIPrefService);
-var prefBranch = prefSvc.getBranch(null).QueryInterface(Ci.nsIPrefBranch2);
+var prefBranch = prefSvc.getBranch(null).QueryInterface(Ci.nsIPrefBranch);
 
 var Services = Cu.import('resource://gre/modules/Services.jsm', {}).Services;
 var stringBundle = Services.strings.createBundle(
         'chrome://browser/locale/devtools/gclicommands.properties');
 
 /**
  * Lookup a string in the GCLI string bundle
  */
@@ -70,10 +70,10 @@ exports.lookupFormat = function(name, sw
  * Use it in commands like this:
  * <pre>
  *   name: "somecommand",
  *   hidden: l10n.hiddenByChromePref(),
  *   exec: function(args, context) { ... }
  * </pre>
  */
 exports.hiddenByChromePref = function() {
-  return !prefBranch.prefHasUserValue('devtools.chrome.enabled');
+  return !prefBranch.getBoolPref('devtools.chrome.enabled');
 };