From 6b968b13d9cab02d8634facc87ae39e51dee4020 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Sat, 30 Mar 2019 20:03:33 +0100 Subject: Issue #187: Remove solaris 1st party code OS checks. --- toolkit/components/osfile/modules/osfile_unix_back.jsm | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'toolkit/components/osfile/modules') diff --git a/toolkit/components/osfile/modules/osfile_unix_back.jsm b/toolkit/components/osfile/modules/osfile_unix_back.jsm index a028dda7d..bf5c66b8d 100644 --- a/toolkit/components/osfile/modules/osfile_unix_back.jsm +++ b/toolkit/components/osfile/modules/osfile_unix_back.jsm @@ -585,17 +585,10 @@ } else if (Const._STAT_VER != undefined) { const ver = Const._STAT_VER; let xstat_name, lxstat_name, fxstat_name; - if (OS.Constants.Sys.Name == "SunOS") { - // Solaris - xstat_name = "_xstat"; - lxstat_name = "_lxstat"; - fxstat_name = "_fxstat"; - } else { - // Linux, all widths - xstat_name = "__xstat"; - lxstat_name = "__lxstat"; - fxstat_name = "__fxstat"; - } + // Linux, all widths + xstat_name = "__xstat"; + lxstat_name = "__lxstat"; + fxstat_name = "__fxstat"; let Stat = {}; libc.declareLazyFFI(Stat, "xstat", -- cgit v1.2.3 From 714e9c9074d9eb2f4063962d07bae6b4f02a1e7a Mon Sep 17 00:00:00 2001 From: Ascrod <32915892+Ascrod@users.noreply.github.com> Date: Sat, 13 Apr 2019 10:53:58 -0400 Subject: Issue #991 Part 7: Toolkit Components --- .../osfile/modules/osfile_async_front.jsm | 40 ++++++---------------- 1 file changed, 10 insertions(+), 30 deletions(-) (limited to 'toolkit/components/osfile/modules') diff --git a/toolkit/components/osfile/modules/osfile_async_front.jsm b/toolkit/components/osfile/modules/osfile_async_front.jsm index 93c7e66d6..1d1d7c73f 100644 --- a/toolkit/components/osfile/modules/osfile_async_front.jsm +++ b/toolkit/components/osfile/modules/osfile_async_front.jsm @@ -239,10 +239,9 @@ var Scheduler = this.Scheduler = { * Prepare to kill the OS.File worker after a few seconds. */ restartTimer: function(arg) { - let delay; - try { - delay = Services.prefs.getIntPref("osfile.reset_worker_delay"); - } catch(e) { + let delay = Services.prefs.getIntPref("osfile.reset_worker_delay", 0); + + if (!delay) { // Don't auto-shutdown if we don't have a delay preference set. return; } @@ -468,43 +467,25 @@ var Scheduler = this.Scheduler = { const PREF_OSFILE_LOG = "toolkit.osfile.log"; const PREF_OSFILE_LOG_REDIRECT = "toolkit.osfile.log.redirect"; -/** - * Safely read a PREF_OSFILE_LOG preference. - * Returns a value read or, in case of an error, oldPref or false. - * - * @param bool oldPref - * An optional value that the DEBUG flag was set to previously. - */ -function readDebugPref(prefName, oldPref = false) { - let pref = oldPref; - try { - pref = Services.prefs.getBoolPref(prefName); - } catch (x) { - // In case of an error when reading a pref keep it as is. - } - // If neither pref nor oldPref were set, default it to false. - return pref; -}; - /** * Listen to PREF_OSFILE_LOG changes and update gShouldLog flag * appropriately. */ Services.prefs.addObserver(PREF_OSFILE_LOG, function prefObserver(aSubject, aTopic, aData) { - SharedAll.Config.DEBUG = readDebugPref(PREF_OSFILE_LOG, SharedAll.Config.DEBUG); + SharedAll.Config.DEBUG = Services.prefs.getBoolPref(PREF_OSFILE_LOG, SharedAll.Config.DEBUG); if (Scheduler.launched) { // Don't start the worker just to set this preference. Scheduler.post("SET_DEBUG", [SharedAll.Config.DEBUG]); } }, false); -SharedAll.Config.DEBUG = readDebugPref(PREF_OSFILE_LOG, false); +SharedAll.Config.DEBUG = Services.prefs.getBoolPref(PREF_OSFILE_LOG, false); Services.prefs.addObserver(PREF_OSFILE_LOG_REDIRECT, function prefObserver(aSubject, aTopic, aData) { - SharedAll.Config.TEST = readDebugPref(PREF_OSFILE_LOG_REDIRECT, OS.Shared.TEST); + SharedAll.Config.TEST = Services.prefs.getBoolPref(PREF_OSFILE_LOG_REDIRECT, OS.Shared.TEST); }, false); -SharedAll.Config.TEST = readDebugPref(PREF_OSFILE_LOG_REDIRECT, false); +SharedAll.Config.TEST = Services.prefs.getBoolPref(PREF_OSFILE_LOG_REDIRECT, false); /** @@ -515,7 +496,7 @@ var nativeWheneverAvailable = true; const PREF_OSFILE_NATIVE = "toolkit.osfile.native"; Services.prefs.addObserver(PREF_OSFILE_NATIVE, function prefObserver(aSubject, aTopic, aData) { - nativeWheneverAvailable = readDebugPref(PREF_OSFILE_NATIVE, nativeWheneverAvailable); + nativeWheneverAvailable = Services.prefs.getBoolPref(PREF_OSFILE_NATIVE, nativeWheneverAvailable); }, false); @@ -557,10 +538,9 @@ Services.prefs.addObserver(PREF_OSFILE_TEST_SHUTDOWN_OBSERVER, function prefObserver() { // The temporary phase topic used to trigger the unclosed // phase warning. - let TOPIC = null; + let TOPIC = Services.prefs.getCharPref(PREF_OSFILE_TEST_SHUTDOWN_OBSERVER, + ""); try { - TOPIC = Services.prefs.getCharPref( - PREF_OSFILE_TEST_SHUTDOWN_OBSERVER); } catch (x) { } if (TOPIC) { -- cgit v1.2.3 From 21b4cb27cabecdb5580c01891801c9259689ec87 Mon Sep 17 00:00:00 2001 From: Ascrod <32915892+Ascrod@users.noreply.github.com> Date: Thu, 18 Apr 2019 20:37:23 -0400 Subject: Remove unused try/catch block. Tag #991. --- toolkit/components/osfile/modules/osfile_async_front.jsm | 3 --- 1 file changed, 3 deletions(-) (limited to 'toolkit/components/osfile/modules') diff --git a/toolkit/components/osfile/modules/osfile_async_front.jsm b/toolkit/components/osfile/modules/osfile_async_front.jsm index 1d1d7c73f..9f3b7fb21 100644 --- a/toolkit/components/osfile/modules/osfile_async_front.jsm +++ b/toolkit/components/osfile/modules/osfile_async_front.jsm @@ -540,9 +540,6 @@ Services.prefs.addObserver(PREF_OSFILE_TEST_SHUTDOWN_OBSERVER, // phase warning. let TOPIC = Services.prefs.getCharPref(PREF_OSFILE_TEST_SHUTDOWN_OBSERVER, ""); - try { - } catch (x) { - } if (TOPIC) { // Generate a phase, add a blocker. // Note that this can work only if AsyncShutdown itself has been -- cgit v1.2.3