[or-cvs] r12559: Move observers before pref queries just in case.. (torbutton/trunk/src/components)
mikeperry at seul.org
mikeperry at seul.org
Fri Nov 23 11:45:28 UTC 2007
Author: mikeperry
Date: 2007-11-23 06:45:28 -0500 (Fri, 23 Nov 2007)
New Revision: 12559
Modified:
torbutton/trunk/src/components/cssblocker.js
torbutton/trunk/src/components/torbutton-logger.js
Log:
Move observers before pref queries just in case..
Modified: torbutton/trunk/src/components/cssblocker.js
===================================================================
--- torbutton/trunk/src/components/cssblocker.js 2007-11-23 11:43:52 UTC (rev 12558)
+++ torbutton/trunk/src/components/cssblocker.js 2007-11-23 11:45:28 UTC (rev 12559)
@@ -96,10 +96,6 @@
this.logger = Components.classes["@torproject.org/torbutton-logger;1"]
.getService(Components.interfaces.nsISupports).wrappedJSObject;
-
- this.isolate_content = this._prefs.getBoolPref("extensions.torbutton.isolate_content");
- this.tor_enabled = this._prefs.getBoolPref("extensions.torbutton.tor_enabled");
- this.no_tor_plugins = this._prefs.getBoolPref("extensions.torbutton.no_tor_plugins");
// Register observer: FIXME: Restrict this to extensions.torbutton branch?
var pref_service = Components.classes["@mozilla.org/preferences-service;1"]
@@ -107,7 +103,10 @@
this._branch = pref_service.QueryInterface(Components.interfaces.nsIPrefBranchInternal);
this._branch.addObserver("extensions.torbutton", this, false);
- dump("Content policy component initialized\n");
+ this.isolate_content = this._prefs.getBoolPref("extensions.torbutton.isolate_content");
+ this.tor_enabled = this._prefs.getBoolPref("extensions.torbutton.tor_enabled");
+ this.no_tor_plugins = this._prefs.getBoolPref("extensions.torbutton.no_tor_plugins");
+
return;
}
Modified: torbutton/trunk/src/components/torbutton-logger.js
===================================================================
--- torbutton/trunk/src/components/torbutton-logger.js 2007-11-23 11:43:52 UTC (rev 12558)
+++ torbutton/trunk/src/components/torbutton-logger.js 2007-11-23 11:45:28 UTC (rev 12559)
@@ -17,6 +17,13 @@
function TorbuttonLogger() {
this.prefs = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch);
+
+ // Register observer
+ var pref_service = Components.classes["@mozilla.org/preferences-service;1"]
+ .getService(Components.interfaces.nsIPrefBranchInternal);
+ this._branch = pref_service.QueryInterface(Components.interfaces.nsIPrefBranchInternal);
+ this._branch.addObserver("extensions.torbutton", this, false);
+
this.loglevel = this.prefs.getIntPref("extensions.torbutton.loglevel");
this.logmethod = this.prefs.getIntPref("extensions.torbutton.logmethod");
@@ -30,15 +37,8 @@
this._console = Components.classes["@mozilla.org/consoleservice;1"]
.getService(Components.interfaces.nsIConsoleService);
- // Register observer
- var pref_service = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefBranchInternal);
- this._branch = pref_service.QueryInterface(Components.interfaces.nsIPrefBranchInternal);
- this._branch.addObserver("extensions.torbutton", this, false);
-
// This JSObject is exported directly to chrome
this.wrappedJSObject = this;
- dump("Torbutton Logger component initialized\n");
}
/**
More information about the tor-commits
mailing list