[tor-commits] [torbutton/master] Add 1506 comments pointed out by Georg.
mikeperry at torproject.org
mikeperry at torproject.org
Tue Jul 10 18:50:00 UTC 2012
commit 7d14292f14c24bff161bba4dffd4f5fe20163758
Author: Mike Perry <mikeperry-git at fscked.org>
Date: Tue Jul 10 11:49:10 2012 -0700
Add 1506 comments pointed out by Georg.
---
src/chrome/content/contents.rdf | 1 +
src/chrome/content/torbutton_util.js | 9 +++++++++
src/chrome/content/torcookie.js | 2 ++
src/chrome/skin/contents.rdf | 1 +
src/components/crash-observer.js | 12 ++++++++----
5 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/src/chrome/content/contents.rdf b/src/chrome/content/contents.rdf
index 5c91f87..c7afa3a 100644
--- a/src/chrome/content/contents.rdf
+++ b/src/chrome/content/contents.rdf
@@ -1,3 +1,4 @@
+<!-- Bug 1506 P0: This is old FF2 cruft. It does not need to exist. -->
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
diff --git a/src/chrome/content/torbutton_util.js b/src/chrome/content/torbutton_util.js
index b93162e..b6b4966 100644
--- a/src/chrome/content/torbutton_util.js
+++ b/src/chrome/content/torbutton_util.js
@@ -1,3 +1,8 @@
+// Bug 1506 P0-P3: These utility functions might be useful, but
+// you probably just want to rewrite them or use the underlying
+// code directly. I don't see any of them as essential for 1506,
+// really.
+
var m_tb_torlog = Components.classes["@torproject.org/torbutton-logger;1"]
.getService(Components.interfaces.nsISupports).wrappedJSObject;
@@ -21,6 +26,7 @@ if(versionChecker.compare(appInfo.version, "5.0a1") >= 0) {
}
+// Bug 1506 P0: Use the log service directly
function torbutton_eclog(nLevel, sMsg) {
m_tb_torlog.eclog(nLevel, sMsg);
return true;
@@ -64,6 +70,9 @@ function torbutton_get_prefbranch(branch_name) {
return o_branch;
}
+// Bug 1506 P3: This would be a semi-polite thing to do on uninstall
+// for pure Firefox users. The most polite thing would be to save
+// all their original prefs.. But meh?
function torbutton_reset_browser_prefs() {
var o_all_prefs = torbutton_get_prefbranch('');
var prefs = ["network.http.sendSecureXSiteReferrer",
diff --git a/src/chrome/content/torcookie.js b/src/chrome/content/torcookie.js
index b57a263..fb8b02c 100644
--- a/src/chrome/content/torcookie.js
+++ b/src/chrome/content/torcookie.js
@@ -1,3 +1,5 @@
+// Bug 1506 P2: I think cookie protections is a neat feature.
+
var cookiesTree = null;
var prefs = null;
var cookies = [];
diff --git a/src/chrome/skin/contents.rdf b/src/chrome/skin/contents.rdf
index ed9b4c9..53bde17 100644
--- a/src/chrome/skin/contents.rdf
+++ b/src/chrome/skin/contents.rdf
@@ -1,3 +1,4 @@
+<!-- Bug 1506 P0: This is old FF2 cruft. It does not need to exist. -->
<?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
diff --git a/src/components/crash-observer.js b/src/components/crash-observer.js
index 96e9bad..776aed5 100644
--- a/src/components/crash-observer.js
+++ b/src/components/crash-observer.js
@@ -1,4 +1,4 @@
-// Bug 1506 P1-2: This code is mostly hackish remnants of session store
+// Bug 1506 P1-3: This code is mostly hackish remnants of session store
// support. There are a couple of observer events that *might* be worth
// listening to. Search for 1506 in the code.
@@ -55,6 +55,8 @@ function CrashObserver() {
}
if (this.is_ff4) {
+ // Bug 1506 P2/P3: You probably want to register this observer to clean up
+ // prefs if you're going to support using normal firefox.
Components.utils.import("resource://gre/modules/AddonManager.jsm");
this.onEnabling = this.onOperationCancelled;
this.onDisabling = this.onUninstalling;
@@ -74,6 +76,8 @@ CrashObserver.prototype = {
// us somehow, we will leave the browser in a sorry state... Let's hope they
// have the sense not to uninstall addons after an improper shutdown/crash
// (or at least give us this event again in that case).
+ // Bug 1506 P2/P3: You probably want to register this observer to clean up
+ // prefs if you're going to support using normal firefox.
onUninstalling: function(addon, needsRestart) {
if (addon.id.toUpperCase() == TORBUTTON_EXTENSION_UUID) {
this._uninstall = true;
@@ -89,6 +93,8 @@ CrashObserver.prototype = {
// This is done in the constructor. JS doesn't allow this...
//onDisabling: this.onUninstalling,
+ // Bug 1506 P2/P3: You probably want to register this observer to clean up
+ // prefs if you're going to support using normal firefox.
onOperationCancelled: function(addon) {
if (addon.id.toUpperCase() == TORBUTTON_EXTENSION_UUID) {
this.logger.log(4, "Uninstall of Torbutton canceled. Hurray!");
@@ -111,8 +117,6 @@ CrashObserver.prototype = {
}
this._prefs.setBoolPref("extensions.torbutton.normal_exit", false);
} else if (topic == "em-action-requested") {
- // Bug 1506 P2/P4: You probably want to register this observer to clean up
- // prefs if you're going to support using normal firefox.
this.logger.log(3, "Uninstall action requested..");
// http://xulsolutions.blogspot.com/2006/07/creating-uninstall-script-for.html
subject.QueryInterface(Components.interfaces.nsIUpdateItem);
@@ -127,7 +131,7 @@ CrashObserver.prototype = {
}
}
} else if (topic == "quit-application-granted") {
- // Bug 1506 P2/P4: You probably want to register this observer to clean up
+ // Bug 1506 P2/P3: You probably want to register this observer to clean up
// prefs if you're going to support using normal firefox.
this.logger.log(3, "Got firefox quit event.");
var chrome = null;
More information about the tor-commits
mailing list