Bug 820463 - Revert early-loading changes, r=mdas

This commit is contained in:
Jonathan Griffin 2012-12-17 15:18:58 -08:00
Родитель f665c1eb63
Коммит 8db12ba218
1 изменённых файлов: 5 добавлений и 13 удалений

Просмотреть файл

@ -8,7 +8,6 @@ const MARIONETTE_CONTRACTID = "@mozilla.org/marionette;1";
const MARIONETTE_CID = Components.ID("{786a1369-dca5-4adc-8486-33d23c88010a}"); const MARIONETTE_CID = Components.ID("{786a1369-dca5-4adc-8486-33d23c88010a}");
const DEBUGGER_ENABLED_PREF = 'devtools.debugger.remote-enabled'; const DEBUGGER_ENABLED_PREF = 'devtools.debugger.remote-enabled';
const MARIONETTE_ENABLED_PREF = 'marionette.defaultPrefs.enabled'; const MARIONETTE_ENABLED_PREF = 'marionette.defaultPrefs.enabled';
const MARIONETTE_LOADEARLY_PREF = 'marionette.loadearly';
const DEBUGGER_FORCELOCAL_PREF = 'devtools.debugger.force-local'; const DEBUGGER_FORCELOCAL_PREF = 'devtools.debugger.force-local';
const MARIONETTE_FORCELOCAL_PREF = 'marionette.force-local'; const MARIONETTE_FORCELOCAL_PREF = 'marionette.force-local';
@ -57,30 +56,23 @@ MarionetteComponent.prototype = {
case "profile-after-change": case "profile-after-change":
let appName = Services.appinfo.name; let appName = Services.appinfo.name;
let enabled = false; let enabled = false;
let loadearly = appName == 'B2G' ? false : true;
try { try {
enabled = Services.prefs.getBoolPref(MARIONETTE_ENABLED_PREF); enabled = Services.prefs.getBoolPref(MARIONETTE_ENABLED_PREF);
loadearly = Services.prefs.getBoolPref(MARIONETTE_LOADEARLY_PREF);
} catch(e) {} } catch(e) {}
if (enabled) { if (enabled) {
this.logger.info("marionette enabled, loadearly: " + loadearly); this.logger.info("marionette enabled");
//add observers //add observers
if (loadearly) { observerService.addObserver(this, "final-ui-startup", false);
observerService.addObserver(this, "final-ui-startup", false);
}
else {
observerService.addObserver(this, "system-message-listener-ready", false);
}
observerService.addObserver(this, "xpcom-shutdown", false); observerService.addObserver(this, "xpcom-shutdown", false);
} }
else { else {
this.logger.info("marionette not enabled"); this.logger.info("marionette not enabled");
} }
break; break;
case "system-message-listener-ready": case "final-ui-startup":
this.logger.info("marionette initializing at system-message-listener-ready"); this.logger.info("marionette initializing at " + aTopic);
observerService.removeObserver(this, "system-message-listener-ready"); observerService.removeObserver(this, aTopic);
try { try {
this.original_forcelocal = Services.prefs.getBoolPref(DEBUGGER_FORCELOCAL_PREF); this.original_forcelocal = Services.prefs.getBoolPref(DEBUGGER_FORCELOCAL_PREF);