[Pkg-mozext-commits] [perspectives-extension] 31/44: Pers_util - remove root_prefs use from update functions

David Prévot taffit at moszumanska.debian.org
Sun Jun 26 04:59:20 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository perspectives-extension.

commit a597b36066b4f49b3c9dd2b7e3f5f3b9b5835ab5
Author: Dave Schaefer <dave.schaefer at gmail.com>
Date:   Tue Jun 14 20:56:35 2016 -0700

    Pers_util - remove root_prefs use from update functions
    
    These functions should be able to retrieve data without relying on
    the underlying state of any stringbundles or preferences.
    
    This form of usage was hiding a bug that triggered
    when root_prefs was null or undefined.
---
 plugin/chrome/content/common.js             | 8 ++++----
 plugin/chrome/content/notaries.js           | 4 ++--
 plugin/chrome/content/preferences_dialog.js | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/plugin/chrome/content/common.js b/plugin/chrome/content/common.js
index 390f293..5cf5dc7 100644
--- a/plugin/chrome/content/common.js
+++ b/plugin/chrome/content/common.js
@@ -221,7 +221,7 @@ var Pers_util = {
 	update_public_key : "MIHKMA0GCSqGSIb3DQEBAQUAA4G4ADCBtAKBrAF16BJZAsESZnEq6MeCYsntL1233FVdz/6dNXptTwoKACOcnoae+/S5d9Ms2kmQMTMWkW5NdRV2/iKIdQx14Y7GZojPYvL85ZjwlTXRblqwoxnwdE+Vd2V5itxV0Okcu2+E66tvtr6aeBVt7hwtowyQPgiWz2rDgV6RsohbetiaHUMZKDdoQFzu/5CAW+7QtbFoJjNMqez6pz80xFWrIJzRC+fXlues1Af37+cCAwEAAQ==",
 	update_list_uri : "http://update.networknotary.org/http_notary_list.txt",
 	update_sig_uri : "http://update.networknotary.org/http_notary_list.sig",
-	update_default_notary_list_from_web: function(root_prefs) {
+	update_default_notary_list_from_web: function() {
 		try {
 			var notary_list_data = Pers_util.readFileFromURI(this.update_list_uri);
 			var sig_no_header = Pers_util.readFileFromURI(this.update_sig_uri);
@@ -233,7 +233,7 @@ var Pers_util = {
         			Pers_debug.d_print("error", "Signature verification failed on notary list update");
 				return;
 			}
-			root_prefs.setCharPref("extensions.perspectives.default_notary_list",notary_list_data);
+			Perspectives.setCharPref("extensions.perspectives.default_notary_list",notary_list_data);
 		} catch(e) {
 			Pers_debug.d_print("error", Perspectives.getFormattedString(
 				"updateDefaultListWebError", [e]));
@@ -241,10 +241,10 @@ var Pers_util = {
 
 	},
 
-	update_default_notary_list_from_file : function(root_prefs) {
+	update_default_notary_list_from_file : function() {
 		try {
 			var notary_list_data = this.readFileFromURI("chrome://perspectives/content/http_notary_list.txt");
-			root_prefs.setCharPref("extensions.perspectives.default_notary_list",notary_list_data);
+			Perspectives.setCharPref("extensions.perspectives.default_notary_list",notary_list_data);
 		} catch(e) {
 			Pers_debug.d_print("error", Perspectives.getFormattedString(
 				"updateDefaultListFileError", [e]));
diff --git a/plugin/chrome/content/notaries.js b/plugin/chrome/content/notaries.js
index 8163879..8107cd3 100644
--- a/plugin/chrome/content/notaries.js
+++ b/plugin/chrome/content/notaries.js
@@ -1095,9 +1095,9 @@ var Perspectives = {
 
 			var auto_update = this.root_prefs.getBoolPref("extensions.perspectives.enable_default_list_auto_update");
 			if(auto_update) {
-				Pers_util.update_default_notary_list_from_web(Perspectives.getRootPrefs());
+				Pers_util.update_default_notary_list_from_web();
 			} else {
-				Pers_util.update_default_notary_list_from_file(Perspectives.getRootPrefs());
+				Pers_util.update_default_notary_list_from_file();
 			}
 			Pers_debug.d_print("main", Perspectives.notaries);
 			Pers_statusbar.setStatus(null, Pers_statusbar.STATE_NEUT, "");
diff --git a/plugin/chrome/content/preferences_dialog.js b/plugin/chrome/content/preferences_dialog.js
index a10b1c6..30f3d0b 100644
--- a/plugin/chrome/content/preferences_dialog.js
+++ b/plugin/chrome/content/preferences_dialog.js
@@ -229,9 +229,9 @@ var Pers_pref = {
 			// list to show based on whether the checkbox is selected.
 			var auto_update = document.getElementById("enable_default_list_auto_update").checked;
 			if(auto_update) {
-				Pers_util.update_default_notary_list_from_web (this.root_prefs);
+				Pers_util.update_default_notary_list_from_web();
 			} else {
-				Pers_util.update_default_notary_list_from_file(this.root_prefs);
+				Pers_util.update_default_notary_list_from_file();
 			}
 			this.load_preferences();
 		} catch(e) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/perspectives-extension.git



More information about the Pkg-mozext-commits mailing list