summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/AddonManager.jsm
diff options
context:
space:
mode:
authorAscrod <32915892+Ascrod@users.noreply.github.com>2019-04-13 11:22:15 -0400
committerAscrod <32915892+Ascrod@users.noreply.github.com>2019-04-13 11:37:45 -0400
commit8757548a3e5b5cc4d159d61eb4a12c7af1be548e (patch)
tree3ad7d1f2c10d3d4c7a5d3779b2ee55cde34cfce6 /toolkit/mozapps/extensions/AddonManager.jsm
parent714e9c9074d9eb2f4063962d07bae6b4f02a1e7a (diff)
downloadUXP-8757548a3e5b5cc4d159d61eb4a12c7af1be548e.tar
UXP-8757548a3e5b5cc4d159d61eb4a12c7af1be548e.tar.gz
UXP-8757548a3e5b5cc4d159d61eb4a12c7af1be548e.tar.lz
UXP-8757548a3e5b5cc4d159d61eb4a12c7af1be548e.tar.xz
UXP-8757548a3e5b5cc4d159d61eb4a12c7af1be548e.zip
Issue #991 Part 8: Toolkit everything else
Diffstat (limited to 'toolkit/mozapps/extensions/AddonManager.jsm')
-rw-r--r--toolkit/mozapps/extensions/AddonManager.jsm79
1 files changed, 20 insertions, 59 deletions
diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm
index 4cd2c3d0a..a48e0034f 100644
--- a/toolkit/mozapps/extensions/AddonManager.jsm
+++ b/toolkit/mozapps/extensions/AddonManager.jsm
@@ -135,12 +135,7 @@ var PrefObserver = {
Services.obs.removeObserver(this, "xpcom-shutdown");
}
else if (aTopic == NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) {
- let debugLogEnabled = false;
- try {
- debugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED);
- }
- catch (e) {
- }
+ let debugLogEnabled = Services.prefs.getBoolPref(PREF_LOGGING_ENABLED, false);
if (debugLogEnabled) {
parentLogger.level = Log.Level.Debug;
}
@@ -791,11 +786,7 @@ var AddonManagerInternal = {
}
catch (e) { }
- let oldPlatformVersion = null;
- try {
- oldPlatformVersion = Services.prefs.getCharPref(PREF_EM_LAST_PLATFORM_VERSION);
- }
- catch (e) { }
+ let oldPlatformVersion = Services.prefs.getCharPref(PREF_EM_LAST_PLATFORM_VERSION, "");
if (appChanged !== false) {
logger.debug("Application has been upgraded");
@@ -808,40 +799,30 @@ var AddonManagerInternal = {
this.validateBlocklist();
}
- try {
- gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY);
- } catch (e) {}
+ gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY,
+ gCheckCompatibility);
Services.prefs.addObserver(PREF_EM_CHECK_COMPATIBILITY, this, false);
- try {
- gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY);
- } catch (e) {}
+ gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY,
+ gStrictCompatibility);
Services.prefs.addObserver(PREF_EM_STRICT_COMPATIBILITY, this, false);
- try {
- let defaultBranch = Services.prefs.getDefaultBranch("");
- gCheckUpdateSecurityDefault = defaultBranch.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY);
- } catch(e) {}
+ let defaultBranch = Services.prefs.getDefaultBranch("");
+ gCheckUpdateSecurityDefault = defaultBranch.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY,
+ gCheckUpdateSecurityDefault);
- try {
- gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY);
- } catch (e) {}
+ gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY,
+ gCheckUpdateSecurity);
Services.prefs.addObserver(PREF_EM_CHECK_UPDATE_SECURITY, this, false);
- try {
- gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED);
- } catch (e) {}
+ gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED, gUpdateEnabled);
Services.prefs.addObserver(PREF_EM_UPDATE_ENABLED, this, false);
- try {
- gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT);
- } catch (e) {}
+ gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT,
+ gAutoUpdateDefault);
Services.prefs.addObserver(PREF_EM_AUTOUPDATE_DEFAULT, this, false);
- let defaultProvidersEnabled = true;
- try {
- defaultProvidersEnabled = Services.prefs.getBoolPref(PREF_DEFAULT_PROVIDERS_ENABLED);
- } catch (e) {}
+ let defaultProvidersEnabled = Services.prefs.getBoolPref(PREF_DEFAULT_PROVIDERS_ENABLED, true);
AddonManagerPrivate.recordSimpleMeasure("default_providers", defaultProvidersEnabled);
// Ensure all default providers have had a chance to register themselves
@@ -1167,11 +1148,7 @@ var AddonManagerInternal = {
switch (aData) {
case PREF_EM_CHECK_COMPATIBILITY: {
let oldValue = gCheckCompatibility;
- try {
- gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY);
- } catch(e) {
- gCheckCompatibility = true;
- }
+ gCheckCompatibility = Services.prefs.getBoolPref(PREF_EM_CHECK_COMPATIBILITY, true);
this.callManagerListeners("onCompatibilityModeChanged");
@@ -1182,11 +1159,7 @@ var AddonManagerInternal = {
}
case PREF_EM_STRICT_COMPATIBILITY: {
let oldValue = gStrictCompatibility;
- try {
- gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY);
- } catch(e) {
- gStrictCompatibility = true;
- }
+ gStrictCompatibility = Services.prefs.getBoolPref(PREF_EM_STRICT_COMPATIBILITY, true);
this.callManagerListeners("onCompatibilityModeChanged");
@@ -1197,11 +1170,7 @@ var AddonManagerInternal = {
}
case PREF_EM_CHECK_UPDATE_SECURITY: {
let oldValue = gCheckUpdateSecurity;
- try {
- gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY);
- } catch(e) {
- gCheckUpdateSecurity = true;
- }
+ gCheckUpdateSecurity = Services.prefs.getBoolPref(PREF_EM_CHECK_UPDATE_SECURITY, true);
this.callManagerListeners("onCheckUpdateSecurityChanged");
@@ -1212,22 +1181,14 @@ var AddonManagerInternal = {
}
case PREF_EM_UPDATE_ENABLED: {
let oldValue = gUpdateEnabled;
- try {
- gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED);
- } catch(e) {
- gUpdateEnabled = true;
- }
+ gUpdateEnabled = Services.prefs.getBoolPref(PREF_EM_UPDATE_ENABLED, true);
this.callManagerListeners("onUpdateModeChanged");
break;
}
case PREF_EM_AUTOUPDATE_DEFAULT: {
let oldValue = gAutoUpdateDefault;
- try {
- gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT);
- } catch(e) {
- gAutoUpdateDefault = true;
- }
+ gAutoUpdateDefault = Services.prefs.getBoolPref(PREF_EM_AUTOUPDATE_DEFAULT, true);
this.callManagerListeners("onUpdateModeChanged");
break;